Skip to content

test(hud): guard full-screen passthrough bounds while recording - #873

Open
adityarao3 wants to merge 1 commit into
webadderallorg:mainfrom
adityarao3:test/hud-recording-passthrough-bounds
Open

test(hud): guard full-screen passthrough bounds while recording#873
adityarao3 wants to merge 1 commit into
webadderallorg:mainfrom
adityarao3:test/hud-recording-passthrough-bounds

Conversation

@adityarao3

@adityarao3 adityarao3 commented Sep 4, 2026

Copy link
Copy Markdown

Problem

getHudOverlayBounds() used to pass isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive to getHudOverlayWindowBounds(). The && !hudOverlayRecordingActive term meant that starting a recording made the overlay behave as if passthrough were unsupported, so it dropped from the full-screen click-through overlay to the compact 860x160 fallback window.

That window is opaque to clicks. While recording it swallowed every click landing in the bottom-centre of the screen instead of passing it through to the app being recorded, and the HUD's own Stop button became unreachable once the renderer requested passthrough on hover.

On a 1536x816 work area the overlay became an opaque bar at (338, 656), which matches the region users report as unclickable.

This is the Windows/macOS counterpart of the click-blocking behaviour described in #861 (which covers the Linux side, where passthrough is genuinely unsupported).

Status on main

Already fixed: dd7af60 ("Keep the recording webcam movable and visible") removed the && !hudOverlayRecordingActive term. That change was made while working on the recording webcam rather than as a deliberate fix for this, and no test covers the decision, so the regression can silently return.

It is still present in every published release — v1.3.3, v1.3.4-beta.1 and v1.3.5-beta.2 — so users on a download rather than main still hit it.

What this PR adds

A regression test only. No production code changeselectron/windows.ts is untouched.

The test drives the real createHudOverlayWindow() and setHudOverlayRecordingActive() code paths with electron mocked, then asserts the bounds applied while recording still cover the full work area. It binds to the actual call site rather than re-implementing the predicate, so it fails if the old expression comes back.

windows.ts resolves the screen module through createRequire("electron"), which bypasses vi.mock("electron"), so node:module is mocked alongside it.

Verification

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue where starting a recording could cause the HUD overlay to resize incorrectly and block clicks in other areas of the screen.
    • The HUD overlay now maintains the correct work-area bounds during recording on supported platforms.
  • Tests

    • Added coverage to help prevent regressions in HUD overlay sizing during recording.

getHudOverlayBounds() used to pass
`isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive`
to getHudOverlayWindowBounds(), so starting a recording dropped the HUD
from the full-screen click-through overlay to the compact 860x160
fallback window. That window is opaque to clicks, so it swallowed every
click landing in the bottom-centre of the screen instead of passing it to
the app being recorded, and the HUD's own Stop button became unreachable
once the renderer requested passthrough.

dd7af60 removed the `&& !hudOverlayRecordingActive` term while working on
the recording webcam, but nothing covers that decision, so the regression
can return unnoticed. The bug is still present in every published release
(v1.3.3, v1.3.4-beta.1, v1.3.5-beta.2).

This adds a test that drives the real createHudOverlayWindow() and
setHudOverlayRecordingActive() code paths with electron mocked, and
asserts the bounds applied while recording still cover the full work
area. Verified it fails with the old expression restored and passes on
current main. The test is skipped on Linux, where passthrough is
unsupported and the compact fallback is the intended behaviour.

Test-only; no production code changes.
@coderabbitai

coderabbitai Bot commented Sep 4, 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: Team

Run ID: 2fa43e3e-86ed-47ff-ac50-aa7c092357ab

📥 Commits

Reviewing files that changed from the base of the PR and between c1e263f and ef18a7a.

📒 Files selected for processing (1)
  • electron/hudOverlayRecordingBounds.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds an Electron test for HUD overlay bounds. The test mocks Electron display and window APIs, activates recording, and verifies that the overlay retains the full work-area bounds on non-Linux platforms.

Changes

HUD overlay bounds validation

Layer / File(s) Summary
Mocked overlay recording bounds test
electron/hudOverlayRecordingBounds.test.ts
The test defines a work area, mocks Electron module access and window APIs, creates the HUD overlay, activates recording, and verifies that the final bounds match the full work area.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ef18a

This change adds regression coverage to ensure the HUD retains full-screen passthrough bounds when recording starts, without changing production behavior. It is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the change as a regression test that protects HUD full-screen passthrough bounds during recording.
Description check ✅ Passed The description clearly explains the problem, motivation, test scope, verification results, platform behavior, and related issue context. It does not use the repository template headings or include th…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant