Enable all axis controls simultaneously#686
Conversation
📝 WalkthroughWalkthroughAxis selection state is now persisted and restored across keyboard/HUD transitions for move, rotate, and scale gizmos. ChangesAxis Persistence Across Keyboard/HUD Gizmo Transitions
Keyboard Dispatcher Debug and Quote Cleanup
Sequence Diagram(s)sequenceDiagram
participant GizmoHandler
participant createAdaptiveInput
participant createAxisKeyboardHandler
participant createGizmoMobileHud
GizmoHandler->>createAdaptiveInput: start with initialKeyboardAxis and initialHudAxis
createAdaptiveInput->>createAxisKeyboardHandler: initialAxis and onAxisChange callback
createAdaptiveInput->>createGizmoMobileHud: initialAxis and onAxisChange callback
Note over createAxisKeyboardHandler,createGizmoMobileHud: User selects axis via keyboard or HUD button
createAxisKeyboardHandler-->>createAdaptiveInput: onKbAxisChange(axis)
createAdaptiveInput-->>GizmoHandler: onAxisChange calls onHudAxisSaved(axis)
createGizmoMobileHud-->>createAdaptiveInput: onHudAxisChange(axis)
createAdaptiveInput-->>GizmoHandler: onAxisChange calls onHudAxisSaved(axis)
Note over GizmoHandler: Drag on gizmo handle begins via observeDragAxis
GizmoHandler->>createAdaptiveInput: stop.setAxis(dragAxis)
createAdaptiveInput->>createAxisKeyboardHandler: setAxis(dragAxis)
createAdaptiveInput->>createGizmoMobileHud: setAxis(dragAxis)
Note over GizmoHandler: Gizmo handler restarts on mesh reattach
GizmoHandler->>createAdaptiveInput: start with savedHudAxis as initialKeyboardAxis and initialHudAxis
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@main/keyboardDispatcher.js`:
- Line 59: The comment on line 59 in the keyboardDispatcher.js file incorrectly
states that debug info is printed for all key presses, but the _dispatch
function contains early returns for certain key types like TYPING and OVERLAY
that prevent debug logging for those cases. Revise the comment to accurately
describe the actual behavior, clarifying that debug info is printed only for key
presses that reach the debug logging statement, accounting for the early return
conditions in the _dispatch function's control flow.
In `@ui/gizmos.js`:
- Around line 84-90: The lastReportedAxis variable is only updated in the
onKbAxisChange function, but axis changes can also originate from HUD
interactions and the stop handler, leaving lastReportedAxis out of sync with
actual axis state. This stale state causes the deduplication check to suppress
valid onAxisChange notifications. Update lastReportedAxis whenever the axis
changes in the HUD axis change handler (around lines 94-99) by setting
lastReportedAxis to match the new axis value, and similarly update
lastReportedAxis in the stop.setAxis handler (around lines 112-115) to ensure
the dedupe state always reflects the current axis regardless of the change
origin.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: aa4551ff-e651-4fe7-878f-ea0215126e62
📒 Files selected for processing (4)
main/keyboardDispatcher.jsui/axis-keyboard.jsui/gizmo-mobile-hud.jsui/gizmos.js
Summary
All axis control methods - keyboard, drag and HUD - should be usable interchangeably on all platforms.
AI usage
Claude Sonnet 4.6 used interactively, plans and alterations by a human.
Summary by CodeRabbit
New Features
Bug Fixes