feat(dungeon): in-fight back-to-menu button (Phase 1) - #31
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ts—mountMenuButton(scene, onExit): a door icon (td-tilesframe 45) + "Menu" chip, top-left, with hover. Visuals + click-wiring only. Unit-tested with minimal scene fakes (matching the existingoptionFeedback.test.tsstyle).src/scenes/BossFightScene.ts—exitToHub()=writeSave()(flushes a resumableinBosssnapshot; no-op for isolated/demo runs) thenfadeToScene('HubScene'), mounted via the helper increate().No new save/resume machinery — Phase 1 leans entirely on the mid-fight save that already exists.
Tests / checks
npx vitest run→ 121 passing (24 files), incl. 2 new tests asserting both click paths invokeonExit.npx tsc --noEmitclean ·npm run buildclean · rootnpm run lint(Biome) clean.Manual verification (interactive — not automatable in CI)
At
localhost:5173(non-?demorun), enter a boss fight and confirm:?demorun, Menu returns cleanly (demo re-launches from Tool-Smith; no stale "Continue")Notes
mainafter the demo PR (feat(talk): scripted ?demo run on real questions (Tool-Smith opener) #30) merged, so the diff is just this feature + its spec/plan docs.🤖 Generated with Claude Code