Skip to content

fix(hud): put the bar back where it was dropped once a popover closes - #1161

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/hud-bar-stays-put
Oct 13, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
fix/hud-bar-stays-put

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a popover closes, the HUD bar goes back to where the user dropped it.

  • Cause. A popover opening near the top of the screen sends its stack rect (hud-overlay-content), and reclampHud pushes the window down until the popover fits. Every later re-clamp started from that pushed window. When the popover closed, the bar was already on screen, so nothing moved it back. Each taller popover pushed it further: 200 → 268 → 380 in the report.
  • Fix. The main process keeps the bar's home: its bottom-centre on screen, set by a drag and by the first resize. Re-clamps and resizes place the window from home, through hudResizeBounds's new anchor input. A popover still pushes the bar while it is open, and closing it brings the bar back.
  • hudBarAnchor gives the bar's bottom-centre from any stack rect. The stack is centred and bottom-anchored on the bar, so an open popover does not change that point.
  • Display changes and restore-from-minimized now place from home too. A bar pushed by a shrinking work area returns once the space is back. Linux, which clamps the whole window, keeps doing that, now from home.

Candidate for cherry-pick to release/v2.1.0.

Related issue

Fixes #1136

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

None. Nothing was run against a real window: the change is placement math, tested headless. A human check is below.

Testing

  • electron/hudWindowBounds.test.ts: the report's sequence. The bar is dropped with its top at y 200. The language menu (320 px) pushes it down and closing the menu brings it back to 200. Device settings (470 px) pushes from home and returns there. A bar with room above it does not move.
  • npx tsc --noEmit, npx tsc -p tsconfig.test.json --noEmit and Biome pass.

To check by hand (Windows and macOS)

  1. Drag the horizontal bar near the top of the screen, with its top about 200 px from the edge.
  2. Open the language menu: the bar may move down so the menu fits. Close it: the bar returns to where you dropped it.
  3. Same with Device settings (the gear), the taller panel. Then open and close both several times: the bar must not walk down.
  4. With the bar at the bottom of the screen, open both popovers: the bar must not move at all.
  5. Flip to the vertical tray and back near the top: the bar keeps its place.
  6. Optional: drag the bar to the top, change the taskbar or display scale, then revert: the bar comes back to where it was.

🤖 Generated with Claude Code

A popover opening near the top of the screen pushes the HUD window down so it fits. Every re-clamp then started from the pushed window, so the bar stayed down after the popover closed, and moved further with each taller popover. The main process now keeps the bar's home, its bottom-centre where a drag or the first resize left it, and places the window from there. A popover still pushes the bar while it is open; closing it brings the bar back. Refs #1136.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ea95fced-5ca0-498f-b33b-13882fedefc5

📥 Commits

Reviewing files that changed from the base of the PR and between 9c55596 and 10f049c.


📒 Files selected for processing (3)
  • electron/hudWindowBounds.test.ts
  • electron/hudWindowBounds.ts
  • electron/windows.ts

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

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.

@EtienneLescot
EtienneLescot merged commit 9bffac8 into main Oct 13, 2026
19 checks passed
@EtienneLescot
EtienneLescot deleted the fix/hud-bar-stays-put branch October 13, 2026 08:04
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.

HUD: the bar drifts down when a popover opens near the top of the screen

1 participant