Skip to content

feat(dungeon): in-fight back-to-menu button (Phase 1) - #31

Merged
silver-snoopy merged 5 commits into
mainfrom
feat/in-fight-navigation
May 30, 2026
Merged

feat(dungeon): in-fight back-to-menu button (Phase 1)#31
silver-snoopy merged 5 commits into
mainfrom
feat/in-fight-navigation

Conversation

@silver-snoopy

Copy link
Copy Markdown
Owner

What

Adds a "Menu" exit control to the boss fight — the game previously trapped you in a fight until you won or died. Clicking it saves the current fight and returns to the Hub, where the existing "Continue (… mid-fight)" resumes it exactly where you left off.

This is Phase 1 of the in-fight navigation design (spec). Phase 2 (an in-fight Codex overlay) is a separate follow-up.

How

  • src/ui/inFightNav.tsmountMenuButton(scene, onExit): a door icon (td-tiles frame 45) + "Menu" chip, top-left, with hover. Visuals + click-wiring only. Unit-tested with minimal scene fakes (matching the existing optionFeedback.test.ts style).
  • src/scenes/BossFightScene.tsexitToHub() = writeSave() (flushes a resumable inBoss snapshot; no-op for isolated/demo runs) then fadeToScene('HubScene'), mounted via the helper in create().

No new save/resume machinery — Phase 1 leans entirely on the mid-fight save that already exists.

Tests / checks

  • npx vitest run121 passing (24 files), incl. 2 new tests asserting both click paths invoke onExit.
  • npx tsc --noEmit clean · npm run build clean · root npm run lint (Biome) clean.
  • Final code review: no Critical/Important issues (save→resume path sound, no UI overlap, no re-entry leak, BGM correctly delegated).

Manual verification (interactive — not automatable in CI)

At localhost:5173 (non-?demo run), enter a boss fight and confirm:

  • Door + "Menu" chip top-left, not overlapping boss name / HP / spells
  • Hover brightens the door (tint) and the label
  • Menu mid-fight → Hub shows "Continue (mid-fight)" → Continue restores boss / question / HP
  • In a ?demo run, Menu returns cleanly (demo re-launches from Tool-Smith; no stale "Continue")

Notes

🤖 Generated with Claude Code

Daniel Sallai and others added 5 commits May 30, 2026 22:14
Two-phase spec: (1) back-to-menu exit button using a td-tiles door sprite,
leaning on the existing mid-fight save for resume; (2) in-fight Codex via a
TomeScene overlay (scene.pause + returnTo param) so combat state survives.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks: mountMenuButton helper (TDD w/ scene fakes, door frame 45),
BossFightScene exitToHub wiring (writeSave + fadeToScene), CI-parity lint +
manual verification.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire mountMenuButton into BossFightScene.create() and add exitToHub()
which calls writeSave() before fadeToScene so the Hub can offer
"Continue (… mid-fight)" on re-entry. No-op for isolated/demo runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@silver-snoopy
silver-snoopy merged commit 890302e into main May 30, 2026
1 check passed
@silver-snoopy
silver-snoopy deleted the feat/in-fight-navigation branch May 30, 2026 20:35
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