refactor: extract content components from monolithic +page.svelte #35
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
Lineage
Sub-ticket of
forgejo_admin/westside-contracts#34— data-driven contract rendering system. Wave 1 (independent). Board note:board-34-data-driven-contracts.Repo
forgejo_admin/westside-contractsUser Story
As a developer, I want the contract body content extracted into stateless components so that T6 (wire to data) can replace hardcoded HTML with data-driven rendering.
Context
src/routes/contract/[token]/+page.svelteis 725 lines. The file has 5 zones:{#if}branches: boys travel (174 lines), girls travel (183 lines), local (58 lines). THIS IS WHAT WE EXTRACT.This ticket extracts 6 stateless content components from zone 3. All are props-in, HTML-out. No state management, no lifecycle, no event handling.
File Targets
Create
src/lib/components/directory, then:src/lib/components/FeeSection.svelte— monthly fee display. Props: monthlyFee (number), practiceDescription (string). ~10 lines.src/lib/components/TournamentCard.svelte— single local tournament card. Props: name, dates, cost. ~15 lines.src/lib/components/TournamentTrip.svelte— single travel tournament with cost breakdown table. Props: name, dates, entryFee, travel object (transportation, gas, coaches, lodging, total). ~30 lines.src/lib/components/PracticeSchedule.svelte— practice day/location/time rows. Props: practices array, optional intro text. ~15 lines.src/lib/components/PaymentSchedule.svelte— payment rows + prorated fee calc + Klarna note. Props: payments array, monthlyFee (for prorated calc). ~25 lines.src/lib/components/StaticSection.svelte— generic h3 + paragraph(s) or bullet list. Props: title, content (string or string[]), isList (boolean). ~15 lines.Modify:
src/routes/contract/[token]/+page.svelte— replace inline HTML in the three{#if}branches with component calls. The three branches STAY (boys/girls/local conditional) but each branch uses the extracted components instead of raw HTML.Do NOT touch:
src/lib/validation.ts,src/lib/minio.ts,src/lib/db.tssrc/routes/contract/[token]/+page.server.tssrc/routes/contract/[token]/sign/+server.tssrc/app.cssAcceptance Criteria
src/lib/components/{#if}branches still exist (boys/girls/local) but dispatch to componentsTest Expectations
npm run checkpasses (TypeScript)npm testpasses (validation tests)npm test && npm run checkConstraints
Checklist
npm test && npm run check)Related
westside-basketball— parent projectforgejo_admin/westside-contracts#34— parent issueboard-34-data-driven-contractsrefactor: extract Svelte components from monolithic +page.svelteto refactor: extract content components from monolithic +page.svelteScope Review: NEEDS_REFINEMENT
Review note:
review-775-2026-04-03Ticket scope is thorough — all template sections present, file targets verified against codebase (725-line file confirmed, zone 3 lines 211-632 confirmed, component directory does not exist yet). Traceability to story:WS-S20 verified. Dependencies documented via wave labels.
One issue:
[SCOPE]Architecture notearch-contractsdoes not exist in pal-e-docs. 10 board items referencearch:contractsbut there is no backing note. Createarch-contractsto complete traceability.Agent picked up this ticket.