Skip to content

fix(linux): resolve HUD overlay restricted width and popover clipping… - #799

Open
sahilcodexx wants to merge 3 commits into
webadderallorg:mainfrom
sahilcodexx:fix/linux-hyprland-hud-bounds
Open

fix(linux): resolve HUD overlay restricted width and popover clipping…#799
sahilcodexx wants to merge 3 commits into
webadderallorg:mainfrom
sahilcodexx:fix/linux-hyprland-hud-bounds

Conversation

@sahilcodexx

@sahilcodexx sahilcodexx commented Aug 8, 2026

Copy link
Copy Markdown

Pull Request Template

Description

This PR resolves an issue on Linux environments (specifically tiling Wayland compositors like Hyprland/Sway and X11 desktop managers) where the floating recording HUD overlay was constrained by artificial window bounds, causing:

  1. Vertical Clipping: Upward-opening popovers and dropdown menus (Language, Appearance, Recording Path, Mic Settings, Webcam Controls) were clipped at 160px height.
  2. Width Restriction: The HUD container width and floating elements were bounded by hardcoded non-passthrough fallback dimensions (860px / 1200px), preventing full display utilization.

Technical Root Cause

  • In electron/windows.ts, an explicit if (process.platform !== "linux") check was skipping setHudOverlayFallbackExpanded(!ignore) when mouse events arrived. This meant that when users hovered over the HUD bar or opened a popover menu on Linux, the window bounds were never expanded from 160px compact height to the expanded height.
  • In electron/hudOverlayBounds.ts, getHudOverlayWindowBounds was returning partial fallback dimensions instead of utilizing full display work area bounds ({ ...workArea }) for Linux transparent windows.

Changes Implemented

  • Full Screen Work Area Bounds: Updated getHudOverlayWindowBounds and resizeHudOverlayFallbackBounds in electron/hudOverlayBounds.ts to return full work area bounds ({ ...workArea }) on Linux, allowing transparent click-through windows to span the full screen seamlessly.
  • Enabled Dynamic Fallback Expansion: Removed the if (process.platform !== "linux") guard in electron/windows.ts, allowing setHudOverlayFallbackExpanded(!ignore) to trigger when popovers open or when mouse hover starts on Linux.
  • Fluid Container Width: Changed .bar in src/components/launch/LaunchWindow.module.css from max-width: 1200px to max-width: 100% so the HUD bar scales fluidly without hardcoded CSS limits.
  • Preserved Multi-OS Compatibility: Guaranteed that macOS, Windows 11, and legacy Windows 10 retain their exact native passthrough and fallback safety guarantees without regression.

Motivation

On Linux Wayland compositors (such as Hyprland), opening any menu card or settings popover from the recording HUD resulted in severely truncated options (e.g. Language options were cut off at the top edge of the 160px window). This fix ensures that Linux users enjoy the exact same unconstrained, premium floating HUD experience as users on macOS and Windows.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

N/A

Screenshots

Before
issue1

After
resloved1

Testing Guide

  1. Build / Test Verification:
    • Run npx tsc --noEmit to verify zero TypeScript errors.
    • Run npm run test to verify all 106 test suites (996 tests) pass.
    • Run npx vitest run electron/hudOverlayBounds.test.ts to test HUD overlay bounds logic specifically.
  2. Runtime Testing on Linux / Hyprland / Wayland:
    • Launch Recordly on Linux using npm run dev.
    • Click the "More" (three dots) popover, Mic popover, or Webcam popover on the floating HUD bar.
    • Verify that all popover menus open fully with zero top clipping or height truncation.
    • Hover on and off the HUD bar to ensure transparent mouse pass-through works as expected.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Thank you for contributing!

Summary by CodeRabbit

  • New Features

    • Expanded the HUD overlay to 1200×600 for improved usability when mouse passthrough is unavailable.
    • On Linux, the HUD now uses the full available display work area.
  • Bug Fixes

    • Improved HUD sizing, resizing, fallback behavior, and small-display handling across platforms.
    • Ensured resized HUD windows remain within the available work area.
    • Kept the launch window bar within its containing area for a more responsive layout.

@coderabbitai

coderabbitai Bot commented Aug 8, 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: 306c08bb-f8ac-4e24-840b-23d03e2bfc9e

📥 Commits

Reviewing files that changed from the base of the PR and between 594cee1 and 8fdee92.

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

📝 Walkthrough

Walkthrough

HUD overlay bounds now use the full work area on Linux and when mouse passthrough is unsupported. Non-passthrough dimensions increase. Launch bar width is constrained to its containing block.

Changes

HUD overlay bounds

Layer / File(s) Summary
Full work-area bounds and resizing
electron/hudOverlayBounds.ts, electron/hudOverlayBounds.test.ts
Non-passthrough dimensions increase to 1200×600 DIP. Linux fallback paths return the complete work area. Tests cover bounds, resizing, and platform cleanup.
Passthrough capability integration
electron/windows.ts
Fallback expansion applies when mouse passthrough is unsupported.

Launch bar width

Layer / File(s) Summary
Container-width constraint
src/components/launch/LaunchWindow.module.css
The .bar rule uses max-width: 100%. An empty line before .menuCard is removed.

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

Sequence Diagram(s)

sequenceDiagram
  participant HUDBounds
  participant Platform
  participant WorkArea
  HUDBounds->>Platform: Check platform and passthrough support
  Platform->>WorkArea: Provide complete work area
  HUDBounds->>WorkArea: Return full bounds on Linux
  HUDBounds->>HUDBounds: Calculate expanded fallback bounds on non-Linux
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Linux HUD overlay width and popover clipping fixes.
Description check ✅ Passed The description covers the required sections, explains the problem and changes, includes testing steps, screenshots, and checklist status.
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: 1

🤖 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/hudOverlayBounds.test.ts`:
- Around line 25-35: Make the overlay bounds tests platform-specific: in
electron/hudOverlayBounds.test.ts:25-35, mock Linux before asserting full
work-area results from getHudOverlayWindowBounds, while retaining non-Linux
assertions for constrained fallback geometry; in
electron/hudOverlayBounds.test.ts:47-89, mock Linux before full-work-area resize
assertions and retain non-Linux compact and expanded fallback resize
expectations.
🪄 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: 849561c1-52c3-430d-9b26-28063bacf15d

📥 Commits

Reviewing files that changed from the base of the PR and between 54ae801 and 7308e37.

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

Comment thread electron/hudOverlayBounds.test.ts Outdated

@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

🤖 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/hudOverlayBounds.test.ts`:
- Around line 25-27: Replace the invalid process.platform getter spies in
getHudOverlayWindowBounds tests with a data-property override and restore
mechanism. Apply this to electron/hudOverlayBounds.test.ts at lines 25-27,
30-32, 40-42, 50-52, 70-72, 104-106, 120-122, 141-143, and 162-164, covering the
linux and win32 cases while restoring the original platform value after each
test.
🪄 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: c08e9fe8-d4c0-4a9f-a881-97d4c6867454

📥 Commits

Reviewing files that changed from the base of the PR and between 7308e37 and 594cee1.

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

Comment thread electron/hudOverlayBounds.test.ts
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