Review: Fix local teams schedule — group by team name

review-804-2026-04-03 Doc

review ready

Verdict: READY

Template Completeness

  • [x] Type — Bug
  • [x] Lineage — references schedule page overhaul and travel teams fix
  • [x] Repo — forgejo_admin/westside-landing
  • [x] What Broke — clear description: 4 cards with DB labels instead of 2 grouped by team name
  • [x] Repro Steps — 3 steps, clear and reproducible
  • [x] Expected Behavior — exact expected output with team names and practice days
  • [x] Environment — prod and dev URLs provided
  • [x] File Targets — specific file to modify with implementation guidance, plus explicit "files NOT to touch"
  • [x] Acceptance Criteria — 3 criteria, all testable
  • [x] Test Expectations — visual verification + npm run build
  • [x] Constraints — CSS vars, no Tailwind, match existing pattern
  • [x] Checklist — present
  • [x] Related — project and parent issue referenced

Traceability

  • [x] story:WS-S13 — "As an admin, I want to view and manage the program schedule (practices, tournaments, games) so that I have a single source of truth for all planned activities" — verified in project-westside-basketball user-stories section (Admin list)
  • [x] arch:landing-site — label present on board item
  • [ ] arch note MISSING — [SCOPE] No arch-landing-site note found in pal-e-docs. Create architecture note arch-landing-site for the westside public landing site component.
  • [x] Forgejo issue — forgejo_admin/westside-landing#209, open

File Targets

  • [x] src/routes/(public)/schedule/+page.svelte — verified exists (350 lines). Contains groupByTeam function (line 118-126) that groups by p.label || p.team_name. This is the root cause: DB labels like "16U LOCAL KINGS MON PRACTICE" are unique per slot, so each practice gets its own card. The local teams template (lines 252-266) already iterates localTeamGroups correctly — only the grouping key needs to extract the team name from the label.
Targets are specific enough for an agent to act on without guessing.

Repo Placement

OK. Issue filed on forgejo_admin/westside-landing, fix is in the same repo (local dir ~/westside-app). Frontend-only change confirmed by code inspection — no backend or API changes needed.

Dependencies

  • [x] Schedule API endpoints (board #630) — done, merged
  • [x] Public schedule endpoint (board #653) — done, merged
  • [x] Seed practice_schedules table (board #739) — done, merged
  • [x] Fix public schedule page schema (board #757) — done, merged
No unresolved dependencies. All prerequisite data pipeline work is complete.

Acceptance Criteria

  • "Local teams show 2 cards (16U Local Kings, 17U Local Kings)" — testable visually on dev overlay, verifiable by inspecting grouping logic
  • "Each card lists all practice days with day name, location, time" — testable visually
  • "Team name is clean" — verifiable by grepping the grouping key extraction logic
All criteria are specific and agent-verifiable. No ambiguous language.

Blast Radius

  • 1 file touched in 1 repo. Rollback is a single revert.
  • queensTeamGroups uses the same groupByTeam function (line 158) but is never rendered in the template — queens practices use queensByDay instead. No impact.
  • Travel teams use groupByDay — not affected.
  • Fallback data (lines 81-89) uses team_name field directly. The groupByTeam function falls through to p.team_name when p.label is absent, so fallback path must be preserved. Low risk — the fix only changes the label-parsing branch.

Decomposition Assessment

  • 1 file target in 1 repo — well under the 3-file limit
  • 3 acceptance criteria — within bounds
  • Estimated agent time: under 5 minutes (modify grouping key in one function or add a team-name extraction helper)
  • No independent subtasks to parallelize
No decomposition needed.

Recommendation

  • [SCOPE] Create architecture note arch-landing-site for the westside public landing site component. Not a blocker for this ticket — the label is correct, the backing note is missing platform-wide.
No body or label fixes needed. Scope is solid and ready for agent execution.