Skip to content

Feat: Allow F and escape to cancel warship selection - #4993

Merged
evanpelle merged 1 commit into
mainfrom
feat/cancel-warship-select
Aug 13, 2026
Merged

evanpelle merged 1 commit into
mainfrom
feat/cancel-warship-select

Conversation

@JB940

@JB940 JB940 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

…

Before opening a PR: discuss new features on Discord first, and file bugs or small improvements as issues. You must be assigned to an approved issue — unsolicited PRs will be auto-closed.

Add approved & assigned issue number here:

Resolves #4846

Description:

Add F cancel warship selection + add escape cancel selection if no UI priority elements.
Add tests for both.

All tests pass.

Please complete the following:

  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

JB940

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e8bc3f8-9424-4104-87d7-b3e967c58182

📥 Commits

Reviewing files that changed from the base of the PR and between e9719ef and 58759d9.

📒 Files selected for processing (3)
  • src/client/InputHandler.ts
  • src/client/controllers/WarshipSelectionController.ts
  • tests/InputHandler.test.ts

Walkthrough

Escape now cancels active UI modes before deselecting warships. Warship select-all handling now toggles between selecting all eligible warships and clearing the multi-selection. Tests cover each Escape outcome.

Changes

Selection and Escape handling

Layer / File(s) Summary
Warship selection state
src/client/controllers/WarshipSelectionController.ts
The controller filters active warships owned by the current player, reports whether all eligible warships are selected, and toggles select-all behavior.
Escape cancellation and validation
src/client/InputHandler.ts, tests/InputHandler.test.ts
Escape clears ghost structures or selection boxes, emits CloseViewEvent, and deselects warships only when no UI state was closed. Tests cover all three outcomes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 58759

This localized change adds F and Escape cancellation for warship selection with tests; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InputHandler
  participant GhostStructureMode
  participant WarshipSelectionBox
  participant View
  participant UnitSelection
  User->>InputHandler: Press Escape
  InputHandler->>GhostStructureMode: Clear active mode when present
  InputHandler->>WarshipSelectionBox: Cancel active box when present
  InputHandler->>View: Emit CloseViewEvent
  InputHandler->>UnitSelection: Emit UnitSelectionEvent(null) when no UI closed
Loading

Possibly related PRs

Suggested reviewers: evanpelle, celant

Poem

Escape clears the ghostly frame,
Selection boxes lose their claim.
Fleets select, then select no more,
CloseView shuts the active door.
Tests keep each case in sight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Escape-key behavior changes are not required by linked issue #4846, which only requests F-key cancellation. Link the Escape-key work to a separate issue, or remove those changes from this pull request.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main changes: F and Escape cancel warship selection.
Description check ✅ Passed The description explains the F and Escape cancellation changes, references issue #4846, and notes added tests.
Linked Issues check ✅ Passed The warship selection changes satisfy issue #4846 by allowing F to toggle fleet selection and clear the multi-selection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JB940 JB940 added this to the v34 milestone Aug 13, 2026
@JB940

JB940 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Added v34 to this, very minor

@github-project-automation github-project-automation Bot moved this from Triage to Final Review in OpenFront Release Management Aug 13, 2026
@evanpelle
evanpelle merged commit 19ca3a1 into main Aug 13, 2026
16 of 17 checks passed
@evanpelle
evanpelle deleted the feat/cancel-warship-select branch August 13, 2026 22:06
@github-project-automation github-project-automation Bot moved this from Final Review to Complete in OpenFront Release Management Aug 13, 2026

This branch was successfully deployed

1 active deployment
staging — 58759d9d Deployed Aug 13, 2026 by openfrontio[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Allow deselection of "send fleet" command by pressing F again

2 participants