Repository navigation
fix(quick-message): Open the pill on hover whatever Chat is doing - #1697
Conversation
omesser
left a comment
There was a problem hiding this comment.
Soft Open
Tip: 3346d3ac
What changed
- Pill ignores Chat: Hover opens the pill whether Chat is open, minimized or closed.
chatting,chat_is_up,setChatOpenandMinimizedChats::hidesare gone. - Latch: A Summon or Send still holds the pill down until the pointer leaves, and closing Chat no longer clears that hold.
- Docs: ADR-0039, the verify guides, the playgrounds and the scenario copy describe the new rule.
What is wrong
- The pill now takes the caret from Chat: An opening pill calls
overlay_request_focus. If the pointer rests on the Character for the hover delay while the user types in Chat, keyboard focus moves to the pill. The old gate prevented that. ADR-0039 lists two drafts as the cost but leaves out the focus move. - No live run: Dropping the reset on Chat close from #1489 changes the path where you Summon, close Chat, then hover, and nothing ran that path on screen.
chat-close-pill-type.shcovers it on macOS, and this PR edits its copy. Nobody has run the new X11 "Chat open" verify step yet.
Soft-FIX
- Add the focus move to ADR-0039's Consequences so the tradeoff is on record.
- Get a live
chat-close-pill-typepass on macOS at this tip.
Non-blocking
- The ADR overstates the stuck-hover cost: Since #1565, every frame calls
enterSpriteorleaveSpritefrom the Shell's hit test. The hold clears when the cursor leaves, even if:hoversticks.
Verified on this box: the quick-message JS suites pass 65 of 65. The bin unit tests pass except four Secret Service and GTK settings tests that need a desktop session. An X11 live probe stalled before the first frame, so live behavior is still unproven.
— Cursor agent (Architect), on @omesser's behalf.
9e37c21 to
e3a3b7f
Compare
omesser
left a comment
There was a problem hiding this comment.
Soft Open
Tip: e3a3b7fd
What changed
- Closed overlay skips
becomeKeyWindow: The panel class now runsNSPanel's default only while a pill is open, so a sprite click no longer leaves the web view holding the keyboard. - Hand-back to Chat: A pill that opens over Fidget's own window remembers that window's number, and closing the pill makes it key again.
- Scenario:
chat-close-pill-type.shadds a pill step with Chat open. It also waits for TextEdit's text area through a newax rolecommand, and for Fidget to log the sprite click before typing.
What is wrong
- ADR-0039 still leaves out the caret move: The new sentence covers closing a pill over Chat, not opening one. If the pointer rests on the Character while the user types in Chat, the keyboard still moves to the pill, and Consequences doesn't say so.
- Nothing asserts the hand-back to Chat: After the chat-open Escape, the scenario only waits for the close line, then sets Fidget frontmost and sends Cmd+W. A pill that stepped aside instead would most likely pass too, so the new window path has no live proof.
- No two-display run: The
becomeKeyWindowskip runs on every display, and the PR body says the DELL rerun is still pending.
Soft-FIX
- Add the caret move to ADR-0039's Consequences.
- On the chat-open Escape, wait for the
app: hand back windowtrace line, whichFIDGET_TRACE_BUBBLE=1already prints in this scenario, not just the close line. - Run
chat-close-pill-typeon two displays at this tip.
Non-blocking
- Conflict with #1694: Both PRs rewrite the
FRONT_BEFORE_PILLswap inhand_back_keyboard. Whichever lands second should drainFRONT_WINDOW_BEFORE_PILLonly while holding, as #1694 does for the pid. Otherwise a Stay keeps-1with no window, and the next close steps aside to nothing.
Verified on this box: the scenario passes bash -n and shellcheck. The macOS code can't build here, so live proof rests on the author's three single-display passes.
— Cursor agent (Architect), on @omesser's behalf.
Chat's window state was pushed to every overlay each frame so a hover could be suppressed while Chat was up. The pill now depends only on the pointer, its own state and its dismissal latch; the placement wire carries no Chat status. A Summon or Send still holds the pill down until the pointer leaves, which is a pointer rule rather than a Chat rule. Docs, the cues/playground pages and the verify-fidget guide carry the new rule.
A closed overlay still ran NSPanel's becomeKeyWindow default after tao keyed it, so on the built-in display a sprite click left the web view holding the keyboard. Skip that default while no pill is open. When the pill opens over Fidget's own Chat, remember the key window so closing the pill returns the keyboard to Chat instead of stepping aside. The chat-close-pill-type scenario now leaves Chat open for a pill, and waits for TextEdit's text area before typing.
… Chat The opening pill's caret move was the one cost ADR-0039 left out: a pointer resting on the Character while someone types in Chat moves their next word to the pill. The consequence now says so, and the sticky-hover cost the old text claimed is corrected against #1565's Shell-driven enter and leave. The chat-open step now waits for the `app: hand back window` line, so a close that stepped aside instead of returning the keyboard to Chat fails the run. Rebased onto #1694: the remembered window drains only while holding, as its pid does.
e3a3b7f to
f041232
Compare
Follow-up at
|
The repository's comment bar is three lines. The becomeKeyWindow note, the hand-back drain note and the playground cue note now fit it; the history they carried is in the pull request. The ADR states the latch rule at decision level rather than narrating the frames that implement it, and names the gone-window case beside the hand-back to Chat.
Windows remembered only another app's window, so a pill opened over Chat stepped aside on close. It now remembers every foreground window except the overlay. The macOS choice of which window to restore lives in pill_focus, with the Stay and gone-window cases beside it.
The bool hand-back still means the same thing on every OS. The scenario banner no longer names the commit that timed the earlier pass.
Follow-up at
|
#1738 moved the chat-close-pill-type leaves under scripts/scenarios/manual-only.
Linux and Windows clippy build the bin without the overlay panel, so the plan looked unused.
Follow-up at
|
A pill that moves to the other display was remembering the overlay it left. Windows now skips every overlay and still remembers Chat. The macOS close stores whatever pill_focus says to keep, and the two-display trace accepts the window field.
Follow-up at
|
…front X11 compared the active window with the overlay that took the keyboard, so the overlay on the other display could be remembered. It now skips every overlay, and Chat is still remembered.
|
X11 now skips every overlay when a pill remembers the front, the same rule Windows already used. Chat and Settings are still remembered. Wayland still has no X window to remember. — Grok Build, on @omesser's behalf. |
Both remember paths ask is_overlay_label, which uses the same prefix as overlay_label.
|
Windows and X11 now share — Grok Build, on @omesser's behalf. |
omesser
left a comment
There was a problem hiding this comment.
Soft+Hard — tip aa2c1155 — Cleared
| Axis | Verdict |
|---|---|
| Soft | Pass |
| Spec | Pass (provisional) |
| Hard | Pass |
| Total | Cleared |
This push takes the one item from my gate at f65c021e. Nothing is open.
Prior items
- The overlay list was built twice (Soft): fixed.
OVERLAY_PREFIXnow sits next tooverlay_label, which builds the label from it, andis_overlay_labelis the one predicate both hand-backs call:overlay_request_focusinmain.rs(Windows) andremember_foregroundinplatform.rs(X11). Handle mapping stays per platform, as asked. Outside tests, no production code spells out"overlay-"any more. The macOS-onlydead_codeallow onis_overlay_labelis right, since macOS doesn't call it outside tests.
Soft — Pass
- The new test
an_overlay_label_is_the_prefix_chat_and_settings_do_not_sharechecks that overlay labels match and that a Chat label andsettingsdon't, so a label-scheme change that breaks the predicate fails here. The delta is otherwise just the two call sites switching to it.
Spec — Pass (provisional)
- No behavior change in this push, so ADR-0039 and the PR body still match the code.
- Windows case 8, the macOS two-display run and the guide's X11 "Chat open" step still haven't run on real desktops. They're manual-only, so they aren't merge conditions, and Spec stays provisional.
Hard — Pass
- Ran on this box at the tip:
cargo test -p fidget --binspassed 927, including the new label test andthe_overlay_or_no_window_is_never_remembered. I skipped the tests that need a desktop session (Secret Service and GTK double-click settings), same as earlier gates.cargo clippy -p fidget --bins -- -D warningsis clean. This box compiles the X11 call site. - CI at the tip: build passed. ubuntu, windows, macOS and renderer were still running when I gated. This clear depends on the windows job, the only one that compiles the Windows call site.
Earlier reviews
The Soft Open reviews from Cursor agent (Architect) at 3346d3ac and e3a3b7fd are unchanged. Their two-display rerun is still a live hardware follow-up, not a merge condition.
Fix list
Fix list empty.
— Cursor agent (P. Architect), on @omesser's behalf.
|
The live runs the last gate left provisional are not filed on an issue. This pull request closed none.
— Grok Build, on @omesser's behalf. |
|
Both open live runs now pass on main.
— Cursor agent (P. Coder), on @omesser's behalf. |
Why
The quick-message pill's hover was gated on the Instance's Chat window state. The Shell pushed that state to every overlay on every frame so a hover could be suppressed while Chat was up. Two composers excluded each other, and a hover did different things depending on a window the user may not be looking at.
What changed
The pill now depends only on the pointer, its own state and its dismissal latch. The placement wire carries no Chat status, and the overlay no longer keeps a copy of it.
chat_is_up, the placement field and the machine's chat state are gone. The test-onlyMinimizedChats::hidesquery had no caller left, so it and its two tests went with them. Minimization is still tracked for its focus level and its log lines.A Summon or Send still dismisses the pill and holds it down until the pointer leaves. That is a pointer rule, not a Chat rule.
ADR-0039 records the decision, the rejected alternatives and the cost the gate used to hide: an opening pill takes the keyboard, so a pointer resting on the Character while someone types in Chat moves their next word to the pill. It also corrects the stuck-hover cost the first draft over-stated, since #1565's Shell-driven enter and leave clears the latch whenever the pointer leaves, stuck
:hoveror not. The cues playground, the landing playground and the verify-fidget guide carry the new rule. Scenario copy that said a minimized Chat lets the pill back was corrected.Deliberately not done: no replacement Chat signal. The caret move above is the accepted cost.
Rebased onto #1694: the remembered key window drains only while holding, as its pid does, so a Stay keeps both for the next close instead of leaving
-1with no window.The macOS keyboard fix
Live verification found a pre-existing focus bug, on
maintoo: with only the built-in Retina display, a sprite click left the overlay's web view holding the keyboard, so the next keystroke never reached TextEdit.canBecomeKeyWindowwas already refusing, but AppKit still ranNSPanel's defaultbecomeKeyWindowafter tao keyed the panel. The closed overlay now skips that default; a pill still runs it.The new Chat-open scenario step also exposed the hand-back: when a pill opened over Fidget's own Chat, the app remembered no previous app and stepped aside on close. It now remembers the key window and returns the keyboard to Chat, and the scenario waits for the
app: hand back windowtrace line so a close that stepped aside instead fails the run.On Windows and X11 the same close returns the keyboard to Chat or Settings. A pill that moves to another display does not remember the overlay it left. Wayland has no X window to remember, so the compositor keeps the keyboard.
How to verify
scripts/scenarios/manual-only/chat-close-pill-type.sh— three passes on the built-in Retina display atf0412322, including hover and typing with Chat open and theapp: hand back windowline. Not rerun after the later commits.scripts/scenarios/manual-only/chat-close-pill-type.win.ps1case 8 opens Chat and requireshand back Restoreto name Chat's window. Not run on a Windows desktop.scripts/scenarios/manual-only/pill-two-displays.shmatchesapp: hand back Restore holding=true remembered=<pid> window=0 alive=true. A sample of that line matches both regexes. The live two-display run is still open.2184e016:cargo test -p fidget --bin fidget -- a_stay_keeps a_hand_back_spends the_overlay_or_no_windowpassed, andcargo clippy -p fidget --all-targets -- -D warningswas clean on macOS.cargo test -p fidget --binson this branch, before the merge of main, passed 932 with 7 ignored.— OpenCode agent, on @omesser's behalf.
The verify section above was refreshed at
2184e016.— Grok Build, on @omesser's behalf.
At
f65c021e: X11 skips every overlay when a pill remembers the front.cargo test -p fidget --binspassed 933 with 7 ignored, andcargo clippy -p fidget --all-targets -- -D warningswas clean on macOS. The X11 module is not compiled on this machine; Linux CI typechecksremember_active_window.— Grok Build, on @omesser's behalf.
At
aa2c1155: Windows and X11 both askis_overlay_label, which uses the same prefix asoverlay_label.cargo test -p fidget --binspassed 934 with 7 ignored, and clippy was clean on macOS.— Grok Build, on @omesser's behalf.