feat: annotate playground HTML with SvelteKit component boundaries #14

Merged
forgejo_admin merged 1 commit from 14-annotate-playground-svelte into main 2026-04-04 17:17:47 +00:00
Contributor

Summary

Adds HTML comment annotations to the twitch-2k-wager playground files (index.html and game-status.html) marking component boundaries, data binding points, server route markers, auth-gated sections, and state machine transitions. This enables mechanical 1:1 copy-paste promotion to SvelteKit.

Changes

  • twitch-2k-wager/index.html — 8 COMPONENT markers (Hero, TwitchLogin, HowItWorks, TierSelector, OutcomeCards, PayoutDetails, FAQ, Footer), DATA bindings for all tier amounts/pots, ROUTE markers for /auth/login and /api/checkout, AUTH gate on login and tier selection
  • twitch-2k-wager/game-status.html — 6 COMPONENT markers (StatusHeader, MatchCard, StatusAlert, ProgressTracker, ResultBanner, RunItBackCTA), full state machine documentation (paid->queued->playing->won/lost/cancelled), DATA bindings for all dynamic fields (challenger.twitch_username, game.status, payment.amount, payout.status, etc.), ROUTE markers for /api/game/[id]/result and /api/connect/onboard, Connect onboarding flow annotations

Test Plan

  • HTML validates (confirmed via Python html.parser — no broken tags)
  • Only HTML comments added — zero structural or CSS changes (confirmed via diff)
  • Developer can read comments and map each section to its SvelteKit file target

Review Checklist

  • No structural HTML changes — comments only
  • No CSS changes
  • HTML validates after annotation
  • All acceptance criteria from issue addressed
  • Architecture: arch-dataflow-twitch-2k-wager, arch-domain-twitch-2k-wager
## Summary Adds HTML comment annotations to the twitch-2k-wager playground files (`index.html` and `game-status.html`) marking component boundaries, data binding points, server route markers, auth-gated sections, and state machine transitions. This enables mechanical 1:1 copy-paste promotion to SvelteKit. ## Changes - `twitch-2k-wager/index.html` — 8 COMPONENT markers (Hero, TwitchLogin, HowItWorks, TierSelector, OutcomeCards, PayoutDetails, FAQ, Footer), DATA bindings for all tier amounts/pots, ROUTE markers for `/auth/login` and `/api/checkout`, AUTH gate on login and tier selection - `twitch-2k-wager/game-status.html` — 6 COMPONENT markers (StatusHeader, MatchCard, StatusAlert, ProgressTracker, ResultBanner, RunItBackCTA), full state machine documentation (paid->queued->playing->won/lost/cancelled), DATA bindings for all dynamic fields (challenger.twitch_username, game.status, payment.amount, payout.status, etc.), ROUTE markers for `/api/game/[id]/result` and `/api/connect/onboard`, Connect onboarding flow annotations ## Test Plan - [ ] HTML validates (confirmed via Python html.parser — no broken tags) - [ ] Only HTML comments added — zero structural or CSS changes (confirmed via diff) - [ ] Developer can read comments and map each section to its SvelteKit file target ## Review Checklist - [x] No structural HTML changes — comments only - [x] No CSS changes - [x] HTML validates after annotation - [x] All acceptance criteria from issue addressed ## Related Notes - Architecture: `arch-dataflow-twitch-2k-wager`, `arch-domain-twitch-2k-wager` ## Related - Forgejo issue: forgejo_admin/twitch-2k-wager#14 - Closes forgejo_admin/twitch-2k-wager#14 - Downstream: forgejo_admin/twitch-2k-wager#8 (SvelteKit scaffold consumes these annotations)
Add HTML comment annotations to twitch-2k-wager playground files marking
component boundaries, data binding points, server routes, auth gates, and
state machine transitions for mechanical SvelteKit promotion.

Ref: forgejo_admin/twitch-2k-wager#14

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Contributor

PR #14 Review

DOMAIN REVIEW

Tech stack: Static HTML (playground prototype). No build system, no frameworks, no runtime code. This PR adds HTML comment annotations only -- zero structural or CSS changes.

Annotation quality: The comment annotation scheme is well-structured and consistent:

  • COMPONENT: markers name the SvelteKit component boundary
  • DATA: markers identify every dynamic binding point with the exact model field name
  • ROUTE: markers identify server routes and API endpoints
  • AUTH: markers flag login-gated sections
  • STATE MACHINE: documentation in game-status.html clearly maps game.status values to render variants

State machine completeness: The documented states (paid -> queued -> playing -> won | lost | cancelled) are comprehensive. Each variant block (queued/playing, won, lost) is annotated. The cancelled state is mentioned in the state machine comment but has no variant block in the HTML -- this is acceptable since the playground only prototypes the primary user flows.

Data model coverage: Both files consistently annotate all dynamic values (game.buy_in_tier, game.buy_in_amount, game.pot_amount, challenger.twitch_username, payment.*, payout.*, revenue_split.*). The downstream SvelteKit scaffold (issue #8) has a clear mapping to consume.

Nested comment concern (informational): The win/lose variant blocks are wrapped in <!-- ... --> to comment them out (pre-existing pattern). The new annotations add <!-- COMPONENT: ... --> lines inside these already-commented blocks, creating nested HTML comments. This is technically invalid per the HTML spec and can confuse some parsers. However, this is a pre-existing pattern in the file (not introduced by this PR), and since this is a playground file (never served to browsers in production), the risk is cosmetic only. The SvelteKit scaffold will use {#if} blocks instead of HTML comment toggling, so this goes away at promotion time.

BLOCKERS

None.

This is a comment-only annotation PR on a static HTML playground. No executable code, no user input, no auth paths, no secrets. The BLOCKER criteria (test coverage, input validation, secrets, DRY auth) do not apply to documentation-only changes on static HTML prototypes.

NITS

  1. Duplicate DATA comments in game-status.html StatusHeader: Lines show <!-- DATA: game.buy_in_tier (Bronze/Silver/Gold label) --> and <!-- DATA: game.buy_in_amount (formatted as currency) --> on the component header, then <!-- DATA: game.buy_in_tier, game.buy_in_amount --> repeated directly above the <p> tag. The second one is redundant -- the component-level annotations already cover those fields. Minor clutter.

  2. Missing cancelled variant annotation: The state machine comment documents cancelled as a valid terminal state, but there is no variant block (even commented out) showing what the cancelled UI looks like. Consider adding a placeholder comment block like <!-- VARIANT 4: game.status === "cancelled" — refund flow, design TBD --> so the SvelteKit scaffold knows to account for it.

  3. Architecture ref consistency: game-status.html references both arch-dataflow-twitch-2k-wager and arch-domain-twitch-2k-wager, while index.html only references arch-dataflow-twitch-2k-wager. If both architecture docs are relevant to both pages, consider adding the domain ref to index.html as well for completeness.

SOP COMPLIANCE

  • Branch named after issue (14-annotate-playground-svelte matches issue #14)
  • PR body follows template (Summary, Changes, Test Plan, Related)
  • Related references parent issue (forgejo_admin/twitch-2k-wager#14)
  • Related references downstream consumer (forgejo_admin/twitch-2k-wager#8)
  • No secrets committed
  • No scope creep -- changes are strictly HTML comment annotations
  • Only 2 files changed, both in twitch-2k-wager/ directory

PROCESS OBSERVATIONS

  • Deployment frequency: No deployment impact. Playground files are static prototypes, not deployed services.
  • Change failure risk: Near zero. Comment-only changes cannot break rendering or behavior.
  • Documentation value: High. These annotations serve as the spec for the SvelteKit scaffold (issue #8). The annotation convention (COMPONENT/DATA/ROUTE/AUTH/STATE MACHINE) is a reusable pattern for future playground-to-production promotions.

VERDICT: APPROVED

## PR #14 Review ### DOMAIN REVIEW **Tech stack:** Static HTML (playground prototype). No build system, no frameworks, no runtime code. This PR adds HTML comment annotations only -- zero structural or CSS changes. **Annotation quality:** The comment annotation scheme is well-structured and consistent: - `COMPONENT:` markers name the SvelteKit component boundary - `DATA:` markers identify every dynamic binding point with the exact model field name - `ROUTE:` markers identify server routes and API endpoints - `AUTH:` markers flag login-gated sections - `STATE MACHINE:` documentation in `game-status.html` clearly maps `game.status` values to render variants **State machine completeness:** The documented states (`paid -> queued -> playing -> won | lost | cancelled`) are comprehensive. Each variant block (queued/playing, won, lost) is annotated. The `cancelled` state is mentioned in the state machine comment but has no variant block in the HTML -- this is acceptable since the playground only prototypes the primary user flows. **Data model coverage:** Both files consistently annotate all dynamic values (`game.buy_in_tier`, `game.buy_in_amount`, `game.pot_amount`, `challenger.twitch_username`, `payment.*`, `payout.*`, `revenue_split.*`). The downstream SvelteKit scaffold (issue #8) has a clear mapping to consume. **Nested comment concern (informational):** The win/lose variant blocks are wrapped in `<!-- ... -->` to comment them out (pre-existing pattern). The new annotations add `<!-- COMPONENT: ... -->` lines inside these already-commented blocks, creating nested HTML comments. This is technically invalid per the HTML spec and can confuse some parsers. However, this is a pre-existing pattern in the file (not introduced by this PR), and since this is a playground file (never served to browsers in production), the risk is cosmetic only. The SvelteKit scaffold will use `{#if}` blocks instead of HTML comment toggling, so this goes away at promotion time. ### BLOCKERS None. This is a comment-only annotation PR on a static HTML playground. No executable code, no user input, no auth paths, no secrets. The BLOCKER criteria (test coverage, input validation, secrets, DRY auth) do not apply to documentation-only changes on static HTML prototypes. ### NITS 1. **Duplicate DATA comments in game-status.html StatusHeader:** Lines show `<!-- DATA: game.buy_in_tier (Bronze/Silver/Gold label) -->` and `<!-- DATA: game.buy_in_amount (formatted as currency) -->` on the component header, then `<!-- DATA: game.buy_in_tier, game.buy_in_amount -->` repeated directly above the `<p>` tag. The second one is redundant -- the component-level annotations already cover those fields. Minor clutter. 2. **Missing `cancelled` variant annotation:** The state machine comment documents `cancelled` as a valid terminal state, but there is no variant block (even commented out) showing what the cancelled UI looks like. Consider adding a placeholder comment block like `<!-- VARIANT 4: game.status === "cancelled" — refund flow, design TBD -->` so the SvelteKit scaffold knows to account for it. 3. **Architecture ref consistency:** `game-status.html` references both `arch-dataflow-twitch-2k-wager` and `arch-domain-twitch-2k-wager`, while `index.html` only references `arch-dataflow-twitch-2k-wager`. If both architecture docs are relevant to both pages, consider adding the domain ref to `index.html` as well for completeness. ### SOP COMPLIANCE - [x] Branch named after issue (`14-annotate-playground-svelte` matches issue #14) - [x] PR body follows template (Summary, Changes, Test Plan, Related) - [x] Related references parent issue (`forgejo_admin/twitch-2k-wager#14`) - [x] Related references downstream consumer (`forgejo_admin/twitch-2k-wager#8`) - [x] No secrets committed - [x] No scope creep -- changes are strictly HTML comment annotations - [x] Only 2 files changed, both in `twitch-2k-wager/` directory ### PROCESS OBSERVATIONS - **Deployment frequency:** No deployment impact. Playground files are static prototypes, not deployed services. - **Change failure risk:** Near zero. Comment-only changes cannot break rendering or behavior. - **Documentation value:** High. These annotations serve as the spec for the SvelteKit scaffold (issue #8). The annotation convention (COMPONENT/DATA/ROUTE/AUTH/STATE MACHINE) is a reusable pattern for future playground-to-production promotions. ### VERDICT: APPROVED
forgejo_admin deleted branch 14-annotate-playground-svelte 2026-04-04 17:17:47 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/pal-e-playground!14
No description provided.