Repository navigation
fix(ui): keep the browser's own tooltip from doubling an open info tip - #35759
Conversation
An info tip's glyph kept its `title` until the tip opened, a moment after the mouse arrived. The browser reads the title under the pointer as it moves and shows it after its own delay, so with the pointer still the hint appeared twice: the bubble, covered by a native tooltip. Once open, the glyph dropped its title altogether, so a titled ancestor's tooltip (the registry tier badge row, a footer summary) could show beside the bubble instead. The glyph now empties its title in the same event that brings the mouse there (flushSync, so it lands before the browser reads it) and keeps it empty while the tip is open; empty rather than absent, so no ancestor's title stands in for it.
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Both changes are aimed at the cause, inside What this change shipsInventory (4 items) — 4 justifiedIntent: a person hovering an info glyph sees its hint once, in the bubble, with no native browser tooltip over it or beside it. FIX.
[FIRST-PRINCIPLES-REVIEWED] 4ff0b4f Description read[DESCRIPTION-READ] 54e46815d95dee4e36c385c9e2a6fa8e10ecb97d2752b27ff0058b3f9eb791ff That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fix is local to [DESIGN-REVIEWED] 4ff0b4f Description read[DESCRIPTION-READ] 45918ec3a122dc2d5d0d612be57380534c801e0db9904edb458819cc7fb5e402 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the change adds no control and no copy. The blind reader saw shot-01 as two boxes repeating the same text, "it looks broken", and saw shot-02 as one clean, readable bubble. Notes
[UX-REVIEWED] 4ff0b4f Description read[DESCRIPTION-READ] df02652153de6fc30e572cffbe51b8d95d06c55468edd6dba85ca9cf9909471a That sha256 names everything this verdict read: the PR description, plus the 5 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: ApproveWhy: the decider estimates a 7% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. InfoTip now gives the glyph an empty An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
bolichen97
left a comment
There was a problem hiding this comment.
Read the whole diff, tests included.
- The glyph's
titleis now empty rather than removed while the tip is open, and from the moment a mouse pointer enters. A browser shows the nearesttitleat or above the hovered element, so removing it let a titled ancestor's tooltip appear beside the bubble. An emptytitleblocks that, and the new test checksbtn.closest('[title]')stays the glyph. onPointerEntersetspointerOninsideflushSyncfor a mouse only, so the title is gone before the browser reads it, andonPointerLeaveclears it, which gives the title back after a pass-through. A touch pointer keeps its title, and a test pins that.flushSyncruns in a React event handler, which is allowed.- The existing assertions that expected the attribute to be absent now expect an empty string, and the comments match. The PR description has before and after screenshots. No regex added.
Checks are green on this head. The author holds auto-merge, so I am not setting it.
I did not run the tests locally.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (3 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the info tip empties its title as a mouse arrives, so the browser tooltip no longer doubles it, with tests.
Problem / Motivation
Goal: a hovered info tip shows its hint once, in its own bubble, never with the browser's native tooltip on top of it or beside it.
With the mouse resting on an info glyph, Chromium shows its own
titletooltip over the open bubble after its usual delay, so the hint appears twice and the native box covers the bubble's text (first screenshot below). Two causes:titleuntil the tip opens,HOVER_OPEN_DELAY_MS(150 ms) after the mouse arrives. The browser reads the title under the pointer as it moves and shows it after its own delay without reading it again, so a pointer that stops on the glyph gets the native tooltip anyway.titleattribute at all, so the browser falls back to the nearest titled ancestor after any pointer movement.RegistryManager.tsxnests the tip in a span whosetitleis the same hint (the registry tier badges), and fix(chat): word the cache footer note plainly and put its reason in an info tip #35631 met the same fallback with the reply footer's summarytitle.Why it matters
InfoTipis the app's one help-tip pattern, rendered in 52 files. Its own doc comment says the browser's tooltip must never double it, and on hover it does, with the native box hiding the bubble it doubles.Not a goal
title. It stays the native fallback and what assistive technology reads as the description when the tip is closed.What changed (motivation → approach → change)
Approach: the title has to be gone in the very event that brings the mouse to the glyph, before the browser reads it, and it has to be empty (not absent) while the tip is open, so no ancestor's title stands in for it.
website/src/components/InfoTip.tsx: apointerOnstate, set when a mouse enters the glyph and cleared when it leaves; the glyph'stitleis''while a mouse is on it or the tip is open, and the hint otherwise. The enter handler sets the state withflushSync, because pointer-enter updates are not committed synchronously and the browser reads the title right after the event. The doc comment says why the title is emptied rather than removed.website/src/test/InfoTip.test.tsx: two assertions now expect an emptytitleon an open tip; new tests: a mouse on the glyph empties the title at once and a pass-through restores it; a touch keeps the title; an open tip inside a titled element leaves its own empty title as the nearest one.website/src/test/ChatSidebar.olderSessionsTip.test.tsx: the pinned-tip assertion expects the emptytitle.Backwards compatibility
Compatible: the closed glyph still carries its hint as
title, and the open glyph still describes itself througharia-describedby; the only difference is an emptytitlewhere there was none, while a mouse is on the glyph or the tip is open.Removes nothing: no prop, export or behaviour is removed.
Tests
InfoTip.tsx, 5 of the changed and new assertions fail (four inInfoTip.test.tsx, one inChatSidebar.olderSessionsTip.test.tsx); the touch case is a negative control and passes on both.eslinton the changed files andtsc -p tsconfig.app.json..woke.ymlpass on the added lines.cd website && npx vitest run src/test/InfoTip.test.tsx src/test/ChatSidebar.olderSessionsTip.test.tsxManual verification
A native tooltip exists only on a real display, so this was checked in headed Chromium (Playwright's own build) on a private X display at 2x. The page renders the registry tier row's markup from
RegistryManager.tsx: a span titled with the hint, holding the realBadgeand the realInfoTipwith the same hint. The real pointer was moved onto the glyph and held still for 3 seconds, then the display was captured. With main'sInfoTip, the native tooltip covers the bubble. With this change, only the bubble shows. An intermediate version that emptied the title only once the tip was open still showed the doubled tooltip, because the browser had already read the title when the pointer arrived; that is why the title goes in the entering event.Screenshots / video
The registry tier row with the pointer resting on the info glyph for 3 seconds, light theme.
Before (main): the browser's tooltip covers the bubble.
After: only the bubble.
Related Issues
Follows #35631, whose review found an open tip letting the reply footer's
titleshow beside it; this fixes the cause inInfoTipfor every caller.Sibling sweep
Swept:
git grep -n "<InfoTip" -- website/src, looking for a tip inside an element with atitle, andgit grep -n 'role="tooltip"' -- website/src, looking for other custom tooltips whose trigger keeps a nativetitle.Sibling:
website/src/components/InfoTip.tsx-- changed hereSibling:
website/src/components/RegistryManager.tsx-- not affected -- its tier rows nest the tip in a titled span, and the empty glyph title covers them with no change to the fileSibling:
website/src/components/InstantTip.tsx-- not affected -- it puts no native title on its anchorPattern harvest
Rule candidate: review-prompt
Pattern: a custom tooltip whose trigger keeps a native
titleuntil the tooltip opens shows the hint twice on hover, because the browser reads the title when the pointer arrives and shows it after its own delay.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement