Extract shared schedule utilities to $lib/schedule-utils.js #219
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#219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Feature
User Story
story:WS-S13As an admin, I want the codebase maintainable so that schedule features don't accumulate duplicate logic.What Broke
Nothing broken — this is a DRY extraction flagged as a nit by QA on both PR #217 and PR #218.
Repro Steps
src/routes/(public)/schedule/+page.sveltesrc/routes/(app)/coach/+page.sveltesrc/routes/(app)/my-players/+page.svelteExpected Behavior
Shared utilities in
src/lib/schedule-utils.jsimported by all three pages.Environment
westside-landing SvelteKit app
Lineage
story:WS-S13arch:landing-siteRepo
forgejo_admin/westside-landingContext
QA reviews on PR #217 (coach dashboard) and PR #218 (parent dashboard) both flagged the same DRY violation: time formatting helpers, day-of-week mapping, and schedule grouping logic are duplicated across 3 files. The public schedule page (#216) was the first implementation; coach and parent pages copied the pattern.
File Targets
src/lib/schedule-utils.js— NEW: shared utility modulesrc/routes/(public)/schedule/+page.svelte— refactor to import from shared utilssrc/routes/(app)/coach/+page.svelte— refactor to import from shared utilssrc/routes/(app)/my-players/+page.svelte— refactor to import from shared utilsAcceptance Criteria
$lib/schedule-utils.jsTest Expectations
svelte-checkpasses with 0 errorsConstraints
Checklist
src/lib/schedule-utils.jswith shared functionssvelte-checkpassesRelated