Skip to content

Decide left/right only on a settled read; 1.4.1 (#7) - #12

Merged
roypadina merged 1 commit into
mainfrom
fix/settled-read
Oct 30, 2026
Merged

roypadina merged 1 commit into
mainfrom
fix/settled-read

Conversation

@roypadina

Copy link
Copy Markdown
Owner

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):

  • 1.4.0 + a width-flipping probe right of a probe right of the icon: probe, PullPing and Ghostex (all right of the icon) hidden/shown every 10 s.
  • 1.4.1: constant 0.4 s flicker → no side changes (list unchanged); one flip every 3 s → no wrong hides; a new item left of the icon still hides within ~1 s.
  • Probe matrix for the /Applications rule: top-level and nested-in-/Applications shown when allowed, ~/Library/Application Support hidden even when allowed.

🤖 Generated with Claude Code

https://claude.ai/code/session_014uzkEWCUtd8FePAkNCZdpS

…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
@roypadina
roypadina merged commit c02d84d into main Oct 30, 2026
1 check passed
@roypadina
roypadina deleted the fix/settled-read branch October 30, 2026 21:35
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.

1 participant