Repository navigation
fix(native): give up on a collapse macOS never answers - #530
Merged
Merged
Conversation
A collapse in flight ignores every other collapse request, so when macOS never answered the section read or the restriction request the engine stayed busy forever: arrow clicks and auto-collapse were silently dropped and the auto-collapse timer was never re-armed. The engine now gives a collapse 10 s. Past that it logs one NativeVisibility line, lifts any restriction, settles expanded and reports unavailable; a late answer invalidates itself. The controller re-arms auto-collapse on that event. The popup guard was checked too: its 600 s cap already bounds it. Refs #523 #524
tieubao
force-pushed
the
fix/collapse-on-mic
branch
from
November 17, 2026 06:52
567c2c8 to
7acb2fa
Compare
tieubao
marked this pull request as ready for review
November 17, 2026 06:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On macOS 27, a collapse in flight ignores every other collapse request. If macOS never answers the section read or the restriction request, the engine stays busy forever: arrow clicks and auto-collapse are silently dropped, the arrow stays at ">", and nothing re-arms the auto-collapse timer. That matches #523 (stuck after joining a meeting) and #524 part 1 (auto-collapse never fires).
Fix
NativeVisibilityEngine: each collapse gets a 10 s timeout (collapseTimeout). If the engine is still calibrating at that point, it logsNativeVisibility: macOS did not answer the hide request within 10 s; showing the whole menu bar, lifts any restriction, sets the state to expanded and reports.unavailable. A late answer drops itself through the existing generation check, and a late success is invalidated. The timeout does nothing if the collapse already finished or a newer collapse started.StatusBarController: re-arms auto-collapse when the engine reports a timeout (onCollapseTimedOut).AutoCollapsePopupGuard) and left it unchanged. Its 600 s cap already limits how long it can hold auto-collapse.Tests
NativeVisibilityEngineTests: a request macOS never answers, a section read that never returns, auto-collapse running again after a timeout, and a timeout that leaves both a finished collapse and a newer one alone.scripts/test.sh: Hidden Bar 678/0, Hidden Bar App Store 444/0.Not proven
Refs #523 #524
Also in this PR
567c2c8: when the popup guard starts holding auto-collapse, log once which window holds it (owner bundle id or pid, and layer; no window title). It shows whether the 10-minute guard cap is behind a stalled auto-collapse. Suite: Hidden Bar 679/0, App Store 445/0.