Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds pause and single-player/replay speed controls: new intent events, default keybinds (P, Period, Comma), localization keys, UI entries in help and settings, event wiring in input, sidebar, local server, and replay panel to handle pause and replay-speed changes. Changes
Sequence DiagramssequenceDiagram
participant User
participant InputHandler
participant EventBus
participant GameRightSidebar
participant GameLogic
User->>InputHandler: Press P (pauseGame)
InputHandler->>EventBus: emit TogglePauseIntentEvent
EventBus->>GameRightSidebar: dispatch TogglePauseIntentEvent
GameRightSidebar->>GameRightSidebar: check single-player/replay or lobby owner
GameRightSidebar->>GameLogic: onPauseButtonClick()
GameLogic->>GameLogic: toggle paused state
GameLogic->>EventBus: emit PauseGameIntentEvent
sequenceDiagram
participant User
participant InputHandler
participant EventBus
participant LocalServer
participant ReplayPanel
User->>InputHandler: Press Period/Comma (speed control)
InputHandler->>EventBus: emit GameSpeedUpIntentEvent / GameSpeedDownIntentEvent
EventBus->>LocalServer: dispatch speed intent event
LocalServer->>LocalServer: update replaySpeedMultiplier using SPEED_ORDER
LocalServer->>EventBus: emit ReplaySpeedChangeEvent
EventBus->>ReplayPanel: dispatch ReplaySpeedChangeEvent
ReplayPanel->>ReplayPanel: update _replaySpeedMultiplier and request UI render
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/client/UserSettingModal.ts (1)
50-52: Consider a shared default-keybind source.These new defaults now have to stay aligned across
UserSettingModal,InputHandler, andHelpModal. Pulling the default map into one exported constant would avoid the next default change drifting between runtime behavior, help text, and conflict validation.Also applies to: 640-668
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/client/UserSettingModal.ts` around lines 50 - 52, Extract the default keybind map into a single exported constant (e.g., DEFAULT_KEYBINDS) and import it wherever defaults are needed instead of hardcoding values: replace the inline map in UserSettingModal (pauseGame, gameSpeedUp, gameSpeedDown, etc.), the default/conflict logic in InputHandler, and the help text generation in HelpModal to reference DEFAULT_KEYBINDS so all three modules use the same source of truth for defaults.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/client/HelpModal.ts`:
- Around line 61-63: getKeybinds() currently drops "Null" entries so HelpModal's
displayed keybinds (pauseGame, gameSpeedUp, gameSpeedDown) show defaults instead
of an unbound state; update either getKeybinds() to preserve explicit
null/"Null" values or update HelpModal's rendering to detect a "Null"/null value
for pauseGame, gameSpeedUp, gameSpeedDown and either render an "Unbound" label
or hide the row entirely (same change needed for the other rows referenced
around the same block). Ensure the check uses the exact token used in your
codebase ("Null" vs null) and apply the same logic for all affected keybind rows
so unbinding in settings is reflected correctly in the UI.
In `@src/client/LocalServer.ts`:
- Around line 109-125: The replay speed hotkeys are currently registered for
replay sessions; wrap the GameSpeedUpIntentEvent and GameSpeedDownIntentEvent
handler registrations in a guard so they only register for non-replay sessions
(check this.isReplay). Specifically, in LocalServer where eventBus.on is used
for GameSpeedUpIntentEvent and GameSpeedDownIntentEvent (which manipulate
SPEED_ORDER, replaySpeedMultiplier, and emit ReplaySpeedChangeEvent), gate the
block with if (!this.isReplay) { ... } or alternatively add an early return
inside each handler that checks this.isReplay; prefer gating the registration to
avoid registering unnecessary listeners.
---
Nitpick comments:
In `@src/client/UserSettingModal.ts`:
- Around line 50-52: Extract the default keybind map into a single exported
constant (e.g., DEFAULT_KEYBINDS) and import it wherever defaults are needed
instead of hardcoding values: replace the inline map in UserSettingModal
(pauseGame, gameSpeedUp, gameSpeedDown, etc.), the default/conflict logic in
InputHandler, and the help text generation in HelpModal to reference
DEFAULT_KEYBINDS so all three modules use the same source of truth for defaults.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 58f9810a-5f87-475d-a574-55f6977d66f9
📒 Files selected for processing (7)
resources/lang/en.jsonsrc/client/HelpModal.tssrc/client/InputHandler.tssrc/client/LocalServer.tssrc/client/UserSettingModal.tssrc/client/graphics/layers/GameRightSidebar.tssrc/client/graphics/layers/ReplayPanel.ts
Description:
Can't tell you how many times I've been playing solo, I try to go change the speed from
Maxtox1and before I've opened the speed controls and clicked on one the AI completely wipes me. But not to worry, we now have a pause and speed toggle up/down keybinds!Screen.Recording.2026-03-10.162255.mp4
Keybinds were added to "Menu Shortcuts" submenu:
Tested on Solo, custom match, and public lobbies. Pause intent works correctly on solo and private match (only if you are host), and neither feature works in public matches, as expected.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
bijx