Skip to content

feat: pinned sections beta (macOS 27) and legacy recovery fixes (#366) - #473

Merged
tieubao merged 8 commits into
developfrom
feat/pinned-sections
Nov 15, 2026
Merged

tieubao merged 8 commits into
developfrom
feat/pinned-sections

Conversation

@tieubao

@tieubao tieubao commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Implements the #366 decision (brief: #472): option B "pinned sections" as a beta on the macOS 27 direct build, plus option C's legacy patches.

macOS 27 direct (beta, on by default; Preferences checkbox "Pinned sections (beta)")

  • A per-app section table decides what is shown. A read only edits it when an app's position changed since the last read and the app did not start meanwhile (a ⌘-drag). Apps that start with no entry are visible. The table starts from the v1.11.2 last-read memory.
  • Settings › Menu Bar Apps (the feat: redesigned Settings window (1.12) #481 tab slot): each app with its icon (NSWorkspace, no Screen Recording), name and a Visible / Hidden / Always hidden popup that applies at once; "Reset all to visible". The "Pinned sections (beta)" switch is in Advanced. Beta keys are in the Settings pref-key test and the feat: import settings and tidy up when switching from the App Store build #474 import whitelist.
  • Always-hidden apps stay hidden on expand (Always hidden icons inside the always hidden section is still visible. #224 on 27); Option-click shows them until the next collapse.
  • Finding: NSWorkspace does not post launches of agent (LSUIElement) apps, which most menu-bar apps are, so 1.11.2's launch handling misses them. Agent starts now come from runningApplications, with the beta on or off (own commit).
  • Beta off: v1.11.2 plus that agent-launch fix.

macOS 26 and earlier (legacy engine, also the App Store build)

Follow-ups (not built): the hidden-items menu (thin A); a per-app ignore-drags lock for apps that recreate their icon without relaunching. Decisions, open questions and per-phase proof: docs/implementation-notes/pinned-sections.md.

Proof Result
bash scripts/test.sh Direct 285, App Store 210, 0 failed (rebased on develop ba9fd78)
Negative controls, one mutant at a time 19 mutants, each fails 1 to 5 tests (relaunch counted as a drag, the brief's literal "differs from table" rule, beta ignored, no re-hide, legacy decouple and Show Everything reverted to af0f151, patches leaking to 27, agent launches gated on the beta again, and more)
Beta off and legacy = af0f151 apart from C and the agent-launch fix all pre-existing engine tests unchanged and green in both schemes
Release warnings clean Release-Direct (signed) and App Store Release builds: same set as develop
Settings snapshots Menu Bar Apps on / off / empty and Advanced, light and dark, offscreen via -settingsSnapshotDir: https://claude.ai/code/artifact/bc66e7cc-98c1-40e1-80c5-fcbaf3378544
On screen, from /Applications (after #475), helper app with a magenta icon, no pointer or key input pixel truth below; installed app's CDHash, login items and prefs unchanged after
Not run legacy on macOS 26 (no 26 Mac here); needed before release

On screen (macOS 27.2, Debug-Direct b0a283d and a helper app, both in /Applications; magenta square = the helper's icon)

Case Collapsed menu bar
Beta on: helper relaunched, its icon then read on the hidden side; pinned visible, so it stays shown on
Beta off: same relaunch and read; it drifts to hidden (v1.11.2) off
Beta on: pinned visible after a quit and relaunch visible
Beta on: list sets it hidden; hidden at once hidden
Beta on: pinned hidden, relaunched, bar expanded (shown with the hidden section) expanded
Beta on: pinned hidden, relaunched, collapsed again: still hidden hidden again

macOS kept the helper's slot right of the arrow across relaunches, so the debug boundary, moved just right of the helper after the relaunch, stands in for macOS re-placing it on the hidden side (same for both beta runs). Pixel counts per step are in docs/implementation-notes/pinned-sections.md.

macOS puts a new or relaunched icon far left, which is the hidden side, so
apps drifted into the hidden section after every restart (#334, #107, #366).
With "Pinned sections (beta)" on (the default on the macOS 27 direct build),
a per-app section table decides what is shown. A read only edits it when an
app's position changed since the last read and the app did not start
meanwhile (a ⌘-drag). Apps that start with no entry are visible. The table
starts from the v1.11.2 last-read memory. Reset all to visible is in
Preferences. With the beta off, sections come from positions as in v1.11.2.
With pinned sections on, Preferences lists every app the table knows, with
its app icon (no screen capture) and a section popup that applies at once.
An app pinned always-hidden stays hidden on an expanded bar, also without
the always-hidden separator (#224 on 27); Option-click shows it until the
next collapse, which reads the bar again so ⌘-drags made meanwhile count.

NSWorkspace does not post launches of agent (LSUIElement) apps, and most
menu-bar apps are agents, so their relaunches were not seen. With the beta
on, agent starts and quits now come from runningApplications.
On macOS 26 and earlier the always-hidden section stayed hidden only while
the stored Option-click state said so, and enabling the section stored
"shown", so its icons appeared on every expand (#224). Every collapse now
hides the section again; Option-click shows it until the next collapse.
"Show Everything" in the arrow's right-click menu expands the bar with the
section shown, to recover icons lost there (#242). Nothing changes on 27.

Also documents the pinned sections beta in MANUAL and CHANGELOG, and the
hidden-items menu as a follow-up in the implementation notes.
The delta from the decision brief: decisions, a finding about agent-app
launches, proof per phase, the hidden-items menu follow-up and open
questions. Force-added past the ignored tooling layer so it is not lost
like SPEC-003.
NSWorkspace does not post launches of apps without a Dock icon, which most
menu-bar apps are, so the 1.11.2 handling for apps that start while the bar
is collapsed (#446) missed them. Agent starts and quits are now reported
whether or not the pinned sections beta is on.
Moves the pinned sections (beta) UI into the redesigned Settings window.
The Menu Bar Apps tab lists each app with its icon, its name and a section
popup in the grouped style, then "Reset all to visible"; with the beta off
it says so and offers Turn On. The "Pinned sections (beta)" switch is in
Advanced. The beta keys join the Settings pref-key test and the App Store
settings import whitelist, and -settingsSnapshotDir draws the tab on, off
and empty from fixed data.
@tieubao
tieubao force-pushed the feat/pinned-sections branch from ced5d9e to b0a283d Compare November 15, 2026 16:10
Run from /Applications on macOS 27.2 with a helper status-item app: a
pinned app stays shown or hidden after a relaunch, measured in screenshot
pixels, and the same relaunch drifts to hidden with the beta off. Crops of
the menu bar for each case sit next to the notes.
@tieubao
tieubao marked this pull request as ready for review November 15, 2026 16:25
@tieubao
tieubao merged commit 6e33618 into develop Nov 15, 2026
1 check passed
@tieubao tieubao mentioned this pull request Nov 15, 2026
@tieubao
tieubao deleted the feat/pinned-sections branch November 15, 2026 18:17
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