Repository navigation
refactor(studio): move the learning refresh tooltip to the Tooltip primitive - #2357
Merged
Merged
Conversation
Pins, against the unchanged code, that the icon-only Refresh suggestions button keeps its accessible name, restarts the suggestion queue and clears a conflict notice, before its native title moves to the Tooltip primitive. Refs #2341 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…imitive The icon-only Refresh suggestions button in Settings > Learning explained itself with a native title. It now uses the Tooltip primitive, which also opens on keyboard focus, and keeps aria-label as its accessible name. TooltipTrigger asChild replaces the Button's data-slot="button", which the phone rule in styles.css uses to draw bare button glyphs at 20px, so the icon shrank to 18px on phones. The icon now names size-4, which that rule also covers, so it keeps its size at every width. Tests prove the tooltip opens on hover and on focus, that the native title is gone, and that the glyph still matches the phone sizing rule. The other title= occurrences in knowledge/, learning/, search/ and memory/ stay: component props, non-interactive text, or files in open PRs (#2334, #2352). Refs #2341 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
kantord
approved these changes
Oct 15, 2026
kantord
left a comment
Member
There was a problem hiding this comment.
Thanks for this, and thanks for catching the data-slot sizing issue and fixing it with size-4. I checked it against styles.css: svg.lucide.size-4 is in the phone rule, so the 16px/20px sizes hold. Approving, with a few non-blocking nits:
learning-settings-page.pinning.test.tsxcopies the phone-glyph selector fromstyles.cssas a string literal. If the CSS changes, the test stays green and stops proving anything. Reading the rule fromstyles.css(or assertingsize-4directly) would be sturdier.- The tooltip text matches the
aria-label, so a screen reader may announce it twice while the tooltip is open. This is the usual icon-button pattern, so low priority. - The root cause looks broader than this button:
asChildtriggers replace aButton'sdata-slot="button", so any phone rule keyed on it misses them. I believeschedule-detail.tsxhas the same pattern with a bare icon. A follow-up issue for a fix inButtonor the CSS seems worthwhile rather than a per-sitesize-4.
Fully or partially written by an AI agent.
Merged
2 tasks
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.
Summary
Audits every
title=inapps/web/src/features/knowledge/,learning/,search/andmemory/against the Tooltip primitive (components/ui/tooltip.tsx). One is a native tooltip on an interactive control: the icon-only Refresh suggestions button in Settings > Learning. It now uses Tooltip, which also opens on keyboard focus, and keeps itsaria-label. The other 21 occurrences stay, for the reasons in the table. Nine of them are in files that open PRs change (#2334, #2352), and five of those are disabled-reason titles on buttons that are candidates for later.Part of #2341
Part of #2201
Part of #2210
What changed
learning/learning-settings-page.tsx: the Refresh suggestionsButtonis wrapped inTooltip/TooltipTrigger asChild/TooltipContent side="bottom", and itstitleis removed.aria-label="Refresh suggestions"stays as the accessible name. Thetitlewas never the only name.TooltipTrigger asChildreplaces the Button'sdata-slot="button"withdata-slot="tooltip-trigger". The phone rule instyles.css(@media (max-width: 499px)) uses[data-slot="button"] svg.lucideto draw bare button glyphs at 20px. Without that attribute, the icon dropped to 18px on phones. The first After capture showed this. The icon now carriessize-4, which the same rule also covers (svg.lucide.size-4), so it is 16px on desktop and 20px on phones, as before. This is the firstButtoninside aTooltipTriggerin Studio. Later PRs for Studio: move native title tooltips on controls to the Tooltip primitive #2341 that wrap aButtonhit the same issue.Every occurrence
title=in non-test files under the four folders onmain(4aa238f3c): 22.apps/web/src/features/, line onmain)learning/learning-settings-page.tsx:276<Button>(icon-only Refresh suggestions)aria-labelkeeps the name.memory/memory-fact-detail.tsx:208<time title={revision.updatedAt}>search/global-search.tsx:485<CommandDialog title="Search Mecatl">DialogTitle(its accessible name), not a tooltip.knowledge/knowledge-workspace.tsx:88<StateCard title=…>knowledge/configured-skill-detail.tsx:49<DetailState title=…>knowledge/configured-skill-detail.tsx:53<DetailState title=…>learning/learning-mode-section.tsx:15<SettingsCard title=…>learning/learning-settings-page.tsx:114<SettingsCard title=…>learning/learning-settings-page.tsx:121<SettingsCard title=…>learning/learning-settings-page.tsx:242<SettingsCard title=…>learning/learning-settings-page.tsx:416<SettingsCard title=…>memory/memory-stores.tsx:22<SettingsCard title=…>memory/facts-about-you.tsx:85<SettingsCard title=…>memory/consolidate-memory-card.tsx:270<SettingsCard title=…>knowledge/learned-skills.tsx:63<span title={absolute}>(relative time)knowledge/learned-skills.tsx:153<StateCard title=…>knowledge/learned-skills.tsx:173<StateCard title=…>learning/proposal-row.tsx:238<Button title={blockedReason}>(Approve)learning/proposal-row.tsx:260<Button title={undoReason}>(Undo approval)memory/consolidate-memory-card.tsx:308<Button title={generateBlocked}>memory/consolidate-memory-card.tsx:429,:437<Button title={applyBlocked}>,<Button title={dismissBlocked}>Note for the skipped buttons. Each one explains why the button is disabled, and the
titleshows only while it is. A disabled<button>gets no pointer or focus events, so a Tooltip on the button itself would never open. Those need a focusable wrapper, or the reason as visible text, once #2334 and #2352 merge. Because of these skipped sites, this PR doesn't close #2341.Behaviour differences
titlehad the same limit in most browsers.aria-describedbyonly while the tooltip is open.No regression
Pins first (
b4df832b2), against the unchanged code:learning-settings-page.pinning.test.tsxgains "names the icon-only refresh button and restarts the queue, clearing the notice". It finds the button by its accessible name, checks it has no visible text, and checks that clicking it clears a conflict notice and refetches the queue from the first page. Onmain's component the file passes 15/15.Change (
3d35d3053): two new tests in the same file, so it passes 17/17. No existing assertion was changed.titleattribute, and the glyph still matches the phone sizing rule's selectors. Escape closes the tooltip.Mutation proof. Each mutation was applied alone and the focused file rerun:
main's component (nativetitle, no Tooltip)aria-labelremovedsize-4removed (the phone shrink)Gates (through the shared lock, on the rebased head):
task studio:checkpasses. Lint, typecheck and the generated-artifact check pass; server tests pass 252/252, and web tests pass 1544/1544 (177 files).task studio:browser: 132 passed, 38 skipped.4aa238f3c), the web tests passed 1532/1532 and the browser gate 132/38 skipped. The server suite had 1 failure, inherited frommain(knowledge.test.tsroute count), which fix(studio): declare 400 and 429 on the skill files route, and stop hard-coding the route count #2355 then fixed.Screenshots
Before =
4aa238f(main), After =e29e8e2(the same change before rebasing onto #2355, with the same component code), Prototype =stack-08. The offline Playwright fixtures were captured twice per tree.titleoutside the page, so it never appears in a Playwright capture. That is why the Before and Prototype columns show no tooltip on hover. The prototype still uses a nativetitleon this button. After deliberately differs from the prototype here, following Studio: use shadcn/ui primitives like the prototype and SEP (no custom components) #2201: Tooltip is the shadcn primitive that both the prototype and SEP provide.Hover, desktop light (zoomed). After shows the Tooltip. Before and Prototype rely on the native
title, which doesn't appear in captures.Keyboard focus, phone light. After shows the Tooltip below the button. A native
titlenever opens on focus.At rest, desktop light. This frame is unchanged and matches the prototype's layout. The prototype's copy and filters differ, as they already did before this PR.
All other frames
Hover, desktop light and dark (full page):
Keyboard focus, desktop light and dark:
Keyboard focus, phone dark:
At rest, desktop dark and phone light and dark (unchanged; the phone frames confirm the icon is still 20px):
🤖 Generated with Claude Code