feat: coach dashboard schedule tab with live data #217
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/westside-app!217
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "213-coach-dashboard-schedule"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the "Coming soon" placeholder on the coach dashboard Schedule tab with a functional schedule display. Fetches
/public/scheduleand filters client-side by the coach's team IDs from/coaches/me. Pure frontend -- no backend changes.Changes
src/routes/(app)/coach/+page.svelte-- AddedpublicFetchimport, schedule state variables, helper functions (formatTime, dayName, formatDate, formatDateRange, groupByTeam, sortEventsByDate), schedule data fetching inside existing onMount, and replaced the placeholder markup with practice cards grouped by team name and event cards sorted by date. Added scoped CSS for schedule card layout matching admin schedule visual patterns.Test Plan
svelte-checkpasses with 0 errors (7 pre-existing warnings)Review Checklist
svelte-checkpasses with 0 errorsRelated Notes
story:WS-S27/coaches/me+/public/schedule(no changes)Related
Closes #213
PR #217 Review — QA Agent
DOMAIN REVIEW
Tech stack: SvelteKit 5 (runes mode with
$state,$derived), vanilla CSS, Capacitor mobile wrapper.SvelteKit patterns: Proper use of Svelte 5 runes (
$state,$derived),onMountfor data fetching, scoped<style>blocks. Tab navigation correctly usesrole="tablist"/role="tab"/aria-selectedfor accessibility.Schedule filtering logic: The coach dashboard fetches
/coaches/mefor team IDs, then/public/schedulefor all practices/events, filtering client-side byteam_id. Events use a two-tier filter: directteam_idmatch first, then division fallback for unscoped events, with deduplication by event ID. Correct and handles edge cases well.Reactivity:
practicesByTeamandsortedEventsuse$derivedcorrectly.Error handling: Catch block gracefully degrades showing coach name and error message.
scheduleLoadingproperly set infinallyblock.BLOCKERS
None hard.
1. DRY violation — duplicated utility functions (strong nit)
Six functions copy-pasted between
src/routes/(public)/schedule/+page.svelteandsrc/routes/(app)/coach/+page.svelte:DAY_NAMESconstantformatTime()formatDate()formatDateRange()dayName()groupByTeam()(near-identical — coach version adds_team_namefield lookup)Recommend extracting to a shared
$lib/schedule-utils.jsmodule. Not a hard blocker (not auth/security path) but a maintenance risk — any bug fix must be applied in two places.2. No test coverage (pre-existing)
The entire project has zero test infrastructure (no vitest/jest/playwright in
package.json). This is a pre-existing condition, not introduced by this PR.NITS
Inconsistent
$derivedstyle (line 166):filteredPlayersuses$derived(() => {...})returning a closure, whilepracticesByTeamandsortedEventsuse$derived(expression). Pick one pattern.Loose typing: Heavy use of
anytypes throughout. Consider defining interfaces for Practice, Event, and Coach objects.Missing
tabpanelaria-labelledby: Therole="tabpanel"divs lackaria-labelledbyattributes linking to their tab buttons. Minor a11y gap.CSS breakpoint:
@media (min-width: 640px)doesn't match standard project breakpoints (375/768/1280). Reasonable but worth noting.parent_phonein coach view: Showing parent phone numbers directly — consider whether this PII needs access control or visual de-emphasis.SOP COMPLIANCE
213-coach-dashboard-scheduleVERDICT: APPROVED
Functionally correct, proper error handling, appropriate SvelteKit 5 patterns. DRY duplication is a real concern but doesn't meet strict blocker criteria. Lack of tests is a project-wide gap, not introduced here. Recommend utility extraction as a fast follow-up.