Repository navigation
Decide left/right only on a settled read; 1.4.1 (#7) - #12
Merged
Merged
Conversation
…1.4.1 Issue #7 follow-up: when items right of the icon left the bar or resized, the AX walk mixed old and new positions (our frame is fresh, other apps' AX frames trail a re-layout), so apps right of the icon were hidden. settledRead samples our own frame from 0.5 s before the walk to its end and retries on any move; 3 failed tries keep the current list. applyHide also logs, once per process, allowed apps MenuBarAgent won't show while hiding (outside /Applications, or LaunchServices resolves another copy). Adds tests/main.swift (self-check for settledRead and menuBarCanShow). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014uzkEWCUtd8FePAkNCZdpS
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.
Follow-up to #7 (reporter on 1.3.4: apps right of the icon still hidden, iStat Menus never shown).
Cause. When items right of the icon leave the bar (an app macOS won't show while hiding) or change width, our icon moves. The AX walk then mixed layouts: our frame is fresh, other apps' AX frames trail the re-layout, so apps right of the icon read as left and were hidden.
Fix.
settledRead(AX.swift): our own frame is sampled every 20 ms from 0.5 s before the walk to its end; any move → retry (3×, 0.3 s apart), then keep the current list.menuBarCanShow+ a once-per-process log line for allowed apps MenuBarAgent won't show while hiding (outside/Applications, or LaunchServices resolves another copy).tests/main.swift: self-check (each case failed before its fix).Verified live (macOS 27):
list unchanged); one flip every 3 s → no wrong hides; a new item left of the icon still hides within ~1 s./Applicationsrule: top-level and nested-in-/Applicationsshown when allowed,~/Library/Application Supporthidden even when allowed.🤖 Generated with Claude Code
https://claude.ai/code/session_014uzkEWCUtd8FePAkNCZdpS