Repository navigation
fix(native): keep always-hidden apps when the separator is misread - #599
Merged
Merged
Conversation
The always-hidden boundary came from the separator item's frame with no check. A frame with nothing left of it read every always-hidden app as hidden, and with pinned sections that counted as a drag. The frame now counts only when the item is in the bar, on a display, placed like the arrow and on the hidden side of it; otherwise apps last read always hidden keep that section, and the log says why. Refs #593
The separator-in-bar input read NSStatusItem.isVisible, which the engine tests' fake items do not report as visible, so a fresh read distrusted a good frame and five existing tests failed. The engine now records when its own setSeparatorsVisible took the item out, which is the state it needs, and logs the item's real isVisible and length beside it. A separator on another display than the arrow is not a boundary. Every read with the section on logs the separator frame, the arrow frame and the verdict. Refs #593
Skips the distrust handling so the engine behaves as develop's; the new tests must fail.
This reverts commit 8f5c029.
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
Refs #593 (not "Fixes": the cause of the wrong separator frame is not proven, see below).
With pinned sections on and the always-hidden section on,
withLayouttook the always-hidden boundary from the separator item's frame with no check, as #591 did for the arrow. A frame with nothing left of it makes every always-hidden app read as hidden (MenuBarLayoutResolver.section), andPinnedSectionResolver.resolvecounts that as a drag, so the table is rewritten from Always hidden to Hidden. A later good read counts as a drag back. The reporter's log matches: arrow placed,always hidden []with every app underhidden, nopinned sections changedline.Proven by code, the log signature and the tests: a bad frame produces the flip. Not proven: why AppKit reports a bad frame. The log never printed it, and the wrong state lasted four reads over two minutes, so it is not a one-off transient. Two engine paths do read the bar with the separator out of it, where its frame means nothing: a collapse during a clock lift (the restriction is released, and
collapseskipssetSeparatorsVisible(true)while the section is hidden), and a collapse whose activation fails (the restriction is released, the state returns to expanded, the separator stays out). Whether the reporter hit either is unknown. A plausible but wrong frame would still pass the check, which is why every read now logs the frame.Change:
setSeparatorsVisiblesets it); the realisVisibleandlengthare logged beside it.arrow at x=line with the verdict (trustedorNOT trusted: <reason>), the separator frame, the item state, the arrow frame and whether the read was incomplete.Files:
NativeVisibilityEngine.swift,MenuBarLayout.swift,MenuBarEngineTests.swift, an implementation note anddocs/verification/always-hidden-boundary/results.md. No file overlap with the unmergedfix/unplaced-arrow-frame(it differs from develop only underdocs/verification/) or open PR #594.How it was tested
CI on GitHub's runners, both schemes (run links and failing test names in
results.md):NSStatusItem.isVisible, which the tests' fake items do not report as visible, so a fresh read distrusted a good frame. Fixed at the cause: the engine now records when it takes the separator out; the getter is only logged.AlwaysHiddenBoundaryTests, including a separator out of the bar, a drag during a misread, a first launch with nothing remembered, and a separator on another display.AlwaysHiddenBoundaryTests. Direct 850 passed, 0 failed; App Store 540 passed, 0 failed. Later commits are docs only.VM gate (guest on macOS 27.2.1, head 7432add)
Evidence:
gate-pr599-2721-2026-11-25on the maintainer test host; two frames and the full record are indocs/verification/always-hidden-boundary/results.md. Verdict: guarded, no regression. Not fixed. Release builds have no Debug hooks, so a misread could not be forced.trustedlines and 0NOT trustedlines on the guard build, all from launch reads.arrow at x=line (expand keeps the restriction), and Option-click could not be delivered, so the guard ran only at launch.trusted, with nopinned sections changedline. iStat is the app macOS hides; the control had it at a different start value. Not a result.UI proof
No new text or view. Always-hidden apps stay hidden when the separator is misread, instead of showing on the next click.