fix: remove remaining hardcoded schedule blocks in fallback path #51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "49-remove-hardcoded-schedule-fallback"
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
PR #50's rebase left hardcoded BWill schedule blocks in all three fallback branches. This removes them and wires up the dynamic
{#each practices}query in their place.Changes
{#each practices}loop{#each practices}loop{#each practices}loopTest Plan
Review Checklist
npm run build)Related Notes
story:WS-S28— parent sees correct practice schedulePR #51 Review
DOMAIN REVIEW
Stack: SvelteKit / TypeScript / server-rendered contract pages with direct Postgres queries.
What this PR does: PR #50 added a dynamic
practicesarray from the DB and placed a shared{#each practices}block at the bottom of the template, but left three variant-specific hardcoded schedule blocks intact (boys travel at ~L342, girls travel at ~L422, local at ~L466). This PR replaces all three with the same dynamic{#each practices}loop and removes the now-duplicate shared block from the bottom. Net effect: -37 lines of hardcoded schedule data, +29 lines of dynamic rendering. Clean improvement.Correctness: The replacement blocks correctly use
practice.day_name,practice.location,practice.time_range, and conditionally renderpractice.notes-- matching the exact pattern established by PR #50's server-side data shaping. The{:else}fallback message is consistent across all three paths. The local variant nicely moves the "Season starts week of April 6" intro inside the{#if practices.length > 0}guard so it only shows when there are actual practices to display.Duplicate shared block removal (L518-L529 deletion): Correct. PR #50 added this shared block outside the variant conditionals, which would have caused practice schedules to render twice (once in the variant block, once in the shared block). Removing it is the right call.
DRY observation: The same 7-line template fragment is now copy-pasted identically in three places (boys travel, girls travel, local). This is a nit, not a blocker -- the surrounding context (section headers, introductory text) differs enough per variant that extracting a Svelte snippet component would be a separate refactor. The PR description acknowledges this is a follow-up cleanup to PR #50, and keeping scope tight is correct.
No
PracticeSchedulecomponent references remain: The diff removesPracticeSchedule rows={[...]}calls. Grepping the codebase confirms noPracticeSchedulecomponent exists (it was apparently inline prop syntax, not a separate component). No dead imports.BLOCKERS
None.
This PR is a template-only change in a
.sveltefile. It replaces hardcoded HTML with dynamic rendering using data already fetched and shaped by PR #50's server-side code. No new functionality is introduced -- thepracticesdata flow, DB query, and type definitions were all added in PR #50. The "new test coverage" blocker criterion does not apply to removing hardcoded content in favor of already-wired dynamic data.NITS
DRY -- identical template block x3: The
{#if practices.length > 0} / {#each} / {:else}block is repeated verbatim in boys-travel, girls-travel, and local paths. Consider extracting aPracticeScheduleBlocksnippet or Svelte component in a future ticket. Not blocking because each variant's surrounding context differs.Indentation consistency: The
{#each}blocks use tabs consistently, which matches the rest of the file. No issues here.SOP COMPLIANCE
49-remove-hardcoded-schedule-fallbackreferences issue #49story:WS-S28referenced; no plan slug (standalone fix, appropriate)fix: remove remaining hardcoded schedule blocks in fallback pathPROCESS OBSERVATIONS
practicesarray) is already live from PR #50. This PR only changes which template paths consume it.VERDICT: APPROVED