Skip to content

fix(hud): stop the recording overlay from swallowing clicks - #797

Open
iOSDevSK wants to merge 1 commit into
webadderallorg:mainfrom
iOSDevSK:fix/hud-recording-click-through
Open

fix(hud): stop the recording overlay from swallowing clicks#797
iOSDevSK wants to merge 1 commit into
webadderallorg:mainfrom
iOSDevSK:fix/hud-recording-click-through

Conversation

@iOSDevSK

@iOSDevSK iOSDevSK commented Aug 7, 2026

Copy link
Copy Markdown

Problem

While recording, the HUD overlay swaps its full-work-area click-through window for a fixed 860×160 rectangle (860×540 when the webcam preview is up) anchored bottom-centre of the work area, and enables mouse events on the whole window (setIgnoreMouseEvents(false)).

The window is transparent but still a native window, so its empty margins around the bar swallow every click aimed at the app being recorded. Reported symptom: a Save button near the bottom of the screen stops responding as soon as recording starts.

Moving the HUD does not help, for two independent reasons:

  1. On passthrough-capable platforms the bar is dragged by useHudBarDrag, which only translates DOM content inside the HUD window — the window, and therefore the dead rectangle, never moves.
  2. In LaunchWindow.tsx the pointer-events-auto box was the parent of the transformed wrapper. CSS transforms do not move layout boxes, so that box stayed at the bar's original bottom-centre position, kept matching the .pointer-events-auto hover check, and kept eating clicks there.

Fix

1. Scope the compact recording fallback to Windows (recordingForcesHudOverlayFallback, new pure helper in hudOverlayBounds.ts).

The fallback earns its keep on Windows only: focus changes there silently corrupt the WS_EX_TRANSPARENT flag behind setIgnoreMouseEvents forwarding — the reason for the surrounding win32-gated reassert machinery — which would leave the stop button unclickable mid-recording. macOS has no such failure mode, and its renderer is already written for the full-work-area model (JS content-drag; the webcam-preview drag clamp uses screen.width, which was silently clipped to the 860 px window before).

setHudOverlayRecordingActive() now distinguishes three transitions instead of forcing !recording:

transition passthrough
entering the win32 fallback off (compact window is the bar)
leaving the win32 fallback on (window re-expands to the work area)
macOS/Linux start & stop preserved — the renderer's hover tracking owns it

That last one matters: forcing the now-fullscreen window interactive at recording start would block clicks everywhere until the first mouseleave, and forcing it click-through would drop a click already aimed at the bar.

2. Move the interactive box onto the transformed wrapper so it travels with the bar.

Behaviour by platform

  • macOS — full-work-area click-through overlay during recording; no dead zone; webcam preview can now be dragged across the whole screen as its clamp always intended.
  • Windows 11 / Windows 10 — unchanged (compact interactive fallback while recording).
  • Linux — unchanged; passthrough is unsupported there, and the ignore argument only feeds setHudOverlayFallbackExpanded, which Linux skips.

Testing

  • npm test — 1000 passed, including 4 new cases for recordingForcesHudOverlayFallback.
  • tsc --noEmit and biome check clean on the changed files.
  • Manual on macOS: start a recording, click in the bottom-centre strip that was previously dead (with and without the webcam preview), drag the bar away and click its original position, confirm stop/pause still respond.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved HUD behavior while recording on Windows by using compact fallback mode when needed.
    • Preserved full overlay behavior during recording on macOS and Linux.
    • Fixed click-through and pointer interactions after moving the HUD.
    • Improved hover behavior on the transformed HUD bar.

While recording, the HUD overlay traded its full-work-area click-through
window for a fixed 860x160 rectangle (860x540 with the webcam preview)
anchored bottom-centre, with mouse events enabled on the whole window. Its
transparent margins swallowed every click aimed at the app being recorded --
a Save button near the bottom of the screen simply did not respond. Dragging
the bar only translated content inside that window, so moving the controls
never freed the blocked area.

The compact fallback exists because focus changes on Windows corrupt the
WS_EX_TRANSPARENT flag behind setIgnoreMouseEvents forwarding, which would
leave the stop button unclickable. Scope it to win32 and keep the
click-through overlay everywhere else; macOS has no such failure mode and its
renderer is already written for the full-work-area model.

Also move the interactive box off the static column onto the transformed
wrapper: transforms do not move layout boxes, so a pointer-events-auto parent
kept eating clicks at the bar's original position after it was dragged away.

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

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The HUD now forces compact fallback mode only during active Windows recordings. Windows overlay bounds and mouse passthrough transitions use this condition. Pointer handlers now follow the transformed HUD bar.

Changes

HUD recording fallback

Layer / File(s) Summary
Fallback contract and validation
electron/hudOverlayBounds.ts, electron/hudOverlayBounds.test.ts
Adds recordingForcesHudOverlayFallback and tests Windows recording, non-recording, macOS, and Linux behavior.
Windows overlay recording transitions
electron/windows.ts
Applies the forced-fallback condition to HUD bounds, initialization, mouse passthrough, reassertion, and recording state transitions.
Transformed HUD pointer handling
src/components/launch/LaunchWindow.tsx
Makes the outer wrapper non-interactive and attaches pointer and hover handling to the transformed HUD bar wrapper.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RecordingState
  participant WindowsOverlay
  participant HUDOverlay
  RecordingState->>WindowsOverlay: report recording state transition
  WindowsOverlay->>WindowsOverlay: evaluate recordingForcesHudOverlayFallback
  WindowsOverlay->>HUDOverlay: apply compact bounds and interactive mode
  WindowsOverlay->>HUDOverlay: restore expanded bounds and click-through mode
Loading

Possibly related PRs

Suggested reviewers: meiiie, webadderall, extrabinoss

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the HUD recording overlay click-swallowing fix, which is the main change.
Description check ✅ Passed The description clearly explains the problem, fix, platform behavior, and testing results, but it omits several template sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@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: 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 `@electron/windows.ts`:
- Around line 314-317: Update getHudOverlayBounds() or its
shouldExpandHudOverlayFallback() decision so recordingForcesHudFallback() always
forces compact bounds, regardless of active recording or visible webcam preview.
Preserve normal expansion behavior when the Windows fallback is not forced, and
add a regression test covering an active Windows recording with a visible webcam
preview.
- Line 213: Update the overlay bounds-selection logic around
isHudOverlayMousePassthroughSupported() so Linux retains full-work-area
click-through behavior instead of always selecting compact fallback bounds.
Implement the Linux-specific click-through path, or exclude Linux from the
fallback contract while preserving the intended full-work-area overlay
objective.
🪄 Autofix

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: 2f1a1d17-d05a-46d9-80c7-89d50f9f22b4

📥 Commits

Reviewing files that changed from the base of the PR and between 54ae801 and 27bb308.

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

Comment thread electron/windows.ts
return getHudOverlayWindowBounds(
workArea,
isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive,
isHudOverlayMousePassthroughSupported() && !recordingForcesHudFallback(),

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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Keep the full-work-area overlay on Linux.

isHudOverlayMousePassthroughSupported() returns false on Linux. Line 213 therefore always selects compact fallback bounds on Linux. recordingForcesHudFallback() returning false cannot preserve the full-work-area overlay.

Implement a Linux full-work-area click-through path, or remove Linux from this fallback contract and the PR objective.

🤖 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` at line 213, Update the overlay bounds-selection logic
around isHudOverlayMousePassthroughSupported() so Linux retains full-work-area
click-through behavior instead of always selecting compact fallback bounds.
Implement the Linux-specific click-through path, or exclude Linux from the
fallback contract while preserving the intended full-work-area overlay
objective.

Comment thread electron/windows.ts
Comment on lines +314 to 317
if (recordingForcesHudFallback()) {
hudOverlayFallbackExpanded = false;
applyHudOverlayBounds();
hudOverlayWindow.setIgnoreMouseEvents(false);

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Force compact bounds when the Windows fallback is active.

Setting hudOverlayFallbackExpanded = false does not keep the fallback compact. getHudOverlayBounds() calls shouldExpandHudOverlayFallback(), which expands during any active recording with a visible webcam preview. The Windows fallback can therefore become a 540-DIP interactive window and block clicks outside the HUD bar.

Override expansion when recordingForcesHudFallback() is true. Add a regression test for an active Windows recording with a visible webcam preview.

Proposed fix
 function getHudOverlayBounds() {
 	const { workArea } = getHudOverlayDisplay();
-	const fallbackExpanded = shouldExpandHudOverlayFallback({
-		fallbackExpanded: hudOverlayFallbackExpanded,
-		recordingActive: hudOverlayRecordingActive,
-		webcamPreviewVisible: hudOverlayWebcamPreviewVisible,
-	});
+	const fallbackExpanded = recordingForcesHudFallback()
+		? false
+		: shouldExpandHudOverlayFallback({
+				fallbackExpanded: hudOverlayFallbackExpanded,
+				recordingActive: hudOverlayRecordingActive,
+				webcamPreviewVisible: hudOverlayWebcamPreviewVisible,
+			});

Also applies to: 669-677

🤖 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 314 - 317, Update getHudOverlayBounds() or
its shouldExpandHudOverlayFallback() decision so recordingForcesHudFallback()
always forces compact bounds, regardless of active recording or visible webcam
preview. Preserve normal expansion behavior when the Windows fallback is not
forced, and add a regression test covering an active Windows recording with a
visible webcam preview.

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.

1 participant