Skip to content

fix(keybinds): clarify upgrade hotkeys and pause behavior - #6303

Merged
VariableVince merged 6 commits into
mainfrom
fix-wordingand-hotkeywhilepaused
Nov 7, 2026
Merged

VariableVince merged 6 commits into
mainfrom
fix-wordingand-hotkeywhilepaused

Conversation

@VariableVince

@VariableVince VariableVince commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Stacked PRs. Only the 1st PR (#6302) and this 2nd PR (#6303) need to, if approved, be merged in order. The 3rd one (#6304) was merged into this 2nd one (#6303) to fix a failing CI test, so excuse the confusing message of it getting merged.

Summary

  • Move "Build Scroll Modifier" from Menu Shortcuts to Build Controls. Where it belongs since it's a.. build control. See screenshot below.

  • Move "Prevent Building Stacking" hotkey from Menu Shortcuts to Build Controls as well. Same reason as above.

  • For build hotkeys: replace per-building descriptions with one re-usable description. And tell about upgrading. So eg. "Build City under your cursor" becomes “Build under your cursor. Repeat the key on a unit to increase the build amount by 5 (up to 50).”. It still says "Build City" above it so the type of unit being referred to remains clear. This both consolidates multiple different translations keys under one, and adds a description that was still missing namely the upgrading/building multiple part (used the word "build" instead of "upgrade" because it also pertains to building multiple nukes). The

  • Remove the now obsolete per-building description keys.

  • Prevent upgrade hotkey multiplier changes while paused (and until the view has caught up to the current pause state). So multiple hits of 1 don't put 5x-10x-15x etc. upgrades while paused. Keybind AltLeft-scroll already doesn't respond while paused, this brings the build hotkeys are on par.

  • If feat(client): add gameplay toggle for cycling build multiplier on hotkey #6250 will be merged, we could toggle the "Repeat the key on a unit to increase the build amount by 5 (up to 50).” part of the build hotkey description based on that PRs' user setting. But it's not too big of an issue when this text would still be shown if the setting was off; it could serve as a reminder that this functionality is there when someone toggled the setting by mistake or forgot about it.

image image

Testing

  • npx vitest run --project node tests/InputHandler.test.ts tests/UserSettings.test.ts tests/TranslationSystem.test.ts
  • npx vitest run --project client tests/client/view/GameView.test.ts tests/client/UserSettingModalValues.test.ts
  • npm run typecheck

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Build keybind settings now use shared guidance, and the scroll modifier appears with build controls. Repeated hotkeys leave the upgrade multiplier unchanged when updates are absent, the view is catching up, or the game is paused.

Changes

Build Hotkeys

Layer / File(s) Summary
Build hotkey guidance and settings
resources/lang/en.json, src/client/UserSettingModal.ts
Build-action keybind rows use shared guidance for cursor building and repeated-key upgrades. The scroll modifier and prevent-stacking controls appear with build controls.
Synchronization-aware hotkey selection
src/client/view/GameView.ts, src/client/InputHandler.ts, tests/InputHandler.test.ts
GameView.isPaused() reports the latest paused state. Repeated hotkeys leave the multiplier unchanged when updates are absent, the view is catching up, or the game is paused. Tests cover these states and multiplier changes when updates are available and the view is not catching up.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: Bug, UI/UX, Translation, small-fix

Suggested reviewers: celant

Merge Risk: Minimal · up to 06c6a

This change groups the build hotkey settings together, shares one build-hotkey description, and prevents repeated hotkeys from changing the upgrade amount while the game is paused or the view is catching up. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title describes the hotkey description and pause behavior changes.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description matches the changes to build controls, shared hotkey descriptions, and multiplier behavior while paused or catching up.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

A key waits for the view to sync
Build notes share a clearer link
Controls gather by their task
Updates set the multiplier’s path
Paused play leaves the value still

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 555b95a4-1294-4090-9c68-f9920d4614f7
Commits

Reviewing files that changed from the base of the PR and between 42acc69 and 06c6ae5.

Files selected for processing: 2

  • resources/lang/en.json
  • src/client/UserSettingModal.ts
Files skipped from review as they are similar to previous changes: 2

  • resources/lang/en.json
  • src/client/UserSettingModal.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Verdict: looks good — 0 findings (0 high, 0 medium, 0 low).

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Notes from verification:

  • GameView.isPaused() reads only the latest tick's GamePaused updates, which is correct here: both GameServer and LocalServer flush the pause intent into a final turn and then stop sending turns. So while the game is paused, lastUpdate stays on the tick that carries paused: true, and the next tick after an unpause carries paused: false.
  • The new user_setting.build_hotkey_desc string goes through translateText() and is added only to resources/lang/en.json.

coderabbitai[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Reviewed range: 6a522cf..68d984e (incremental since the last Claude review).

Verdict: looks good — 0 findings (0 high, 0 medium, 0 low).

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

The only change in this range removes one code comment above the shared-key modifier pairs in src/client/UserSettings.ts. It does not change behavior.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Reviewed range: 68d984e..ff55004 (incremental since the last Claude review).

Verdict: looks good — 0 findings (0 high, 0 medium, 0 low).

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Notes from this range:

  • GameView.isCatchingUp() now returns true before the first update. The only other caller, HeadsUpMessage.tick(), runs only after gameView.update(gu) in ClientGameRunner, so the "catching up" banner behaves as before.
  • Every removed user_setting.build_*_desc key is replaced by build_hotkey_desc in UserSettingModal.ts, and only en.json was edited, as CLAUDE.md requires.
  • The hotkey multiplier guard in InputHandler.ts and its tests match the PR description.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Reviewed range: ff55004..7d1796b (incremental).

Verdict: No issues found. 0 findings (0 high, 0 medium, 0 low).

Checked for bugs and CLAUDE.md compliance. This range puts GameView.isCatchingUp() back to its main behavior, so the catching-up HUD logic in HeadsUpMessage is unchanged, and it moves the "no update yet" check into the hotkey guard in InputHandler (updatesSinceLastTick?.() === null). The guard behaves the same as before, and the removed GameView test only covered the reverted isCatchingUp change. The base mockGameView in tests/InputHandler.test.ts has no updatesSinceLastTick, so the optional call returns undefined, which is not null, and the existing multiplier tests are not affected.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 6, 2026
@VariableVince

Copy link
Copy Markdown
Contributor Author

/ready

@Celant Celant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traced the pause read through host pause, singleplayer, resume-from-save and a mid-pause rejoin and it holds up; nothing from me on this one.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Reviewed range: 7d1796b..42acc69 (incremental since the last Claude review).

Verdict: looks good — 0 findings (0 high, 0 medium, 0 low).

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Notes from this range:

  • The preventStacking keybind moves from the general controls into the "Build Controls" section of UserSettingModal.ts. Its action, label, description and handlers are unchanged, and it appears only once.
  • The reworded build_hotkey_desc and build_scroll_modifier_desc strings match InputHandler.setGhostStructure: pressing the hotkey again raises the multiplier from 1 to 5 and then by +5, up to MAX_UPGRADE_AMOUNT, and scrolling changes it by ±1. Only resources/lang/en.json was edited, as CLAUDE.md requires.

@VariableVince VariableVince reopened this Nov 6, 2026
@github-project-automation github-project-automation Bot moved this from Development to Complete in OpenFront Release Management Nov 6, 2026
@github-project-automation github-project-automation Bot moved this from Complete to Triage in OpenFront Release Management Nov 6, 2026
@VariableVince

Copy link
Copy Markdown
Contributor Author

/ready

@VariableVince

Copy link
Copy Markdown
Contributor Author

(sorry had to do small changes, see PR description)

Base automatically changed from fix-buildupdate-settingandtexts to main November 6, 2026 19:12
evanpelle pushed a commit that referenced this pull request Nov 6, 2026
> [!IMPORTANT]
> Stacked PRs. Only this 1st PR (#6302) and the 2nd PR (#6303) need to,
if approved, be merged in order. The 3rd one (#6304) was merged into the
2nd one (#6303) to fix a failing CI test, so excuse the confusing
message of it getting merged.

## Summary
- Consolidate shared-key and modifier-sharing checks into one helper.

(Previously, this PR also contained a change to translation key
'build_scroll_modifier_desc' to say "upgrade amount" instead of "build
amount" just as other key 'action_auto_upgrade' already called it for
its action. Reverted that because the build scroll can be used to build
multiple nukes to, so upgrade isn't the right wording.)

## Testing
- `npx vitest run --project node tests/UserSettings.test.ts`
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Reviewed: the whole PR again (main..06c6ae5), because the history since the last reviewed commit (42acc69) could not be isolated.

Verdict: looks good. 0 findings (0 high, 0 medium, 0 low).

Code review: No issues found. Checked for bugs and CLAUDE.md compliance.

Notes:

  • UserSettingModal.ts no longer reads any of the removed user_setting.build_*_desc keys. Each build keybind now uses user_setting.build_hotkey_desc. The help_modal.build_*_desc keys in HelpModal.ts are a different namespace and are unchanged.
  • preventStacking and buildScrollModifier were moved into "Build Controls" and each appears exactly once. Their props are unchanged.
  • GameView.isPaused() uses GameUpdateType, which is already imported. It reads the last GamePaused update of the latest tick. The hotkey guard in InputHandler.ts only applies to repeat presses with source === "hotkey", and the new test covers each branch of the guard.
  • Only resources/lang/en.json was edited, as CLAUDE.md requires.

@VariableVince

Copy link
Copy Markdown
Contributor Author

@Celant You soft-approved this one before. I added something afterwards and updated the PR description.

Could you maybe have a look at this again, possibly merge it? The first PR in the stack already got merged.

@Celant Celant added this to the v36 milestone Nov 7, 2026
@Celant

Celant commented Nov 7, 2026

Copy link
Copy Markdown
Member

Had another look at the additions, all fine from me. It was only missing a milestone, which is on now.

@github-project-automation github-project-automation Bot moved this from Triage to Final Review in OpenFront Release Management Nov 7, 2026
@VariableVince
VariableVince added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 0b9e565 Nov 7, 2026
20 of 24 checks passed
@VariableVince
VariableVince deleted the fix-wordingand-hotkeywhilepaused branch November 7, 2026 15:16
@github-project-automation github-project-automation Bot moved this from Final Review to Complete in OpenFront Release Management Nov 7, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
backport — 06c6ae52 Deployed Nov 7, 2026 by VariableVince via Cherry-pick #928
staging — 06c6ae52 Deployed Nov 6, 2026 by openfrontio[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants