Skip to content

fix: allow clicks to pass through recording control overlay#688

Open
tyronedougherty wants to merge 2 commits into
webadderallorg:mainfrom
tyronedougherty:fix/687-recording-control-click-passthrough
Open

fix: allow clicks to pass through recording control overlay#688
tyronedougherty wants to merge 2 commits into
webadderallorg:mainfrom
tyronedougherty:fix/687-recording-control-click-passthrough

Conversation

@tyronedougherty

@tyronedougherty tyronedougherty commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • Moves pointer-events-auto and mouse enter/leave handlers from the static wrapper div onto the hudBarTransformRef element that moves with the dragged recording controls, so the interactive hit area follows the bar
  • Keeps the HUD overlay window at full work-area bounds during recording on platforms with passthrough support, using Electron's mouse event forwarding to let clicks pass through transparent areas
  • On non-passthrough platforms (Win10, Linux), behavior is unchanged — the compact window remains fully interactive

Closes #687

Test plan

  • Start a full-screen recording on macOS
  • Verify the recording controls are visible and clickable
  • Verify clicking anywhere outside the control bar passes through to other apps
  • Drag the recording controls to a new position — verify clicks still pass through the original position
  • Verify idle (pre-recording) HUD still works correctly with hover detection
  • Test on Windows 10 (non-passthrough fallback) to confirm no regression

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved HUD overlay mouse passthrough behavior so overlay interactions remain consistent and responsive during recording, including when passthrough support is available.
    • Updated HUD bar pointer-event handling by adjusting where mouse enter/leave behavior is applied, resulting in more reliable control responsiveness within the HUD bar area.

The HUD overlay window blocked all clicks in an 860×160 rectangle during
recording. Two issues contributed:

1. The pointer-events-auto hit area was on a static wrapper div rather
   than the transformed element that moves with the dragged controls,
   so the interactive region never followed the bar.

2. The main process forced the window into compact non-passthrough bounds
   during recording, disabling the forwarding mechanism that allows clicks
   to reach apps beneath transparent areas.

Move pointer-events-auto and mouse handlers onto the hudBarTransformRef
div so the hit area tracks the controls. Keep the window at full work-area
bounds during recording on platforms with passthrough support, letting the
renderer's hover detection toggle click interception only when the cursor
is directly over the control bar.

Closes webadderallorg#687

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e27c191-2467-4d8f-b481-389fd163a30b

📥 Commits

Reviewing files that changed from the base of the PR and between 50787ac and 72aa02b.

📒 Files selected for processing (1)
  • electron/windows.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • electron/windows.ts

📝 Walkthrough

Walkthrough

HUD overlay mouse passthrough is decoupled from hudOverlayRecordingActive: when passthrough is platform-supported, it stays enabled during recording. setHudOverlayRecordingActive re-applies passthrough from hudOverlayIgnoringMouse state. In LaunchWindow.tsx, pointer-events-auto and mouse enter/leave handlers move from the outer to the inner HUD bar container.

Changes

HUD Mouse Passthrough During Recording

Layer / File(s) Summary
HUD overlay passthrough logic decoupled from recording state
electron/windows.ts
getHudOverlayBounds passes isHudOverlayMousePassthroughSupported() directly. setHudOverlayMousePassthrough simplifies the hudOverlayIgnoringMouse ternary and gates the "force off" early-return on passthrough not being supported. createHudOverlayWindow unconditionally sets hudOverlayIgnoringMouse = true when supported. reassertHudOverlayMousePassthrough keeps forwarding enabled during recording. setHudOverlayRecordingActive re-applies from hudOverlayIgnoringMouse instead of !hudOverlayRecordingActive.
HUD bar pointer-events moved to inner container
src/components/launch/LaunchWindow.tsx
Outer wrapper removes pointer-events-auto; inner div with hudBarTransformRef gains pointer-events-auto and the onMouseEnter/onMouseLeave handlers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • webadderallorg/Recordly#486: Directly modifies the same reassertHudOverlayMousePassthrough and setIgnoreMouseEvents logic relative to recording state in electron/windows.ts.
  • webadderallorg/Recordly#616: Updates reassertHudOverlayMousePassthrough with timing-based passthrough re-application, directly intersecting with this PR's changes to that function.
  • webadderallorg/Recordly#626: Modifies setHudOverlayMousePassthrough and the HUD overlay ignore state logic in electron/windows.ts at the same code level.

Poem

🐰 Hop hop, the overlay said,
"My clicks were blocked, my users fled!"
Now passthrough stays when recording's live,
The inner div helps pointer-events thrive.
No more dead zones near the HUD bar—
The rabbit fixed it, near and far! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: allowing clicks to pass through the recording control overlay, which directly addresses the core issue.
Description check ✅ Passed The description covers key aspects: the hit area repositioning, window bounds adjustment, platform-specific behavior, and references the related issue #687 with a test plan.
Linked Issues check ✅ Passed The PR directly addresses #687 by enabling clicks to pass through transparent areas of the recording overlay on macOS, matching the expected behavior of allowing interaction with UI elements outside the control bar.
Out of Scope Changes check ✅ Passed All changes are scoped to the recording overlay click-through issue: pointer events repositioning in LaunchWindow.tsx and mouse passthrough logic adjustments in windows.ts remain focused on the stated objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
electron/windows.ts (1)

279-310: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Apply the source-selection override to the actual window state.

Line 281 can force hudOverlayIgnoringMouse to true, but Lines 299 and 305 still apply the raw ignore argument. When source selection is active and ignore is false, the stored state says click-through while the window is made interactive.

Proposed fix
 function setHudOverlayMousePassthrough(ignore: boolean) {
-	hudOverlayIgnoringMouse =
+	const shouldIgnoreMouse =
 		hudOverlaySourceSelectionActive && !hudOverlayRecordingActive ? true : ignore;
+	hudOverlayIgnoringMouse = shouldIgnoreMouse;
 
 	if (hudOverlayMouseReassertTimer) {
 		clearTimeout(hudOverlayMouseReassertTimer);
@@
 	if (!isHudOverlayMousePassthroughSupported()) {
 		if (process.platform !== "linux") {
-			setHudOverlayFallbackExpanded(!ignore);
+			setHudOverlayFallbackExpanded(!shouldIgnoreMouse);
 		}
 		hudOverlayWindow.setIgnoreMouseEvents(false);
 		return;
 	}
 
-	if (ignore) {
+	if (shouldIgnoreMouse) {
 		hudOverlayWindow.setIgnoreMouseEvents(true, { forward: true });
 		return;
 	}
🤖 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/windows.ts` around lines 279 - 310, The
setHudOverlayMousePassthrough function computes the correct mouse passthrough
state and stores it in hudOverlayIgnoringMouse on line 281, but then uses the
raw ignore parameter instead of this computed state when calling
hudOverlayWindow.setIgnoreMouseEvents at lines 299 and 305. Replace the raw
ignore parameter with hudOverlayIgnoringMouse (or its appropriate negation) when
setting the window's ignore mouse events state to ensure the window behavior
matches the stored state, especially when source selection is active.
🤖 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 `@electron/windows.ts`:
- Around line 607-609: In the reassertHudOverlayMouseState() function, the
recording path (when hudOverlayRecordingActive is true) currently forces
setIgnoreMouseEvents(true, { forward: true }) which ignores the stored
hudOverlayIgnoringMouse state. Replace this forced click-through behavior with a
call to setHudOverlayMousePassthrough() that reapplies the stored state,
matching the pattern used in the non-recording path at line 621, so the
main-process mouse state stays synchronized with the renderer's actual hover
state over controls.

---

Outside diff comments:
In `@electron/windows.ts`:
- Around line 279-310: The setHudOverlayMousePassthrough function computes the
correct mouse passthrough state and stores it in hudOverlayIgnoringMouse on line
281, but then uses the raw ignore parameter instead of this computed state when
calling hudOverlayWindow.setIgnoreMouseEvents at lines 299 and 305. Replace the
raw ignore parameter with hudOverlayIgnoringMouse (or its appropriate negation)
when setting the window's ignore mouse events state to ensure the window
behavior matches the stored state, especially when source selection is active.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0fe46ee8-2aac-40c9-81b4-04643c018614

📥 Commits

Reviewing files that changed from the base of the PR and between 952d63d and 50787ac.

📒 Files selected for processing (2)
  • electron/windows.ts
  • src/components/launch/LaunchWindow.tsx

Comment thread electron/windows.ts
Instead of forcing setIgnoreMouseEvents(true, { forward: true }) during
recording, reapply the stored hudOverlayIgnoringMouse state so the main
process stays in sync with the renderer's hover state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot click anywhere near the recording control layover while recording

1 participant