Add show-hide button for gizmo HUD - #727
Conversation
|
Warning Review limit reached
Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe mobile HUD now supports persistent collapse and expansion through a touch handle or the ChangesHUD collapse controls
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant KeyboardHandler
participant stopAxisKeyboard
participant HUD
participant StatusMessage
KeyboardHandler->>stopAxisKeyboard: Receive O key
stopAxisKeyboard->>HUD: toggleCollapsed()
HUD-->>stopAxisKeyboard: Return collapsed state
stopAxisKeyboard->>StatusMessage: Show localized hidden/shown message
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/gizmo-mobile-hud.test.js (1)
222-226: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winStub pointer capture in this synthetic drag test.
This test still dispatches
pointerdowndirectly, so it can throw the sameNotFoundErrordescribed by the new helper. Wrap the sequence withwithoutPointerCapture(canvas, ...).Proposed fix
expect(() => { - canvas.dispatchEvent(down); - canvas.dispatchEvent(move); - canvas.dispatchEvent(up); + withoutPointerCapture(canvas, () => { + canvas.dispatchEvent(down); + canvas.dispatchEvent(move); + canvas.dispatchEvent(up); + }); }).to.not.throw();🤖 Prompt for 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. In `@tests/gizmo-mobile-hud.test.js` around lines 222 - 226, Wrap the synthetic drag event sequence in the test’s existing withoutPointerCapture helper, passing canvas and the callback that dispatches down, move, and up events. Preserve the current no-throw assertion while ensuring pointer capture is stubbed for the entire sequence.
🧹 Nitpick comments (2)
ui/gizmo-mobile-hud.js (1)
5-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTrim implementation-history commentary.
Lines 5-6 and 9-10 document design discussion rather than current behavior; retain required attribution, but condense the surrounding rationale. As per coding guidelines, comments should be infrequent and reflect the current state of code only.
🤖 Prompt for 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. In `@ui/gizmo-mobile-hud.js` around lines 5 - 10, Trim the top-of-file comments in gizmo-mobile-hud.js by removing implementation-history and dependency-rationale discussion, while retaining the required Font Awesome attribution, license, copyright, and any concise comment describing current behavior.Source: Coding guidelines
locale/de.js (1)
1277-1279: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove translation-provenance comments.
// machinedescribes how text was produced, not the current behavior. Keep this provenance in review history rather than shipping it repeatedly in locale data.
locale/de.js#L1277-L1279: remove the// machineannotations.locale/es.js#L1345-L1347: remove the// machineannotations.locale/fr.js#L1284-L1286: remove the// machineannotations.locale/it.js#L1286-L1288: remove the// machineannotations.locale/pl.js#L1277-L1279: remove the// machineannotations.locale/pt.js#L1288-L1290: remove the// machineannotations.locale/sv.js#L1263-L1265: remove the// machineannotations.🤖 Prompt for 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. In `@locale/de.js` around lines 1277 - 1279, Remove the “// machine” provenance annotations from the hud translation entries shortcut_toggle_hud, hud_hidden, and hud_shown in locale/de.js (1277-1279), locale/es.js (1345-1347), locale/fr.js (1284-1286), locale/it.js (1286-1288), locale/pl.js (1277-1279), locale/pt.js (1288-1290), and locale/sv.js (1263-1265), leaving the translation values unchanged.Source: Coding guidelines
🤖 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.
Outside diff comments:
In `@tests/gizmo-mobile-hud.test.js`:
- Around line 222-226: Wrap the synthetic drag event sequence in the test’s
existing withoutPointerCapture helper, passing canvas and the callback that
dispatches down, move, and up events. Preserve the current no-throw assertion
while ensuring pointer capture is stubbed for the entire sequence.
---
Nitpick comments:
In `@locale/de.js`:
- Around line 1277-1279: Remove the “// machine” provenance annotations from the
hud translation entries shortcut_toggle_hud, hud_hidden, and hud_shown in
locale/de.js (1277-1279), locale/es.js (1345-1347), locale/fr.js (1284-1286),
locale/it.js (1286-1288), locale/pl.js (1277-1279), locale/pt.js (1288-1290),
and locale/sv.js (1263-1265), leaving the translation values unchanged.
In `@ui/gizmo-mobile-hud.js`:
- Around line 5-10: Trim the top-of-file comments in gizmo-mobile-hud.js by
removing implementation-history and dependency-rationale discussion, while
retaining the required Font Awesome attribution, license, copyright, and any
concise comment describing current behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 76523c47-e701-4ce9-b0ad-49035d35c09c
📒 Files selected for processing (12)
accessibility/keyboardui.jslocale/de.jslocale/en.jslocale/es.jslocale/fr.jslocale/it.jslocale/pl.jslocale/pt.jslocale/sv.jstests/gizmo-mobile-hud.test.jsui/gizmo-mobile-hud.jsui/gizmos.js
Summary
The gizmo HUD is useful but it's not for everyone. A new button appears with the HUD allowing it to be shown or hidden depending on preference. The preference is remembered between gizmos
AI usage
Claude Opus 5 wrote all of the code in this pull request. I asked it to plan the feature and then I checked and approved the plan.
Summary by CodeRabbit
New Features
Okeyboard shortcut to hide or show the HUD.Tests