Skip to content

Convert setup screen to a 3-step wizard, drop progression-notation text - #11

Merged
yottanami merged 1 commit into
mainfrom
agent/156-setup-wizard
Aug 18, 2026
Merged

yottanami merged 1 commit into
mainfrom
agent/156-setup-wizard

Conversation

@yottanami

Copy link
Copy Markdown
Owner

Closes Men-in-Black-5/ideas#156 (from #155).

What

Splits #setupScreen's flat form into three sequential steps, reusing the existing showScreen()/data-back-to idiom in both directions:

  1. MIDI (setupScreen) — device select + the existing #midiUnsupported error, plus guide copy.
  2. Genre & scale (setupStep2Screen) — genre/scale selects, plus guide copy. Key moved here from step 2.
  3. Key, level & unlock (setupStep3Screen) — key/level selects, the unchanged unlock form, guide copy, then Start Game.

Next buttons are just two more entries in the existing menuButtonTargets map (buttonId → showScreen(targetId)); Back buttons reuse the existing .backButton/data-back-to mechanism verbatim, no new JS pattern for either direction.

Also removes renderProgressionPreview(), its call sites, and the #progressionPreview element/CSS entirely — no progression notation shown anywhere in setup now.

populateGenreSelect/populateScaleSelect/populateKeySelect and the genre→scale→key narrowing logic are untouched; going back and changing an earlier step still correctly re-narrows later ones on the way forward (verified below). Unlock form and Start Game behavior/validation messages are unchanged.

Guide copy

  • Step 1 and step 2 are the owner's verbatim chat text.
  • Step 3 is drafted here ("Pick the key you want to play in, then your level. Levels 1-3 are free; levels 4-8 unlock with a one-time purchase below."), matching the plain/factual tone of #howToPlayScreen. Flagging for owner review/edit — not treated as final.

Testing

  • npx tsc --noEmit — clean.
  • npx vitest run — 171 passed (15 files), including updated test/setup-screen.test.ts (removed the renderProgressionPreview tests, trimmed the now-unused progressionPreview/preview fixture).
  • npm run build — clean, dist/app.js included in this PR (matches how the repo already tracks it).
  • Manually exercised the actual wizard in headless Chromium (nix chromium + puppeteer-core, screenshots attached below): clicked through all 3 steps, confirmed guide copy per step, confirmed #progressionPreview is gone from the DOM, changed genre on step 2 → confirmed scale/key narrowed correctly both forward and after Back → change → Forward again (classical genre correctly re-narrowed to its own scale/key set), and confirmed "Back to Menu" from any step reaches the main menu.
Step 1 Step 2 Step 3
step1 step2 step3

(Screenshots taken locally; happy to attach directly if useful — headless MIDI access is naturally blocked so Start Game shows disabled in the captures, that's expected sandbox behavior, not a regression.)

Splits the flat setup form into three sequential screens (MIDI, then
genre/scale, then key/level/unlock), reusing the existing showScreen()/
data-back-to idiom for both directions -- Next buttons just add two more
entries to the existing menuButtonTargets map, Back buttons reuse the
.backButton mechanism unchanged.

Also removes renderProgressionPreview() and the #progressionPreview
element entirely, per the brief: no progression notation shown in setup.

Guide copy per step: steps 1-2 are the owner's verbatim chat text; step 3
is drafted here to match the plain/factual tone of #howToPlayScreen and
should be treated as owner-review-pending, not final.

Closes Men-in-Black-5/ideas#156
@yottanami

Copy link
Copy Markdown
Owner Author

reviewer: approved. Traced the re-narrowing path independently: genreSelect's change listener (unchanged) still calls refreshSetupSelects() -> populateScaleSelect()/populateKeySelect(), so changing genre on step 2 correctly re-narrows both scale and key ahead of reaching step 3 -- and since steps are just .screen divs toggled via the existing showScreen(), Back preserves selections for free, no extra state-management code needed. Confirmed zero leftover progressionPreview/renderProgressionPreview references anywhere in the repo after the removal. setupBackButton -> mainMenuScreen preserved verbatim on the final step as required. Step 1/2 copy matches the owner's chat text exactly; step 3's draft is clearly flagged as owner-review-pending, correctly not treated as final. Good use of headless-Chromium verification for the actual click-through/back/forward behavior given it's pure DOM-state navigation. CI green, no stacked PRs. Merging (squash).

Note for the owner separately from the code review: step 3's guide copy is drafted, not yours verbatim -- worth a read before/after this merges since the issue explicitly called it out as pending your edit.

@yottanami
yottanami merged commit a5990d8 into main Aug 18, 2026
2 checks passed
@yottanami
yottanami deleted the agent/156-setup-wizard branch August 18, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant