Repository navigation
feat(palette): find a hidden icon by typing, open its menu and re-hide - #505
Merged
Merged
Conversation
Opt-in type-to-find palette for the direct build on macOS 27. A global shortcut (unset by default) opens a panel under the arrow listing hidden and always-hidden apps from the catalog, filtered by name or bundle id with prefix matches first. Return allows that one app, presses its icon through Accessibility so its own menu opens, and puts the restriction back when the menu closes, as the clock session does. Command-Return keeps the app shown, Option-Return always hides it. Edge states: nothing hidden, no match, Accessibility off, a macOS item, engine unavailable, an app that quit, an icon with no press. Ranking, the state rules, key mapping, placement and the reveal session are pure types with tests in HiddenBarTests; the panel, settings row and snapshots are tested in HiddenTests. Pref key findHiddenIconShortcut (Data, unset).
A menu left open for 10 minutes or a panel that kept focus for 15 seconds ended the session without re-hiding the allowed app, so it stayed visible in a collapsed bar with no bound. Every ending now goes through the same restore path: re-hide the one app if Hidden Bar lifted it, leave a bar the user changed.
tieubao
force-pushed
the
feat/find-hidden-icon
branch
from
November 15, 2026 20:16
ee1ff5a to
69b86d3
Compare
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
Type-to-find palette (F1), direct build on macOS 27 only, opt-in.
ShortcutRecorderRow, preffindHiddenIconShortcut(Data, unset = feature off). The arrow's right-click menu gets "Find a Hidden Icon..." only while a shortcut is set.MenuBarItemCatalog(icon, name, bundle id, section), filters by name or bundle id (case and accents ignored; name start, word start, inside the name, letters in order, bundle id), arrow keys move the selection.PinnedSectionEdits.set). Escape or losing key closes.Why
Hidden icons are one click away only if you remember the arrow, then find the icon. Typing a few letters is faster and works from any app.
How Return works (decision: reuse the clock session pattern)
PaletteRevealSession(pure,HiddenBarTests) mirrorsNotificationCenterSession: session id, polling, restore only if Hidden Bar changed the restriction and the user has not touched the bar since (userChangedBar()is forwarded from the engine).MenuBarEnginegetsallowTemporarily(bundle)/endTemporaryAllow(): one extra bundle in the allow list through the existingactivate(new restriction lands before the old one drops, so no flash), put back with the previous list. Any other activation (expand, collapse, section edit) clears the pending restore, so the engine's newer state always wins. The bar does not expand, so an always-hidden app opens too. Auto-collapse waits while a session is active.Menu detection: a window of the app at layer >= 101 (menus and popovers) via the window list, no Screen Recording. Apps that open a panel (Dropbox) get no menu: after 0.8 s the session follows the app's focus, 15 s cap.
Decisions (no questions asked, per plan)
SettingsForm.rowhas no tag).openingsnapshot is the palette during the press instead.palette-activate open|keep|hide,palette-close;palette-open [query].dump-stategainspaletteandpaletteSession.test_selectingATab_titlesTheWindowheight bound 780 -> 840: the row with its caption adds 61 pt to General. SG-06 makes that pane scroll and will reset this bound.PaletteController(ordersPanelFront: false)so unit tests never put a window on screen.Not verified live
No live run (GUI safety). The AX press, the menu-open window-list probe and the lift timing are written from the clock code and the macOS 27 notes; the wave verifier should exercise
palette-open,palette-query,palette-select,palette-activate openon a real hidden app.Tests
scripts/test.sh --scheme direct --no-parallel-testing): 507 passed, 0 failed.scripts/test.sh: App Store 347 passed, 0 failed. Direct 507 passed with 8 "test runner exited with code 0 before establishing connection" errors in parallel mode (repeated on re-run; no test failed, serial run is clean).HiddenBarTestsPaletteRanking, PaletteModel, PaletteKeyAction, PalettePlacement, PaletteRevealSession, plusPaletteAllowTestsin MenuBarEngineTests;HiddenTestsPaletteSettings, PalettePanel (includes the snapshot file list).findHiddenIconShortcutinlegacyOtherKeys, in the App Store hidden-rows list, inimportableKeysandappKeys.Negative control
Committed first, then one production mutation at a time,
scripts/test.sh --scheme direct --no-parallel-testing, each exit 1 with assertion failures (no build failures), file restored bygit checkout, tree clean at the end.Three unrelated tests (
test_setters_roundTripAndPostPrefsChanged,test_menuBarApps_offShowsNoList,test_menuBarApps_popupsAndResetWriteThePinnedTable) also failed in two of the mutation runs and passed in every other run; they shareUserDefaults.standardand look flaky, not caused by this change.Snapshots vs boards
-settingsSnapshotDiroutput, fixture apps, drawn over the boards' wallpaper gradient. Read against Palette-Light, Palette-Dark, Palette-Edge, Palette-Settings: same width, row height, type sizes, highlight bolding (Pa, Pa, p...a), key hints (wrap to a second line at 380 pt, as the board's flex-wrap does), edge copy.direct-palette-<state>-<light|dark>.pngfor: results (board Light and Dark, query "pa"), all, opening (Open board), nomatch, nothinghidden, accessibilityoff, macositem (the four Edge cells), appquit, cannotopen, enginedown (not on the boards). Plusdirect-palette-settings-<light|dark>.png(General tab with the shortcut set) and the livedirect-general-<light|dark>.png.MANUAL row draft (for SG-07)
Settings table row:
General (direct build, macOS 27) | Find a hidden icon: shortcut that opens a search under the arrow | findHiddenIconShortcutSection "Find a hidden icon": Record a shortcut in Settings, General, under Keyboard shortcut (unset by default, so the feature is off; the arrow's right-click menu then also offers Find a Hidden Icon). The shortcut opens a small panel under the arrow on the display with the pointer. It lists hidden and always-hidden apps that are running. Type part of a name or bundle id; matches at the start of the name come first. Return opens that app's own menu without expanding the bar and hides it again when the menu closes (an app that opens a panel instead hides again when it loses focus, at most 15 seconds). Command-Return moves the app to the visible section, Option-Return to the always-hidden section, Escape or a click elsewhere closes. It uses the Accessibility permission hiding already needs; it never reads the screen. Focus, Siri and Now Playing cannot be opened from here (macOS keeps them out of Accessibility while icons are hidden). Debug builds accept
palette-open [query],palette-query <text>,palette-select <bundle id>,palette-activate open|keep|hide,palette-close.Rebase notes for the later workers
New Swift files live in group
Palette(hidden/Features/Palette). Hook cases sit in one block inStatusBarController.debugPaletteand onecaseline; the snapshot call is one#if HIDDENBAR_NATIVE_VISIBILITYblock at the end ofSettingsSnapshot.render;SettingsSnapshot.shootlostprivateso the palette snapshot can reuse it.