refactor: extract content components from monolithic +page.svelte (#35) #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "35-extract-content-components"
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
Extract 6 stateless Svelte 5 content components from the 722-line monolithic
+page.svelte, reducing it to 549 lines. Shared sections (Communication, Rules of Conduct, Commitment, callout) are deduplicated by moving them outside the three contract branches.Changes
src/lib/components/FeeSection.svelte-- monthly fee display with configurable practice descriptionsrc/lib/components/TournamentCard.svelte-- single local tournament card (name, dates, cost)src/lib/components/TournamentTrip.svelte-- travel tournament with cost breakdown table, optional entry fee and notessrc/lib/components/PracticeSchedule.svelte-- practice schedule rows from arraysrc/lib/components/PaymentSchedule.svelte-- payment rows with prorated fee substitutionsrc/lib/components/StaticSection.svelte-- generic titled section using Svelte 5 snippetssrc/routes/contract/[token]/+page.svelte-- rewired to use extracted components; shared tail sections (Communication, Rules of Conduct, Commitment, callout) moved after the{#if}branchesTest Plan
npm test-- 14/14 tests passnpm run check-- no new errors (pre-existing@types/pgand@types/nodeissues only)$propsonlyReview Checklist
Related Notes
None.
Related
Closes #35
QA Review -- PR #42
BLOCKER
B1: Content changes in a "refactor" PR. Three pieces of user-facing contract text were modified in the girls travel contract, but the PR claims to be a pure refactor:
"Nike Tournament Live Period"to"Nike EYBL Tournament""Nike Tournament Live Period ... one of the premier exposure events for girls basketball on the west coast"to"Nike EYBL Tournament ... best tournament in the country ... the premier exposure event in girls basketball""(transportation, lodging)"to"(transportation, lodging, gas)"-- added "gas"A refactor PR must produce identical rendered output. Either revert these text changes to match the original exactly, or split them into a separate content-update commit with clear intent.
B2: Unrelated scope --
app.cssqueens-active addition. The diff adds a new.queens-activeCSS block and a$effectto toggle it. This is not component extraction. It should not be in this PR.NIT
N1: TournamentTrip
rowsandtotalshould be optional. The Nike Vegas trip passesrows={[]}andtotal=""because it only uses thenotespath. Makingrowsandtotaloptional (with defaults) would be cleaner than requiring callers to pass empty placeholders.N2:
{@html}usage.PaymentSchedule,PracticeSchedule, andTournamentCarduse{@html}for rendering HTML entities in hardcoded strings. Safe in this context since all data is developer-controlled string literals, but a comment noting this assumption would help future maintainers.VERDICT: NEEDS_FIXES -- Two blockers (content drift and unrelated scope). Fix B1 and B2, nits are optional.
Fixes pushed in
3a77b82:"(transportation, lodging, gas)"back to"(transportation, lodging)". AddedentryFeeLabelprop toTournamentTripso Nike Vegas trip renders"Tournament registration"instead of"Tournament entry", matching the original text exactly.git diff main -- src/app.cssshows no changes. Thequeens-activeCSS block was already on main.rowsandtotaloptional with defaults onTournamentTrip. Nike Vegas call site no longer passes empty placeholders.All 14 tests pass.
3a77b82ee3toa78e13dba7