Skip to content

fix(recording): compact HUD fallback on Windows 10#584

Merged
meiiie merged 2 commits into
mainfrom
fix/windows-recorder-hud-passthrough
May 24, 2026
Merged

fix(recording): compact HUD fallback on Windows 10#584
meiiie merged 2 commits into
mainfrom
fix/windows-recorder-hud-passthrough

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 24, 2026

Description

Constrain the recorder HUD fallback window on platforms where Electron mouse passthrough is unavailable, especially Windows 10.

Instead of keeping a full-work-area transparent HUD window that must remain mouse-interactive, the fallback now uses:

  • a compact bottom-centered HUD window while idle/non-hovered
  • an expanded bottom-centered HUD window only while the HUD needs interaction, hover, or menus
  • the existing full-work-area overlay on Win11/macOS where passthrough works

Motivation

Issue #581 reports that on Windows 10 / Recordly 1.3.0 the recorder HUD blocks click and scroll behind Recordly after recording starts, and one reporter also no longer sees the countdown after updating. Current main disables HUD mouse passthrough for Windows builds below 22000, but still creates a full-work-area transparent overlay. That means the fallback can swallow the whole screen.

Type of Change

  • Bug fix

Related Issue(s)

Changes Made

  • Added a pure getHudOverlayWindowBounds helper for full, compact fallback, and expanded fallback bounds.
  • Wired the HUD overlay window to use compact/expanded bounds when passthrough is not supported.
  • Reused the existing hud-overlay-set-ignore-mouse signal to expand the fallback only when the HUD needs interaction.
  • Let the HUD drag handle use native window dragging for non-passthrough fallback windows.

Scope Note

This PR only targets the Windows 10/non-passthrough HUD input blocker. It does not change export routing, WGC capture startup, NVIDIA export, or the timeline speed-overlap report from #581.

Testing Guide

On Windows 10:

  1. Start Recordly 1.3.0/current main with this branch.
  2. Start a recording with countdown enabled.
  3. Confirm the countdown appears.
  4. While recording, move the mouse away from the HUD and verify apps behind Recordly can be clicked and scrolled.
  5. Hover/open HUD menus and confirm the HUD remains usable.
  6. Drag the HUD using the handle and confirm the window moves normally.

Checklist

  • Focused regression surface only
  • Added targeted bounds tests
  • Typecheck passes locally
  • Scoped Biome passes locally
  • Windows 10 runtime smoke on affected machine

Local Checks

  • npm test -- electron/hudOverlayBounds.test.ts src/components/launch/hudMousePassthrough.test.ts src/components/launch/floatingWebcamPreview.test.ts
  • npx tsc --noEmit --pretty false
  • npx biome check --formatter-enabled=false electron/hudOverlayBounds.ts electron/hudOverlayBounds.test.ts electron/windows.ts src/components/launch/LaunchWindow.tsx
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Improved HUD overlay positioning and resizing so the HUD stays visible and centered across varied display sizes and modes; preserves the dragged bottom edge when resizing.
    • Enhanced HUD bar drag handling on Linux and when advanced display passthrough is unavailable.
  • Tests

    • Added tests covering overlay bounds, expanded/compact fallback behavior, clamping on small/off-screen work areas, and resize preservation.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

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: aa9df396-4fe3-475d-ba48-acc93e908e11

📥 Commits

Reviewing files that changed from the base of the PR and between 513e79a and ca05922.

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

📝 Walkthrough

Walkthrough

Adds HUD overlay bounds calculation and a resize helper used when mouse passthrough is unavailable. getHudOverlayWindowBounds returns the full work area when passthrough is supported or a centered, bottom-aligned fallback (compact or expanded) when not. Integration adds fallback-expanded state, UI drag-mode changes, and tests.

Changes

HUD Overlay Bounds and Fallback Behavior

Layer / File(s) Summary
HUD bounds calculation contract and implementation
electron/hudOverlayBounds.ts
HudOverlayWorkArea plus constants and getHudOverlayWindowBounds compute full workArea when passthrough is supported or a centered, bottom-aligned fallback with clamped width/height when not. Adds resizeHudOverlayFallbackBounds to compute next bounds and clamp a dragged position into the work area.
HUD bounds integration and fallback-expanded state
electron/windows.ts
Imports bounds helpers, adds module-level hudOverlayFallbackExpanded state, changes getHudOverlayBounds() to call the helper, adds setHudOverlayFallbackExpanded() which calls resizeHudOverlayFallbackBounds and repositions the toast, updates the "hud-overlay-set-ignore-mouse" IPC flow, and resets the fallback flag on HUD window creation.
HUD drag behavior with fallback support
src/components/launch/LaunchWindow.tsx
Reorders imports and introduces useNativeHudBarDrag (true on Linux OR when HUD mouse passthrough is unsupported). Updates the HUD bar handle to use this flag and documents native drag vs JS-translation behavior.
HUD bounds calculation test coverage
electron/hudOverlayBounds.test.ts
Adds Vitest coverage for getHudOverlayWindowBounds across passthrough/compact/expanded/clamped scenarios and tests resizeHudOverlayFallbackBounds for bottom-edge preservation and clamping.

Sequence Diagram

sequenceDiagram
  participant App as App / Display change
  participant Bounds as getHudOverlayWindowBounds
  participant Resize as resizeHudOverlayFallbackBounds
  participant Windows as electron/windows
  participant UI as LaunchWindow (useNativeHudBarDrag)

  App->>Bounds: compute bounds(workArea, passthroughFlag, fallbackExpanded)
  alt passthrough supported
    Bounds-->>App: return workArea
  else passthrough unavailable
    Bounds-->>App: return centered, bottom-aligned fallback (compact|expanded)
  end
  Windows->>Resize: resize(currentBounds, fallbackExpanded)
  Resize->>Bounds: request fallback bounds(workArea,false,fallbackExpanded)
  Resize-->>Windows: return clamped next bounds
  Windows-->>UI: expose passthrough state -> UI sets useNativeHudBarDrag accordingly
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • webadderallorg/Recordly#157: Modifies the isHudOverlayMousePassthroughSupported / "hud-overlay-set-ignore-mouse" flow related to passthrough handling that this PR extends.
  • webadderallorg/Recordly#163: Overlaps with LaunchWindow HUD drag handling and hudOverlaySetIgnoreMouse behavior adjustments.
  • webadderallorg/Recordly#224: Also updates HUD bounds application and clamping logic; related to how saved user-dragged positions are reused.

Suggested labels

Checked

Poem

🐰
I measured bounds by moonlight's glow,
When passthrough stops the show,
I center, clamp, and gently slide,
So HUD can nestle at the side.
A little hop — the overlay's right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly identifies the main change: implementing a compact HUD fallback for Windows 10 where mouse passthrough is unavailable, directly addressing the PR's primary objective.
Description check ✅ Passed The PR description comprehensively covers all required template sections including description, motivation, type of change, related issues, and testing guide with clear steps.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-recorder-hud-passthrough

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@meiiie meiiie mentioned this pull request May 24, 2026
@meiiie
Copy link
Copy Markdown
Collaborator Author

meiiie commented May 24, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 246-260: The code currently recomputes full fallback bounds from
getHudOverlayBounds() on each ignore-mouse transition and snaps any user-dragged
fallback position back to the default; modify setHudOverlayFallbackExpanded to
preserve the dragged origin by using the existing window bounds when present
(e.g. call hudOverlayWindow.getBounds() and reuse its x/y when building the new
bounds or store a persisted hudFallbackDraggedOrigin when the user moves the
window and feed that into getHudOverlayBounds), then call
hudOverlayWindow.setBounds with the preserved x/y and the new width/height;
apply the same preservation logic to the similar code path referenced around the
other block that also calls getHudOverlayBounds()/setBounds so drags are not
lost on expand/collapse.

In `@src/components/launch/LaunchWindow.tsx`:
- Around line 429-431: The predicate that sets useNativeHudBarDrag incorrectly
includes !showRecordingWebcamPreview, causing the Win10 non-passthrough fallback
to use the JS drag path when the webcam preview is visible; remove the
showRecordingWebcamPreview check so useNativeHudBarDrag is driven only by
platform and hudOverlayMousePassthroughSupported (i.e., compute
useNativeHudBarDrag from (platform === "linux" ||
hudOverlayMousePassthroughSupported === false)); apply the same change to the
other identical predicate that references useNativeHudBarDrag /
hudOverlayMousePassthroughSupported near the second occurrence.
🪄 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: db9a6038-6286-4599-b3e0-f490ca9f856e

📥 Commits

Reviewing files that changed from the base of the PR and between 9f1c697 and 513e79a.

📒 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
Comment thread src/components/launch/LaunchWindow.tsx Outdated
@meiiie
Copy link
Copy Markdown
Collaborator Author

meiiie commented May 24, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@meiiie meiiie marked this pull request as ready for review May 24, 2026 15:08
@meiiie meiiie merged commit d47550b into main May 24, 2026
3 checks passed
@meiiie meiiie deleted the fix/windows-recorder-hud-passthrough branch May 24, 2026 15:08
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