fix: generalize registration form and add team preference #234

Merged
forgejo_admin merged 1 commit from 233-fix-registration-form into main 2026-04-07 19:29:32 +00:00
Contributor

Summary

Removes tryout-specific language from the registration form to make it suitable for general 2026 season registration. Adds a team preference dropdown that fetches available teams from the API and filters by division.

Changes

  • src/routes/(app)/register/+page.svelte:
    • Changed subtitle from "2026 Girls Tryouts - 15U 16U 17U" to "2026 Season"
    • Changed "Tryout Registration ($30)" to "Registration ($30)"
    • Updated remote evaluation description to remove "in-person tryout" reference
    • Updated success page step 3 messaging (both Stripe and promo code paths) to "Check your email for your login credentials and next steps"
    • Added teamPreference state + teams fetch from /public/teams on mount
    • Added team preference dropdown after Division select, filtered by selected division, with "No Preference" default
    • Added team_preference to POST payload (sends team name string or null)
    • Reset team preference when division changes

Test Plan

  • Load registration page — subtitle should read "2026 Season"
  • Select a division — team preference dropdown appears if teams exist for that division
  • Switch division — team preference resets to "No Preference"
  • Submit with no team preference — payload has team_preference: null
  • Submit with a team selected — payload has the team name string
  • Complete registration via Stripe — success page step 3 mentions login credentials
  • Complete registration via promo code — success page step 3 mentions login credentials

Review Checklist

  • No Tailwind — pure CSS vars + explicit styles
  • Team preference uses existing form-group/form-label/form-select classes
  • team_preference is optional — sends null when empty
  • Teams fetch failure is silently caught — doesn't break form
  • Division change resets team preference

N/A

## Summary Removes tryout-specific language from the registration form to make it suitable for general 2026 season registration. Adds a team preference dropdown that fetches available teams from the API and filters by division. ## Changes - `src/routes/(app)/register/+page.svelte`: - Changed subtitle from "2026 Girls Tryouts - 15U 16U 17U" to "2026 Season" - Changed "Tryout Registration ($30)" to "Registration ($30)" - Updated remote evaluation description to remove "in-person tryout" reference - Updated success page step 3 messaging (both Stripe and promo code paths) to "Check your email for your login credentials and next steps" - Added `teamPreference` state + teams fetch from `/public/teams` on mount - Added team preference dropdown after Division select, filtered by selected division, with "No Preference" default - Added `team_preference` to POST payload (sends team name string or null) - Reset team preference when division changes ## Test Plan - Load registration page — subtitle should read "2026 Season" - Select a division — team preference dropdown appears if teams exist for that division - Switch division — team preference resets to "No Preference" - Submit with no team preference — payload has `team_preference: null` - Submit with a team selected — payload has the team name string - Complete registration via Stripe — success page step 3 mentions login credentials - Complete registration via promo code — success page step 3 mentions login credentials ## Review Checklist - [x] No Tailwind — pure CSS vars + explicit styles - [x] Team preference uses existing form-group/form-label/form-select classes - [x] team_preference is optional — sends null when empty - [x] Teams fetch failure is silently caught — doesn't break form - [x] Division change resets team preference ## Related - Closes #233 ## Related Notes N/A
fix: generalize registration form and add team preference dropdown
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
22ead45530
Remove tryout-specific language from registration form (subtitle, labels,
descriptions) to make it suitable for general season registration. Update
success page messaging to reference login credentials. Add team preference
dropdown that fetches from /public/teams and filters by selected division.

Closes #233

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Contributor

QA Review — PR #234

Summary

Single-file change to src/routes/(app)/register/+page.svelte (30 additions, 7 deletions). Generalizes registration form language and adds team preference dropdown.

Findings

All requested changes verified:

  1. Subtitle changed from "2026 Girls Tryouts - 15U 16U 17U" to "2026 Season" -- correct
  2. "Tryout Registration ($30)" changed to "Registration ($30)" -- correct
  3. Remote eval description updated to remove "in-person tryout" -- correct
  4. Both success states (Stripe payment + promo code) step 3 updated to "Check your email for your login credentials and next steps" -- correct
  5. Team preference dropdown added after Division select with division filtering -- correct
  6. team_preference added to POST payload as teamPreference || null -- correct

Code quality:

  • Teams fetch uses existing API_BASE from $lib/api.js -- consistent with codebase
  • Fetch failure silently caught -- form works even if /public/teams is unavailable
  • filteredTeams uses $derived correctly for reactive filtering
  • Division change resets teamPreference to empty string via onchange handler
  • Dropdown only renders when filteredTeams.length > 0 -- no empty dropdown
  • Uses existing form-group, form-label, form-select classes -- no new CSS needed
  • No Tailwind -- pure CSS vars convention followed

No issues found.

VERDICT: APPROVED

## QA Review — PR #234 ### Summary Single-file change to `src/routes/(app)/register/+page.svelte` (30 additions, 7 deletions). Generalizes registration form language and adds team preference dropdown. ### Findings **All requested changes verified:** 1. Subtitle changed from "2026 Girls Tryouts - 15U 16U 17U" to "2026 Season" -- correct 2. "Tryout Registration ($30)" changed to "Registration ($30)" -- correct 3. Remote eval description updated to remove "in-person tryout" -- correct 4. Both success states (Stripe payment + promo code) step 3 updated to "Check your email for your login credentials and next steps" -- correct 5. Team preference dropdown added after Division select with division filtering -- correct 6. `team_preference` added to POST payload as `teamPreference || null` -- correct **Code quality:** - Teams fetch uses existing `API_BASE` from `$lib/api.js` -- consistent with codebase - Fetch failure silently caught -- form works even if `/public/teams` is unavailable - `filteredTeams` uses `$derived` correctly for reactive filtering - Division change resets `teamPreference` to empty string via `onchange` handler - Dropdown only renders when `filteredTeams.length > 0` -- no empty dropdown - Uses existing `form-group`, `form-label`, `form-select` classes -- no new CSS needed - No Tailwind -- pure CSS vars convention followed **No issues found.** ### VERDICT: APPROVED
Author
Contributor

PR #234 Review

DOMAIN REVIEW

Stack: SvelteKit (Svelte 5 runes), pure CSS, single-file change.

SvelteKit / Svelte 5 patterns:

  • Correct use of $state and $derived runes for teamPreference, teams, and filteredTeams.
  • onMount fetch with .catch(() => {}) -- graceful degradation if teams endpoint is unavailable. Good.
  • Division onchange handler resets teamPreference to '', preventing stale selection across division switches.
  • Conditional rendering ({#if filteredTeams.length > 0}) correctly hides the dropdown when no teams match the selected division.
  • team_preference: teamPreference || null correctly sends null when no preference is selected (empty string is falsy).

Accessibility:

  • Team preference dropdown has a proper <label> with for="team-preference" matching the <select> id.
  • Helper text via <div class="form-note"> provides context.
  • No new ARIA gaps introduced.

CSS:

  • No Tailwind. All styling uses existing classes: form-group, form-label, form-select, form-note. Consistent with the rest of the form.

BLOCKERS

None.

  • No new functionality without tests: This is a form UI change in a landing page repo. The team preference is optional and fails gracefully. No backend logic introduced here.
  • No unvalidated user input: team_preference sends a string from a controlled <select> dropdown (server-populated options) or null. No free-text injection surface.
  • No secrets or credentials in code.
  • No duplicated auth/security logic.

NITS

  1. Stale registrationType value: The radio button value is still 'tryout' and the state initializes as 'tryout'. The label now reads "Registration ($30)" but the submitted value remains registrationType: 'tryout'. This is cosmetic if the API expects 'tryout' as the enum value, but worth tracking as discovered scope if it should be renamed to something like 'standard' in a future pass.

  2. Type annotation style: /** @type {{ name: string, division: string }[]} */ is fine JSDoc, but if the repo ever adopts .svelte.ts modules, this could become a proper TypeScript interface. Not blocking.

SOP COMPLIANCE

  • Branch named after issue: 233-fix-registration-form follows {issue-number}-{kebab-case-purpose} convention
  • PR body follows template: Summary, Changes, Test Plan, Review Checklist, Related sections all present
  • Related references issue: "Closes #233"
  • No secrets committed
  • No unrelated file changes: single file, 30 additions / 7 deletions, all on-topic
  • Related references plan slug: N/A -- standalone fix, no plan

PROCESS OBSERVATIONS

Clean, focused PR. Single file change with no scope creep. The test plan in the PR body is thorough and covers all verification points. The team preference feature degrades gracefully -- fetch failure does not break the form. Change failure risk is low.

The registrationType === 'tryout' enum value surviving this rename pass is minor technical debt worth a follow-up ticket if the API side wants to generalize.

VERDICT: APPROVED

## PR #234 Review ### DOMAIN REVIEW **Stack:** SvelteKit (Svelte 5 runes), pure CSS, single-file change. **SvelteKit / Svelte 5 patterns:** - Correct use of `$state` and `$derived` runes for `teamPreference`, `teams`, and `filteredTeams`. - `onMount` fetch with `.catch(() => {})` -- graceful degradation if teams endpoint is unavailable. Good. - Division `onchange` handler resets `teamPreference` to `''`, preventing stale selection across division switches. - Conditional rendering (`{#if filteredTeams.length > 0}`) correctly hides the dropdown when no teams match the selected division. - `team_preference: teamPreference || null` correctly sends `null` when no preference is selected (empty string is falsy). **Accessibility:** - Team preference dropdown has a proper `<label>` with `for="team-preference"` matching the `<select>` id. - Helper text via `<div class="form-note">` provides context. - No new ARIA gaps introduced. **CSS:** - No Tailwind. All styling uses existing classes: `form-group`, `form-label`, `form-select`, `form-note`. Consistent with the rest of the form. ### BLOCKERS None. - No new functionality without tests: This is a form UI change in a landing page repo. The team preference is optional and fails gracefully. No backend logic introduced here. - No unvalidated user input: `team_preference` sends a string from a controlled `<select>` dropdown (server-populated options) or null. No free-text injection surface. - No secrets or credentials in code. - No duplicated auth/security logic. ### NITS 1. **Stale `registrationType` value:** The radio button value is still `'tryout'` and the state initializes as `'tryout'`. The label now reads "Registration ($30)" but the submitted value remains `registrationType: 'tryout'`. This is cosmetic if the API expects `'tryout'` as the enum value, but worth tracking as discovered scope if it should be renamed to something like `'standard'` in a future pass. 2. **Type annotation style:** `/** @type {{ name: string, division: string }[]} */` is fine JSDoc, but if the repo ever adopts `.svelte.ts` modules, this could become a proper TypeScript interface. Not blocking. ### SOP COMPLIANCE - [x] Branch named after issue: `233-fix-registration-form` follows `{issue-number}-{kebab-case-purpose}` convention - [x] PR body follows template: Summary, Changes, Test Plan, Review Checklist, Related sections all present - [x] Related references issue: "Closes #233" - [x] No secrets committed - [x] No unrelated file changes: single file, 30 additions / 7 deletions, all on-topic - [ ] Related references plan slug: N/A -- standalone fix, no plan ### PROCESS OBSERVATIONS Clean, focused PR. Single file change with no scope creep. The test plan in the PR body is thorough and covers all verification points. The team preference feature degrades gracefully -- fetch failure does not break the form. Change failure risk is low. The `registrationType === 'tryout'` enum value surviving this rename pass is minor technical debt worth a follow-up ticket if the API side wants to generalize. ### VERDICT: APPROVED
forgejo_admin deleted branch 233-fix-registration-form 2026-04-07 19:29:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/westside-app!234
No description provided.