Skip to content

fix(hidden-bar): pause rehide for native popovers - #978

Merged
BarutSRB merged 1 commit into
OmniNull:mainfrom
hezhizhen:codex/fix-hidden-bar-native-panels
Oct 24, 2026
Merged

BarutSRB merged 1 commit into
OmniNull:mainfrom
hezhizhen:codex/fix-hidden-bar-native-panels

Conversation

@hezhizhen

@hezhizhen hezhizhen commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Hidden Bar can re-conceal an item while its native popover is still open. AppKit popovers can use the status-window level rather than the popup-menu levels that the rehide guard recognized.

Follow-up to the remaining panel-dismissal problem reported in #976; relates to #944.

Result

Recognize status-level windows belonging to the revealed apps when they extend outside the displays' native menu-bar strips. Native popovers then use the existing menu countdown and watchdog rules. Status-item windows, ordinary application windows, and windows from other processes do not hold the countdown.

The strips are captured on the main actor using each display's current menu-bar reservation, status-bar thickness, and notch inset; the window query remains off the main actor.

Verification

  • make verify: passed.
  • Related Hidden Bar, menu-bar hold, and panel dismissal tests: 206 passed serially and 206 passed in parallel.
  • Full serial swift test: 6718 tests, 26 skipped, 0 failures.
  • Regression tests cover titled and untitled native panels, status-item exclusion, process/layer checks, notched and offset display geometry, and resuming the countdown after the panel closes.
  • Negative control: removing the new panel recognition caused five assertion failures, including re-concealment at 5.25 seconds while the test panel remained open. Restored the production code before the passing checks.
  • Live controlled AppKit NSPopover check on both physical displays: the native window used level 25. With a five-second countdown, the baseline re-concealed its anchor at about 5.25 seconds while the popover was open. The patched guard retained the anchor through seven seconds; after the probe closed the popover at eight seconds, it re-concealed at about 13.5 seconds.

Vorssaint itself was not run on this machine. The live probe checks native window classification and rehide gating, rather than the third-party app's complete activation and dismissal flow.

Summary by CodeRabbit

  • Bug Fixes
    • The menu bar now stays revealed while a native panel is open, including on notched or offset displays.
    • Automatic hiding waits until the panel closes before concealing the menu bar again, preventing it from disappearing while you interact with the panel.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d29d6638-7a00-4fc9-b7a0-71edb4e00f7a
Commits

Reviewing files that changed from the base of the PR and between 15d6bb1 and d294032.

Files selected for processing: 4
  • Sources/OmniWM/UI/HiddenBar/HiddenBarMenuGuard.swift
  • Sources/OmniWM/UI/HiddenBar/MenuBarItemService.swift
  • Tests/OmniWMTests/HiddenBarLifecyclePolicyTests.swift
  • Tests/OmniWMTests/HiddenBarMenuGuardTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The menu guard now uses window bounds and menu-bar frames to recognize qualifying native status-level panels. The service supplies frames for each screen. Tests cover panel detection and reconcealment after the panel closes.

Changes: Native Panel Detection

Layer / File(s) Summary
Window bounds and menu detection
Sources/OmniWM/UI/HiddenBar/HiddenBarMenuGuard.swift, Tests/OmniWMTests/HiddenBarMenuGuardTests.swift
The guard checks owned status-level windows outside supplied menu-bar frames, while retaining popup-level detection. Tests cover owner and layer mismatches, panel titles, and displays with differing menu-bar geometry.
Screen frames and reconcealment
Sources/OmniWM/UI/HiddenBar/MenuBarItemService.swift, Tests/OmniWMTests/HiddenBarLifecyclePolicyTests.swift
The service computes a menu-bar frame for each screen and passes the frames to the guard. A lifecycle test checks that the app remains revealed while a simulated panel is open and is concealed after it closes.

Priority: Normal

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

Change: Bug fix

Possibly related PRs

  • OmniNull/OmniWM#976: Covers a native app panel closing when Hidden Bar re-hides its item, the behavior addressed by this change.

Suggested reviewers: barutsrb, dappermint

Merge Risk: Low · up to d2940

In apps that keep a separate status-level window open, Hidden Bar may remain revealed for up to a minute after the popover closes. This bounded edge case does not appear to block merging.

Pre-merge checks: Passed 4 · Failed 1

Failed 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: rehide is paused for native popovers in the hidden-bar feature. It follows the conventional commit format and is short and specific. The changeset adds status-level wi…
Description check Passed The description follows the template. It has Problem, Result, and Verification sections. The Problem section states the bug and links related issues (#976, #944). The Result section explains user-visi…
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.
Full details: Title check

Explanation

The title names the main change: rehide is paused for native popovers in the hidden-bar feature. It follows the conventional commit format and is short and specific. The changeset adds status-level window recognition to HiddenBarMenuGuard and MenuBarItemService, so the title matches the primary change.

Full details: Description check

Explanation

The description follows the template. It has Problem, Result, and Verification sections. The Problem section states the bug and links related issues (#976, #944). The Result section explains user-visible behavior: status-level windows from revealed apps outside the menu-bar strips hold the countdown, while status items, ordinary windows, and other processes do not. The Verification section lists the commands run, test counts, a negative control, and a live AppKit probe, and it notes that Vorssaint was not run. The template's optional screenshot section is not used, which is acceptable because it is optional. The description covers the required information.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • 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.

@BarutSRB BarutSRB left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a really nice follow-up to the panel that kept closing in #976. The virtual-clock tests and the live NSPopover check make it easy to trust.

The added status-level check counts only windows owned by revealed apps, with nonempty bounds that are not wholly contained in any menu-bar strip. The existing 60 s watchdog still bounds reconcealment. OmniWM’s own bars and popouts cannot trigger this check through the production owner filter, including when its bar is full width.

A few optional things, only if you touch it again:

  • Defaults that switch the check off. WindowInfo.bounds and menuBarFrames have defaults that turn the new check off. Production always passes both, so making them required, and updating the old call sites, would keep a caller from skipping it by accident. Right now testStatusAndNormalLayersIgnored stays green only through those defaults. Reshaping it to the real rule, that a status-level window with empty bounds or inside a strip is ignored, would make it say what it checks.
  • Strip geometry. The tests don't reach the strip calculation in MenuBarItemService.isMenuOpen (thickness, safe-area top, visible-frame gap, then toWindowServer), because they pass hand-written rects. A small pure helper with a notched case and an offset case would cover the geometry the description mentions.
  • Retain cycle. In the lifecycle test, the sleeper closure captures hiddenBar strongly through reconcealment, so the controller isn't freed after cleanup(). [weak hiddenBar] fixes it.

None of these needs to hold this up. Approving.

@BarutSRB
BarutSRB merged commit eb71ee2 into OmniNull:main Oct 24, 2026
5 checks passed
BarutSRB added a commit that referenced this pull request Oct 24, 2026
Bring the style branch up to date with main. Hidden Bar now keeps a
revealed item while its app shows a native popover at the status window
level outside the menu bar, so panels such as an app's popover no longer
close when the rehide countdown runs out. The countdown resumes once the
panel closes, and the existing watchdog still bounds it (#978).
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.

2 participants