Skip to content

feat(reveal): show hidden icons by scroll, empty click or shake - #493

Merged
tieubao merged 3 commits into
developfrom
feat/reveal-without-aiming
Nov 15, 2026
Merged

tieubao merged 3 commits into
developfrom
feat/reveal-without-aiming

Conversation

@tieubao

@tieubao tieubao commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

Reveal without aiming (F3): three opt-in ways to show the hidden icons without hitting the 16-point arrow.

  • Scroll down on the menu bar of any screen shows them; scroll up hides them.
  • Click empty space in the menu bar shows them (direct build; needs Accessibility to tell empty space from an icon).
  • Shake the pointer (three reversals inside 0.6 s, each at least 12 pt, inside the menu bar strip) shows them.
  • A click anywhere off the menu bar hides what a gesture revealed, through the existing auto-collapse path (it waits while Settings or a popup is open).

Settings, General: the hover row moves into a group "Also show hidden icons when you" with the three new switches, captions and the footnote from the Reveal-Settings board.

Why

The arrow is hard to hit, and hover only helps when the pointer already rests on the bar. All three gestures work where the pointer already is, with global mouse and scroll monitors only (the kind hover installs): no key monitor, no new permission or entitlement.

Decisions

  • All three keys default off (lead decision), overriding the board's "two defaults on" note. With defaults, 1.13 behaves like 1.12.
  • Pref keys: revealOnScrollEnabled, revealOnEmptyClickEnabled, revealOnShakeEnabled. All three are in AppStoreSettingsImport.importableKeys and the whitelist test.
  • The click row is direct-build only: the sandboxed App Store build cannot use Accessibility, so there is no way to tell empty space from an icon. Scroll and shake need no hit test and show in both builds. In the direct build without the Accessibility permission, a click does nothing.
  • Hit test is one AXUIElementCopyElementAtPosition read at the pointer, off the main thread, only once a gesture is recognised. HitClassifier maps it: the menu bar role means empty; a menu bar item owned by the front app is a menu title; any other owner is an icon. Anything else is unknown and never counts as empty. I could not run this against a live menu bar (workers do not launch the app), so the role mapping is the one place a live pass may need tuning.
  • A scroll over another app's icon is left to that app (Reveal-Edge). Where Accessibility is not available the scroll still counts.
  • Scroll up hides whenever the bar is expanded. A click off the menu bar hides only what a gesture revealed, so the arrow's own behaviour is unchanged.
  • The mouse-down monitor lives while the click pref is on, or while a gesture's icons are out (so the off-bar hide works without the click pref); with every pref off no monitor exists.
  • Edge states: bar already expanded (no-op), Hidden Bar's own menu open (no-op), full-screen app (no menu bar strip, so scroll and shake stay quiet), multiple displays (any screen's strip counts), notch (a click in the camera gap is ignored).
  • The 720 pt cap on the General tab in test_selectingATab_titlesTheWindow is raised to 780: the fullest window (direct, macOS 27) now measures 772. F1 and F4 also add General rows, so General will outgrow any fixed cap; the lead may want a scrolling pane.
  • Left out: the first-use tip popover shown on Reveal-Light/Dark and the NEW badges on Reveal-Settings. Neither is in the goal's Done list and a badge ages badly.
  • Debug: reveal-sim scroll|scroll-up|click|shake runs the same ingest calls a real event does, with the Accessibility read replaced by "empty space"; prefs still gate it. dump-state gains revealTriggerCounts and revealedByGesture.
  • Small refactor in StatusBarController: the deferral checks of the auto-collapse timer (Settings open, engine, popup guard) moved into one property so the off-bar hide shares them.

Tests

bash scripts/test.sh --dd ~/.cache/hidden-bar/dd-reveal: exit 0.

Scheme Passed Failed
Hidden Bar (direct) 361 0
Hidden Bar App Store 261 0

New: RevealGesturesTests and RevealControllerTests (HiddenBarTests, 44 cases, both schemes), RevealSettingsTests (HiddenTests, direct). Updated: SettingsWindowTests (legacy keys, App Store hidden row), AppStoreMigrationTests (whitelist).

Negative control

Committed first. Then:

  1. Production files reverted to origin/develop and hidden/Features/Reveal/ moved aside: bash scripts/test.sh --scheme direct --dd ~/.cache/hidden-bar/dd-reveal exit 1, BUILD FAILED (the new test files cannot compile without the production code). Restored.
  2. Reveal rules broken in place (click and scroll always allowed, one reversal shakes, momentum counted, full-screen band kept): bash scripts/test.sh --scheme appstore --dd ... exit 1, 9 failed. Failing: test_fullScreen_hasNoBand, test_momentumEvents_areIgnored, test_policy_showRules, test_shake_cooldownThenAgain, test_shake_firesOnThirdReversal, test_slowShake_doesNotFire, test_clickOnItemOrTitleOrUnknown_isIgnored, test_clickWithoutAccessibility_doesNothing, test_scrollOverIcon_isLeftToTheIcon. Restored with git checkout; the full suite is green again.

Snapshots (offscreen, -settingsSnapshotDir)

Read direct-general-light.png, direct-general-dark.png, appstore-general-light.png, appstore-general-dark.png against Reveal-Settings: group title, row order, captions and footnote match. The direct tab shows the click row; the App Store tab does not. The other panes and status states were rendered too and are unchanged.

Boards matched: Reveal-Settings (copy and layout), Reveal-Edge (edge states), Reveal-Entry (the three triggers).

Three opt-in triggers (off by default), each its own pref, grouped with the
hover row on Settings General. Global mouse and scroll monitors only, no new
permission. Pure gesture logic in RevealGestures, monitors in RevealController,
Accessibility hit test in RevealHitTester; reveal-sim debug hook.
@tieubao
tieubao force-pushed the feat/reveal-without-aiming branch from a3c4fd0 to 6291550 Compare November 15, 2026 19:06
@tieubao
tieubao merged commit dfa9148 into develop Nov 15, 2026
3 checks passed
@tieubao
tieubao deleted the feat/reveal-without-aiming branch November 16, 2026 01:33
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