Repository navigation
feat(guns): explain the special guns when they come online - #44
Conversation
…swap in sector 3 - The refit bay after sector 2 opens on a one-button SPECIAL GUNS ONLINE card (Lance, Q / the touch swap key, the charge). No options; CONTINUE, Enter, Space or Escape close it. Shown on every visit to that bay, at no other, and not again after a resize restart of the same visit. - Sector 3 points at the swap until the first successful swap there: `Q SPECIAL GUN` beside the HUD charge bar on a keyboard, a pulsing ring around the touch swap key (still with reduced motion). The state lives in ShipSystemsRuntime.isSwapHintPending. - Docs and CHANGELOG (Unreleased, Added). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| this.dialog = createSpecialGunIntroCard(touch, () => { | ||
| this.closeDialog(); | ||
| this.specialGunIntroClosed = true; | ||
| audioManager.playUi(); | ||
| this.offerShipSystemPick(); | ||
| }); |
There was a problem hiding this comment.
Bug: Closing the dialog with Enter allows Phaser's queued Enter keydown event to trigger handleUnfocusedKey('Enter'), accidentally purchasing the first purchasable upgrade card.
Severity: MEDIUM
Suggested Fix
Call stopPropagation() or prevent the default action on the Enter key event within the dialog continue handler, or defer un-inerting the upgrade bay view until the next frame/tick so the queued Enter event is consumed safely.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/scenes/PlanetIntermissionScene.ts#L135-L140
Potential issue: When closing the "SPECIAL GUNS ONLINE" dialog using the Enter key on
the CONTINUE button, the dialog closes synchronously and immediately un-inerts the
upgrade bay. Because Phaser queues native key events and processes them on a later game
step, the scene's keydown handler then receives the queued Enter event after
`this.dialog` has been reset to undefined. The handler invokes
`view.handleUnfocusedKey('Enter')`, which focuses and purchases the first available
upgrade card without player intent.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Not a bug: the Enter keydown never reaches Phaser. Every UI layer stops propagation of Enter/Space pressed on a focused button (keepNativeKeys in src/ui/dom.ts:42), so the scene's keydown handler does not see the key that closed the card. The e2e test closes the card with Enter on desktop and the bay afterwards still shows 8000 credits and Hull Armor at 0/5.
Since #43 the main gun is no longer picked: from sector 3 you fly Lance and
Qborrows Scatter or Seekers on a charge. Nothing told the player that.Now the refit bay after sector 2 opens with a short "SPECIAL GUNS ONLINE" card: three sentences and one CONTINUE button, nothing to choose. It says "Press Q" on a keyboard and "Tap the swap key" on touch. In sector 3 a small
Q SPECIAL GUNlabel sits next to the charge bar (a pulse ring around the swap key on touch) until the first swap.Sectors 1–2 and all balance numbers are untouched.
Proof: typecheck, lint, format, knip, unit tests (678 pass), build and bundle check pass; Playwright desktop + mobile 97 passed (5 existing skips), including a new test for the card and the hint; card and hint checked in screenshots on desktop and phone.
Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 and Claude Fable 5.2 in Claude Code.
🤖 Generated with Claude Code