fix(hud): keep controls visible when recording starts#750
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe HUD drag hook now keeps the bar inside the viewport after window or HUD size changes. A reusable clamping utility and Vitest tests define and verify independent horizontal and vertical offset adjustments. ChangesHUD viewport clamping
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Sequence Diagram(s)sequenceDiagram
participant Window
participant ResizeObserver
participant useHudBarDrag
participant HUDBar
Window->>useHudBarDrag: Emit resize event
ResizeObserver->>useHudBarDrag: Report HUD size change
useHudBarDrag->>HUDBar: Read bounding rect
useHudBarDrag->>useHudBarDrag: Clamp current offset
useHudBarDrag->>HUDBar: Update transform
useHudBarDrag->>useHudBarDrag: Update recordingHudOffset
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Fixes a Windows HUD positioning regression where dragging the idle bar before recording could leave the compact recording controls entirely outside the resized viewport.
Root cause and fix
The recording window contracts from the work-area overlay to
860x160, but the renderer retained the prior CSS drag offset. The HUD stayed alive and recording continued; its bar was simply offscreen.This change adds a small viewport-clamping helper and reapplies the invariant on window/HUD resize. It adjusts only axes that cross the viewport and leaves an already-visible bar unchanged.
Verification
860x160, recording bar remains fully visible at approximately(93.69, 0, 422.52, 69.60), Stop completes mux and opens the editorRisk
Scope is limited to renderer-side HUD bounds after resize. Capture, recording, audio, export, and editor layout are unchanged. Windows x64 was exercised directly; macOS/Linux behavior is covered by shared geometry tests but was not runtime-tested.
Summary by CodeRabbit
Bug Fixes
Tests