Skip to content

Fix stray tooltips after touch drawer dismissal - #3419

Merged
ymichael merged 2 commits into
mainfrom
bb/fix-stray-footer-tooltips-after-touch-drawer-dis-thr_jhi2cwgu29
Sep 10, 2026
Merged

Fix stray tooltips after touch drawer dismissal#3419
ymichael merged 2 commits into
mainfrom
bb/fix-stray-footer-tooltips-after-touch-drawer-dis-thr_jhi2cwgu29

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Radix opens a tooltip when its trigger receives focus after its pointer-down guard has cleared. On touch, focus restoration can arrive after pointer-up; the footer-specific suppression was then cleared when the More drawer moved focus, so dismissing that drawer restored focus to the footer action and left its tooltip open without hover.

What changed

The shared tooltip trigger now composes its focus handler and allows focus-opened tooltips only when the existing input-modality tracker reports keyboard input. Mouse hover and keyboard focus still open tooltips, while touch/pointer focus restoration does not. The now-redundant footer suppression state was removed while preserving focus restoration, and the plugin registry artifact was regenerated for the shared dependency. Existing tooltip tests now use an explicit keyboard-focus helper where that is the intended interaction.

How you verified

  • Focused Turbo app tests: 12/12 passed across the tooltip modality and plugin footer suites.
  • Turbo plugin-registry test and typecheck passed; the registry is fresh and its vendor test passes.
  • Turbo app and shared-UI typechecks passed.
  • Formatting checks for every changed TypeScript file and git diff checks passed.
  • Browser QA reproduced the exact touch sequence before the fix and repeated it after the fix, alongside mouse-hover and keyboard-focus checks.

AGENT GENERATED

ymichael and others added 2 commits September 10, 2026 08:01
The sidebar footer disclosure trigger (Provider usage) left a stray tooltip
on screen after a touch journey: opening the disclosure, closing it via the
header chevron, then opening and dismissing the sidebar More drawer. Event
capture in a coarse-pointer browser session showed the drawer's focus
restoration landing on the footer trigger and Radix opening the tooltip 2ms
later, with no hover to close it again. The footer's own tooltip suppression
had already been cleared by the blur when the drawer took focus.

Radix only guards focus-opened tooltips with an isPointerDown check, which
does not hold on touch because focus arrives after pointerup. Compose an
onFocus handler on the shared TooltipTrigger that prevents the open unless
the last input modality was the keyboard, reusing the existing
isLastInputKeyboard tracker. Mouse hover and keyboard focus tooltips are
unaffected, and focus restoration itself is untouched.

Existing tests that used a bare focus event to assert tooltip copy now go
through a focusWithKeyboard helper, which is what they meant.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The shared TooltipTrigger modality guard covers every pointer and touch path
that suppressedTooltipKey existed to handle, so the footer no longer needs its
own flag, the blur/pointerleave handlers that drained it, or the two props
threading it through PluginSidebarFooterItems and SidebarFooterItemButton.

The state itself stays, renamed to restoreFocusKey: its load-bearing job was
never tooltip suppression but telling the layout effect which trigger to focus
after the disclosure closes. The old name described the caller, not the value.

Closing the disclosure with the keyboard now shows the trigger's tooltip on the
restored focus, which is the same thing tabbing to it does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ymichael
ymichael merged commit f07f230 into main Sep 10, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fix-stray-footer-tooltips-after-touch-drawer-dis-thr_jhi2cwgu29 branch September 10, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant