Repository navigation
A control's tooltip is one trigger on the whole control - #312
Merged
Merged
Conversation
A segmented control copied its tooltip onto every cell that had none of its own, and the container tipped it as well. The deepest trigger wins, so the cell's copy opened, anchored to the cell: crossing the control re-anchored it at each cell, the last one still fading beside it. The stepper (its field and both buttons) and the slider (its track and thumb) did the same. The control's tooltip is now one trigger on its outer node (`tooltip::register_whole`): the pointer anywhere over the control, or keyboard focus anywhere inside it, opens it, anchored to the control. A part carries a trigger only for a tooltip of its own (a segmented cell's `Choice::tooltip`, which wins while hovered); otherwise it is described by the control's text (`tooltip::describes`), so assistive technology reads the same as before. Behaviour changes: - segmented, stepper, slider: the control's tooltip is anchored to the control (the slider's to its track), not to the part under the pointer. - Keyboard focus on a part opens the control's tooltip, as before, now anchored to the control. - The shadcn preset's tooltip delay is 700 ms (Radix's default), up from 300 ms: tooltips distract. The grace stays 300 ms; an app can still set `style.tooltip.delay`. The tooltip snapshot waits for the style's delay and entry instead of a fixed frame count. The controls gallery gives its segmented control, slider and stepper tooltips. Fixes #310 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
Leaving a segmented cell that has its own tooltip outward, the pointer crosses the control's padding, where it is on the control's trigger and on no cell. Within the grace that opened the control's tooltip at once, a flash on the way out. The grace is for moving to a neighbouring trigger; moving out to one that encloses the trigger last opened is leaving, so that one waits for the delay like any first tooltip, and the tooltip being left closes as the wait starts. The rule is the shared resolver's (a trigger now carries its rect), so it holds for any trigger inside another's. The stepper and the slider have no parts with tooltips of their own, so leaving them outward never meets a second trigger. Fixes #310 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
15 of 20 tasks
egui hovers a widget the pointer is only near, within its interact radius, so a control's tooltip opened with the pointer a few points beside it, over empty space in the row. A trigger now wants its tooltip for the pointer only while the pointer is inside the trigger's interact rect, in both the control-wide trigger and a part's own; this holds for every tooltip, as they all register through the same code. Fixes #310 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
# Conflicts: # src/tooltip.rs
Owner
Author
|
User trial passed (2026-11-17), with the padding-band follow-up filed separately. Gate (my run with current main): |
This was referenced Nov 18, 2026
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.
Fixes #310
The cause, as found
Eggshell resolves one tooltip trigger per frame, and the deepest trigger wins. A segmented control gave every cell without its own tooltip a copy of the control's tooltip. So the cell's copy is the one that opened, anchored to that cell. Crossing the control re-anchored it at each cell, with the previous one still fading out beside it: two boxes. The headless repro counted 2 boxes, the second moved onto the next cell.
The fix
tooltip::register_wholeis one trigger on a control's outer node. The pointer anywhere over the node, or keyboard focus on any widget inside it (has_focus_within), opens it, anchored to the node.tooltip::describeskeeps the control's text as each part's accessible description, without making the part a trigger.owned,tipped_wholeandtip_describeswrap these two for the controls.Choicehas its own tooltip. That cell's trigger is deeper, so it wins while the cell is hovered or focused.The shared path: which controls copied the tooltip
Leaving a cell outward (from the trial)
Leaving a cell that has its own tooltip outward, the pointer crosses the control's padding: there it is on the control's trigger and on no cell. Within the grace, that opened the control's tooltip at once, so it flashed on the way out.
The grace is for moving to a neighbouring trigger. Moving out to a trigger that encloses the one last opened is leaving, so that trigger now waits the full delay, and the tooltip being left closes as the wait starts. The rule is in the shared resolver (a trigger now carries its rect), so it holds for any trigger inside another's.
The stepper and the slider have no parts with tooltips of their own, so leaving them outward never meets a second trigger.
New tests:
tooltip::tests::the_grace_opens_a_neighbour_at_once_but_not_the_trigger_around_the_lasttooltips::segmented::leaving_a_cell_with_its_own_tooltip_outward_never_shows_the_controls, which steps the pointer 1 pt at a time through the band and asserts the precondition that it crossed it.Dropping the enclosing check fails both.
Behaviour changes
style.tooltip.delay.Tests (
tests/it/tooltips.rs)Reversion checks:
Verified in the web build
The controls gallery now gives its segmented control, slider and stepper tooltips. In headless Chrome:
Also
skipDelayDuration.tooltip_open_*and the rich tooltip) now wait for the style's delay plus its entry motion (support::rest_for_tooltip), instead of a fixed 30 frames.tests/it/tooltips.rssets its own delay and grace through the style, so it does not depend on the preset.docs/overlays.mdstill records the earlier 300 ms decision (2026-11-13). That prose is the user's to amend.No goldens changed. No panic sites added.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o