Skip to content

Replace hardcoded defaults#3885

Open
babyboucher wants to merge 2 commits intoopenfrontio:mainfrom
babyboucher:UserSettingRefactor
Open

Replace hardcoded defaults#3885
babyboucher wants to merge 2 commits intoopenfrontio:mainfrom
babyboucher:UserSettingRefactor

Conversation

@babyboucher
Copy link
Copy Markdown
Contributor

@babyboucher babyboucher commented May 7, 2026

Description:

Replaced hard coded defaults with defaultKeybinds

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

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

babyboucher

@babyboucher babyboucher requested a review from a team as a code owner May 7, 2026 19:34
@babyboucher babyboucher changed the title User setting refactor Replace hardcoded defaults May 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

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

Run ID: 56836781-c863-481a-aae1-950184f37f0e

📥 Commits

Reviewing files that changed from the base of the PR and between 4889cb8 and 5ec3187.

📒 Files selected for processing (1)
  • src/client/UserSettingModal.ts

Walkthrough

UserSettingModal keybind UI updated to use this.defaultKeybinds.<action> property references for keybind default keys instead of hardcoded strings. Twenty-five keybind definitions across view toggles, build controls, attack/ratio controls, ally actions, and navigation controls were changed. No other keybind logic modified.

Changes

Keybind Default References

Layer / File(s) Summary
View Toggle
src/client/UserSettingModal.ts
The toggleView keybind updated to reference this.defaultKeybinds.toggleView instead of hardcoded string.
Build Controls
src/client/UserSettingModal.ts
Ten build keybinds updated: buildCity, buildFactory, buildPort, buildDefensePost, buildMissileSilo, buildSamLauncher, buildWarship, buildAtomBomb, buildHydrogenBomb, and buildMIRV now reference corresponding this.defaultKeybinds properties.
Attack and Ratio Controls
src/client/UserSettingModal.ts
Five combat keybinds updated: attackRatioDown, attackRatioUp, boatAttack, groundAttack, and retaliateAttack now reference corresponding this.defaultKeybinds properties.
Ally Actions
src/client/UserSettingModal.ts
Two diplomacy keybinds updated: requestAlliance and breakAlliance now reference corresponding this.defaultKeybinds properties.
Navigation Controls
src/client/UserSettingModal.ts
Seven navigation keybinds updated: zoomOut, zoomIn, centerCamera, moveUp, moveLeft, moveDown, and moveRight now reference corresponding this.defaultKeybinds properties.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🎹 Keys no longer hardcoded in stone,
References to defaults, now widely known,
Twenty-five keybinds march in single refrain,
Settings modal sings a cleaner refrain! 🎶

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Replace hardcoded defaults' is clear and directly relates to the main change—replacing hardcoded keybind defaults with defaultKeybinds references in UserSettingModal.
Description check ✅ Passed The description is related to the changeset, explaining that hardcoded defaults were replaced with defaultKeybinds, and includes confirmation of testing and additional updates like screenshots and translations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant