Repository navigation
fix(native): do not read sections from an arrow macOS has not placed - #591
Merged
Merged
Conversation
At launch on a crowded macOS 27.2 bar, AppKit reports the arrow's window at the display's left edge (logged as "arrow at x=16.0"). Every icon then reads as right of the arrow: the collapse hides nothing and shows "Nothing to hide", the read is written into section memory and the pinned table, and while the always-hidden section stays hidden the cached read stands in for every later collapse of the session. The native engine now treats an arrow at its display's left edge as not placed: it reads nothing, holds nothing and remembers nothing (a silent .unavailable), and reports the arrangement unknown so the launch collapse waits for placement as the legacy engine already does.
The log proves only midX 16; the arrow is variableLength, so its width is not known to be 32. Tests cover widths 20, 24 and 32.
Real-click gate on macOS 27.2.1 (hb-macos2721) for the branch build at 6938b09. Checks 1 to 5 pass on screen and in the app stderr; check 6 (the not-placed line at launch) did not occur in five launches, so the retry path was not exercised. Notes in results.md.
Check 5 is reported in two halves, the expectation label is fixed, the one-icon limit is stated, and the released 1.13.4 control shows Sound stays visible there too.
1 of 2 tasks
tieubao
added a commit
that referenced
this pull request
Nov 24, 2026
Header and open section now say 1.13.4 (build 25). Items that shipped in 1.13.1 to 1.13.4 move to Shipped with their PRs. The 3 merges after the 1.13.4 tag (#588, #590, #591) are listed as merged, not yet released. Closed issues (#456, #386, #361, #469, #327, #107) and the open reports are reconciled against gh.
1 of 2 tasks
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 and why
#584 logs show
NativeVisibility: arrow at x=16.0at every launch: AppKit reported the arrow's window at the display's left edge, before macOS placed it on a crowded 27.2.1 bar. The native engine had no placement check:NativeVisibilityEnginedid not overrideisArrangementKnown, so it inheritedtrue(MenuBarEngine.swift:73). The launch collapse (StatusBarController.swift:280) did not wait.withLayoutread sections from that frame. Every icon was then right of the arrow (MenuBarLayout.swift:435): nothing hid and "Nothing to hide" showed.withLayoutthen reuses the cached read (line 443), so that one bad read applied to every collapse of the session. This matches the logs: noarrow at x=lines after launch.Fix: an arrow frame within its own width of its display's left edge counts as not placed. The log proves only midX 16, and the arrow is
variableLength, so the check does not assume a width.withLayoutlogs one line and returns no layout. The result is a silent.unavailable, with no hold, no memory or pin write, and no notice.isArrangementKnownuses the same check, so the launch collapse retries for up to 4 s, as the legacy engine already does. Not added: an Accessibility fallback for our own item. The inventory skips our own process, so this would need a new read path that I cannot check here.Refs #584. This is not "Fixes": the code cannot show whether the reporter's later clicks used the cached launch read (fixed here) or got a fresh read with an arrow still unplaced. In that second case this PR only stops the false "Nothing to hide" notice. One log line decides it: the
NativeVisibility: arrow at x=line after a click, once launch is over. If there is none, the cached read was the cause. If it says x=16 again, the arrow is never placed.How it was tested
UnplacedArrowTests(HiddenBarTests/MenuBarEngineTests.swift). Negative control against develop's engine: 4 of 5 behaviour tests fail. These are: no read or notice on an unplaced arrow, the always-hidden session stuck on the launch read, a pin lost after a bad then good read, and the launch wait. The bad-then-good case without the always-hidden section already passes on develop.scripts/test.sh(both schemes) in the mac-ui VM: Hidden Bar 832 passed, 0 failed; Hidden Bar App Store 526 passed, 0 failed.UI proof
No new text or view. The bar now stays expanded with no notice, instead of collapsing with nothing hidden and showing "Nothing to hide".