feat: annotate playground HTML with SvelteKit component boundaries #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "14-annotate-playground-svelte"
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
Adds HTML comment annotations to the twitch-2k-wager playground files (
index.htmlandgame-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/loginand/api/checkout, AUTH gate on login and tier selectiontwitch-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]/resultand/api/connect/onboard, Connect onboarding flow annotationsTest Plan
Review Checklist
Related Notes
arch-dataflow-twitch-2k-wager,arch-domain-twitch-2k-wagerRelated
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 boundaryDATA:markers identify every dynamic binding point with the exact model field nameROUTE:markers identify server routes and API endpointsAUTH:markers flag login-gated sectionsSTATE MACHINE:documentation ingame-status.htmlclearly mapsgame.statusvalues to render variantsState machine completeness: The documented states (
paid -> queued -> playing -> won | lost | cancelled) are comprehensive. Each variant block (queued/playing, won, lost) is annotated. Thecancelledstate 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
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.Missing
cancelledvariant annotation: The state machine comment documentscancelledas 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.Architecture ref consistency:
game-status.htmlreferences botharch-dataflow-twitch-2k-wagerandarch-domain-twitch-2k-wager, whileindex.htmlonly referencesarch-dataflow-twitch-2k-wager. If both architecture docs are relevant to both pages, consider adding the domain ref toindex.htmlas well for completeness.SOP COMPLIANCE
14-annotate-playground-sveltematches issue #14)forgejo_admin/twitch-2k-wager#14)forgejo_admin/twitch-2k-wager#8)twitch-2k-wager/directoryPROCESS OBSERVATIONS
VERDICT: APPROVED