Repository navigation
Windows: a click outside the open island folds it - #919
saivaibhavv wants to merge 1 commit into
Conversation
The island never takes keyboard focus, so there is no "lost focus" signal. The cursor thread already reads the left button for drag and drop; it now also tells the page when a press began outside the island and when it ended outside too, and the island folds as Esc does. - Folds like Esc: a waiting permission or question is folded, not answered, and a pinned island stays open. - A press that began outside and ended inside (a file dragged onto the island) never folds. Clicks made with a still cursor count. - An island a hook opened by itself ignores a click for one second, so the click that was meant for the window behind it does not close the alert. - Settings → General → "Fold when I click outside", on by default, Windows only (Linux cannot see clicks in other windows). Translated in all twelve languages. - No extra CPU while the island is hidden: the thread is still parked then. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Hi Louis, thanks for Coucou. I've been using the Windows build, and these two PRs are things I wanted on my own PC: #919 folds the open island when you click outside it, and #920 narrows the compact bar (there's no notch on a PC) and reworks the optional clock from #788 to follow the Windows time format. Both merge cleanly into The Windows and Linux app gets a steady flow of PRs, some overlapping, such as #31 with this one. I'd be glad to help look after that side: reviewing and triaging Windows and Linux PRs, keeping Windows CI green, reproducing bugs on Windows 11, and keeping the README and translations in step. If that would help you, triage or write access would let me do it directly. If you'd rather I keep contributing through PRs, that works for me too. |
|
Tested on Windows 11 (two monitors: 3840x2160 at 150 % and 1440x2560 portrait at 100 %). I built this branch (937ee27) as a debug build:
Works well, thanks! One small thing, not from this PR: once pinned, it wasn't obvious how to unpin. I found that |
What
On Windows, a left click anywhere outside the open island folds it to the compact bar, as
Escdoes. A switch in Settings → General → Fold when I click outside turns it off (on by default).Related: #31 is a smaller take on the same idea (the cursor thread reads the button). This one adds a setting and the safeguards listed below, so the two overlap in
island.rsandisland.ts; happy to rebase or fold into whichever you prefer.Why
The island never takes keyboard focus, so there is no "lost focus" to listen for. Today the only ways to fold it are
Esc(only when the island has focus), the ⌃ button, or waiting for the auto close timer.How
island.rs: the cursor thread already reads the left button for drag and drop. A smallClickTrackernow turns that into two events,press-outsideandclick-outside, read on every tick before the still-cursor shortcut (most clicks are made without moving the mouse). It is reset on every wake, so a button held while the island was hidden is never a press.island.ts:dismiss()is whatEscdid, and both now call it: a waiting permission or question is folded (not answered, the card is still there when reopened), a pinned island stays open.click-outside.ts: the policy, pure so it is tested without a browser.Cases covered by tests:
alert(view, { auto: true })) is ignored for 1 second, so the click meant for the window behind it does not close the alert.Windows only: Linux cannot see clicks made in other windows, so the row is hidden there (
cursorPoll). No extra CPU while the island is hidden, the thread is still parked then.The label and hint are translated in every language the app has.
Tested
npx tsc --noEmit,npm test(477 pass),cargo test --workspace --locked(527 + 30 pass), on currentmain.npm run tauri dev): a click outside folds the island, a click inside does not, and the switch in Settings turns it off. No visual change, so no screenshot.Not in this PR
Click outside on Linux (X11 and Wayland) is left for a separate change.
🤖 Generated with Claude Code