fix(hud): pass clicks through transparent recording overlay - #803
fix(hud): pass clicks through transparent recording overlay#803tanmayapex wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThe PR defines tested HUD mouse policies and applies them across recording, source selection, initialization, reassertion, Electron window transitions, and renderer interaction state. ChangesRecording HUD click-through
Estimated code review effort: 3 (Moderate) | ~25 minutes 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 |
348a640 to
8adbd28
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
electron/hudOverlayBounds.test.ts (1)
80-111: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover both recording states.
recordingActiveis part of the policy contract, but every new case passestrue. Add onerecordingActive: falsecase with the same requested state to verify that recording transitions do not override renderer requests.🤖 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 `@electron/hudOverlayBounds.test.ts` around lines 80 - 111, Extend the resolveHudOverlayMousePolicy tests with a recordingActive: false case using the same requested state, and assert that the renderer’s requested mouse policy remains unchanged when recording is inactive. Keep the existing recordingActive: true and unsupported-passthrough coverage intact.
🤖 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.
Nitpick comments:
In `@electron/hudOverlayBounds.test.ts`:
- Around line 80-111: Extend the resolveHudOverlayMousePolicy tests with a
recordingActive: false case using the same requested state, and assert that the
renderer’s requested mouse policy remains unchanged when recording is inactive.
Keep the existing recordingActive: true and unsupported-passthrough coverage
intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 402e5a85-c232-4bf6-b81f-321562097405
📒 Files selected for processing (5)
docs/superpowers/plans/2026-08-10-recording-hud-click-through.mddocs/superpowers/specs/2026-08-10-recording-hud-click-through-design.mdelectron/hudOverlayBounds.test.tselectron/hudOverlayBounds.tselectron/windows.ts
Keep transparent regions of the recording HUD click-through while visible controls remain interactive. Preserve hover-driven passthrough during recording, retain the unsupported-platform fallback, and add regression coverage.
8adbd28 to
aef0435
Compare
Description
Keep transparent regions of the recording HUD click-through while recording, without making the visible HUD controls, popovers, dragging, or webcam preview unclickable.
Problem and root cause
Starting a recording previously forced the native HUD window to accept mouse events. Because that transparent Electron window spans the work area on supported Windows versions, it intercepted input intended for the website or app underneath it.
The follow-up diagnosis found two additional timing windows in the live path:
Those delays made website hover feel abnormal and allowed quick clicks to land on the invisible HUD during recording transitions.
Focused change
Why this approach over #797
PR #797 limits its main passthrough change to macOS and introduces a platform-specific recording fallback. CodeRabbit still reports two unresolved functional issues there: its Linux path cannot meet its stated full-work-area contract, and its Windows fallback can expand to a 540-DIP interactive window when the webcam preview is visible and continue blocking underlying clicks.
This PR instead uses one policy for HUD bounds, window creation, mouse updates, reassertion, and recording transitions. It enables full-work-area click-through wherever the existing capability check supports it, including Windows 11+, preserves interactive controls, removes the native timing gaps discovered in live testing, and explicitly retains the existing fallback on unsupported platforms.
User impact
During recording, visible HUD controls remain interactive, while hover and clicks outside active HUD content return to the underlying website or application without an artificial delay.
Type of change
Testing
npx tsc --noEmitnpm run lint(passes with 21 existing advisory warnings outside the changed files)npm test(107 files passed; 1,014 tests passed; 1 skipped)npx biome check electron/hudOverlayBounds.ts electron/hudOverlayBounds.test.ts electron/windows.ts src/components/launch/hudMousePassthrough.ts src/components/launch/hudMousePassthrough.test.ts src/components/launch/hooks/useLaunchHudInteractionState.tsnpm run i18n:checknpx electron-builder --winnpm run smoke:packaged-binariesRegression tests cover supported recording passthrough, interactive requests, unsupported fallback windows, synchronous Windows reassertion, and idle-versus-active HUD interaction state.
Risk
The main risk is making visible HUD controls click-through too early. Passthrough is restored only when the pointer is outside the HUD and there is no open popover, HUD drag, webcam drag, or pending webcam pointer action. Focused tests cover every one of those guards.
Checklist
main.Summary by CodeRabbit
New Features
Bug Fixes
Tests