Repository navigation
feat(arrivals): ask about new menu bar apps from the arrow - #503
Merged
Merged
Conversation
Settings, Icons: "When an app adds a new icon" with Ask Me, Show It (default, the 1.12 behavior) and Hide It, stored as newAppDefaultSection. Show It and Hide It place a never-seen app through PinnedSectionEdits.set on first sight. Ask Me keeps it visible, queues it under arrivalsPending, dots the arrow and asks once from a popover under the arrow; an answer writes the section. Waiting apps sit first in the Icons list with a NEW tag. Decision logic is the pure ArrivalsInbox. Debug hooks arrivals-inject, arrivals-answer, arrivals-prompt.
Show It now returns no placements, so the engine's resolver places a never-seen app as in 1.12 and pinned entries the catalog never saw (App Store imports) are left alone. The new-app caption describes the selected option.
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
F2 Arrivals inbox (macOS 27, direct build, native engine). Settings, Icons gets a popup "When an app adds a new icon": Ask Me, Show It, Hide It (
newAppDefaultSection, 0 ask / 1 show / 2 hide).PinnedSectionEdits.set, and never ask.arrivalsPending, puts a dot on the arrow, and asks once from a popover under the arrow ("New in your menu bar", Show / Hide, an ellipsis with Always hide). An answer writes the section and clears the entry. Waiting apps sit first in the Icons list with a NEW tag.ArrivalsInbox.arrivals-inject <bundle>,arrivals-answer <bundle>=show|hide|always-hide,arrivals-prompt(opens the prompt as an arrow click does).dump-stategainsarrivalsPending,newAppDefaultSection,arrivalsPromptShown,arrivalsDot.Why
Pinned sections stopped the drift, but a new app still lands wherever macOS puts it. Asking once per app, and remembering the answer, is the opt-in rule: with defaults, 1.13 behaves like 1.12.
Decisions
visiblefor an arrival the table had on the hidden side (macOS puts a new icon far left), so "stays shown" is true. Show It writesvisiblethe same way;PinnedSectionResolver.newAppSectionis untouched.arrivalsPendingstays a plain array of bundle ids.MenuBarEngineFactory's read closure); it is not persisted.alwaysHidden).Not built (board states with no production source)
.noticeand.kept) but nothing raises them: the catalog excludes macOS extras by design, and a known app is simply never asked. Wiring needs system item arrivals from the inventory (Live Activities are unmapped on 27.3).Tests
scripts/test.sh --scheme direct --no-parallel-testingNew:
HiddenBarTests/ArrivalsInboxTests(21, both schemes),HiddenTests/ArrivalsControllerTests(14) andArrivalsPromptTests(6) plus 4 inSettingsWindowTests. Pref key lists updated per the contract:newAppDefaultSectioninlegacyOtherKeys, the App Store hidden-rows list,AppStoreSettingsImport.importableKeysand the test'sappKeys;arrivalsPendingis internal (in neither). One existing test now ignores the new popup when it checks the controls column.With parallel testing on, direct runs end with "test runner exited with code 0 before establishing connection" errors (8 here, 5 on untouched develop on this Mini); serial and the full result above are clean. Re-run on CI if it shows up.
Negative control
Committed first, then one mutation at a time on production code,
scripts/test.sh --scheme direct --no-parallel-testing, each exit 1, file restored withgit checkout:test_askMe_queuesAndKeepsTheAppShown,test_askMe_keepsTheAppShownAndQueuesIttest_aRepublishedArrivalNeverReAsks,test_aRepeatedArrivalDoesNotUndoTheUsersEdit,test_anAnsweredAppIsNotAskedAgainInTheSameRuntest_answer_clearsTheEntryAndReturnsTheSection,test_answer_writesTheSectionAndClearsTheEntry,test_anAppIsAskedAtMostOnce_acrossARestart(+2)test_hideIt_placesHiddenAndAsksNothing,test_hideIt_placesHiddenAndNeverAsks,test_newAppDefaultStorage(+2)test_aQuestionLapsesAfterADay,test_aLapsedQuestionTakesTheSettingsDefaulttest_menuBarApps_newAppPopupWritesItsKeytest_menuBarApps_undecidedAppsSitFirstWithANewTagtestWhitelistCoversEveryPreferenceKeyTheAppDefinestest_removingAnAppFromTheListDropsItsQuestionThe new logic tests also fail on develop:
ArrivalsInbox,NewAppDefaultandUserDefaultsArrivalsPendingdo not exist there.Snapshots (offscreen,
-settingsSnapshotDir, light and dark)Local folder
~/.cache/hidden-bar/snap-arrivals-final/, each asdirect-arrivals-<state>-<light|dark>.png, compared by eye with the boards:entry: menu bar with the dotted arrow (Arrivals-Entry; the dot under the app's icon is not built)prompt: Raycast and Tailscale (Arrivals-Light, Arrivals-Dark)edge-multi-icon: Docker Desktop, 2 icons (Arrivals-Edge)edge-many: 6 new apps, "and 3 more", Hide All / Show All (Arrivals-Edge)edge-known: Slack, Kept (Arrivals-Edge)edge-system: Timer, OK (Arrivals-Edge)edge-not-running: an app that quit before an answer ("Not running now. It stays shown until you choose.")direct-menubarapps-new-<light|dark>.png: Icons with Ask Me and two NEW rows (Arrivals-Settings);direct-menubarapps-off-*shows the popup disabled with Pinned sections offDifferences from the boards: the popover is drawn without the system material (flat fill in the offscreen scene), 360 pt wide for all states, and the NEW row tint is flat accent 10 percent.
Notes for the lead
#ifnative), onestartArrivals()call ininit, a 2 line change in the.togglecase, one term indefersCollapseApartFromPointer, three debug cases, and a separate//MARK: - Arrivalsextension at the end of the file. NativeVisibilityEngine is not touched;MenuBarEngineFactorygains one line in the read closure.Arrivalswas added to the pbxproj by hand (the tool cannot create groups); files registered withpbxproj-add.