Windows: let the notch hide until the cursor reaches its edge - #239
1boooook2-maker wants to merge 2 commits into
Conversation
Settings' Show choice becomes three: Always show, Auto-hide, Hide. Auto-hide keeps the pill off the screen until the pointer reaches the edge it is pinned to, then slides it back out, the way the taskbar does. Hide stays what it was — the notch off altogether, tray icon only. The pointer watchdog already samples the system cursor every 50 ms and already holds the window's corner and the pill's own rectangle, so the reveal costs no second poll and no new thread. Three things this gets right rather than the obvious way: - The strip that summons it is the pinned edge only, and only along the pill's own extent. A band down the whole edge would pop the notch out every time somebody reached for a scrollbar. - It waits 900 ms before sliding away, three times the card's own grace period. Losing the pill the moment the pointer slips off it, while reading the card, is what makes an auto-hiding strip tiring. - Auto-hide is not "off", so it does not hold the tray icon on the way Hide does: the notch is still reachable at its edge. Before the page has reported a rectangle — an auto-hidden notch that has never rendered — the whole window edge answers instead, so it cannot become unsummonable. Four tests cover the strip: beside the pill only, at the edge only, per edge, and the fallback. `cargo test` on `windows/`: 92 passed, 0 failed.
e3cfccc to
dd917cd
Compare
The reveal strip is the notch's own edge, on the notch's own screen. That is the right rule while you know where it is — and no help at all when you do not. With three monitors there is no sweeping every edge of every screen to find it. So the tray menu offers it: one item, the notch comes out for five seconds. The Mac has the same idea as `peek` (`PeekDuration`, default 5s), and its reasoning carries over — under a second or two the notch is gone before a glance lands on it, much past ten and it stops reading as an offer and becomes a thing parked on the edge to be waited out. A menu item rather than a click on the icon: the left click already opens the menu, so a double click would open it on the way past, and taking the left click for a peek would spend the gesture that now shows the readings. Two details that matter: - The watchdog holds the notch open for the length of the offer, then hands it back to the ordinary hover fold. Without that the fold would take it away within the second, because during a peek the pointer is almost never on it. Move onto it meanwhile and the normal grace period takes over, so a peek that turns into a read does not snatch itself away. - The item only appears while the notch hides itself. Always-show has nothing to offer, and Hide means the notch is off rather than shy — an item that undid that switch from the tray would be a surprise. It comes and goes with the setting, so the menu's dedupe key carries it; keyed on the readings alone it kept the stale menu. `cargo test` on `windows/`: 93 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YRKFEg1ZdgYDxfhv3KqsjC
|
Thanks @1boooook2-maker — auto-hide is a nice idea, and it's off by default with a backward-compatible config, which is right. A few things before it can go in, and main has moved (#244 and #246 just landed), so it needs a rebase:
When rebasing: keep #244's |
|
Tried this build on Windows 11 (the PR head as written, on its 1.13.0 base). The 900 ms grace period is the right call — losing the pill while reading the card would have made it unusable — and limiting the reveal to the pill's own extent rather than the whole edge is the detail most auto-hides get wrong. Two things I didn't see in the list above: 1. Auto-hide plus the tray icon off leaves nothing on screen. 2. On the two collisions with our merged PRs, since it is our code:
Separately, and so nobody writes the same watchdog twice: I'm looking at porting the Mac's fold (the visible resting pill) as its own change. It is a different behaviour from hiding, not a replacement for this. |
|
Closing this one, and I want to be clear it's not because it was the weaker patch — #288 has now landed and covers the same ground. For what it's worth, when I compared the two auto-hide PRs directly, yours was the better of them: the reveal strip computed per edge on the Rust side, the tray peek, off by default, and four real unit tests. #283's only advantage over it was merging cleanly. Both lost to #288 for a different reason — it puts the behaviour as a third mode on the existing Show row rather than adding a second control beside it, which is the shape the Mac has, and it mirrors the Mac's @RawJat's note on your build was right too — the 900 ms grace period was the correct call, and #288 ended up at the same place. Thanks @1boooook2-maker. If you want to pick up the tray peek separately, that part has no equivalent in what landed and I'd take it. |
Settings' Show choice becomes three: Always show, Auto-hide, Hide.
Auto-hide keeps the pill off the screen until the pointer reaches the edge it is
pinned to, then slides it back out — the way the taskbar does. Hide stays exactly
what it was: the notch off altogether, tray icon only.
The pointer watchdog already samples the system cursor every 50 ms and already
holds the window's corner and the pill's own rectangle, so the reveal costs no
second poll and no new thread.
Three choices worth stating
own extent. A band down the whole screen edge would pop the notch out every
time somebody reached for a scrollbar. Move the pill to another edge and the
strip moves with it.
period. Losing the pill the moment the pointer slips off it, while reading the
card, is what makes an auto-hiding strip tiring to live with.
does — the notch is still reachable at its edge.
Before the page has reported a rectangle — an auto-hidden notch that has never
rendered — the whole window edge answers instead, so it cannot end up
unsummonable.
Update: a way in from the tray
The reveal strip is the notch's own edge on the notch's own screen — the right
rule while you know where it is, and no help at all when you do not. With three
monitors there is no sweeping every edge of every screen to find it.
So the tray menu offers it: one item, the notch comes out for five seconds, the
same idea (and the same default) as the Mac's
peek. A menu item rather than aclick on the icon — the left click already opens the menu, and taking it for a
peek would spend the gesture that now shows the readings.
The watchdog holds the notch open for the length of the offer and then hands it
back to the hover fold; move onto it meanwhile and the normal grace period takes
over, so a peek that turns into a read does not snatch itself away. The item only
appears while the notch hides itself, and the menu's dedupe key carries that flag
— keyed on the readings alone it kept the stale menu.
Note on scope
The Mac app has
peek, which offers the notch for five seconds when a sessionwants attention; it has no auto-hide. So this is a Windows-only setting rather
than a port, and it is off by default — nobody's notch changes behaviour until
they pick it. If you would rather the Windows port not grow a setting the Mac
does not have, say so and I will close it; no hard feelings.
Verification
Right edge, five providers: hidden at startup with the cursor away
(
autohide: hidden again), revealed on touching the right screen edge level withthe pill (
autohide: revealed at the edge), hover card opening normally once out.Four unit tests cover the strip — beside the pill only, at the edge only, per
edge, and the never-rendered fallback.
cargo testonwindows/: 92 passed,0 failed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HjE8VcGJhSppSbwukdiDKv