Repository navigation
Core: one hover-intent machine for tooltips and hover cards (A of #376) - #410
Merged
Merged
Conversation
…#376) Hover cards (#376) open and close by hover intent like tooltips, with a close delay, focus that waits for the open delay, and no skip-delay. The design note asks for one machine rather than a sibling timer, so `Tooltips` becomes `intent::Intent<P>`, generic over what an instance shows, with a `Timing { open, close, skip, focus }`: - `close`: how long the open trigger lingers once nothing wants it. Zero for tooltips, which close at once as before. - `skip`: `Grace(d)` is the tooltip's skip-delay; `Never` is for cards. - `focus`: `AtOnce` (tooltips) or `AfterDelay` (cards). The latch, focus restore, deepest-wins `wanted` and the "not the trigger around the last" rule are unchanged. The machine's tests move with it to `src/intent.rs`, assertion for assertion; new tests cover the close delay, coming back within it, focus waiting, no grace, and an interruption closing a lingering one. Behaviour changes: none. Tooltips use close = 0, Grace(style.grace) and AtOnce, which is the old machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
This was referenced Nov 19, 2026
The refused control's press (Cause::Pressed, a pinned show) is ported onto the shared Intent machine: Press and Tooltip::refusal stay in tooltip.rs, the pinned show and the cause's order in intent.rs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
Owner
Author
|
Approved by the user on its tests (2026-11-19). GitHub's required checks pass on the branch merged with current main. Merging. |
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.
Part of #376 (PR A of three: A, the hover-intent generalisation; B, the
hover_anchoredprimitive; C, the extras widget).What
Tooltips(insrc/tooltip.rs) becomesintent::Intent<P>insrc/intent.rs, a hover-intent machine that is generic over what an instance shows. It takes aTiming { open, close, skip, focus }:close(new): how long the open trigger stays once nothing wants it. It is zero for tooltips, so they close at once as before.skip:Grace(d)is the tooltip's existing skip-delay.Neveris for hover cards (no skip-delay, per the decisions).focus:AtOnce(tooltips) orAfterDelay(cards, per the decisions).The latch, focus restore, deepest-wins
wantedand the rule that the trigger around the last one waits are all unchanged. Tooltips keep the payload of their content and style asShows.Tests
The machine's unit tests move with it to
src/intent.rs, with the same assertions. New tests cover the close delay and what is left of it, coming back within it, focus waiting for the delay, no grace while the last one lingers, and an interruption closing a lingering one.Behaviour changes
None. Tooltips run with
close = 0,Grace(style.tooltip.grace)andAtOnce, which is the old machine. The test outcomes are identical.cargo xtask ci: exit 0.🤖 Generated with Claude Code