A local-first multi-agent app development platform, built on PenguinHarness
fix(ui,web): hover hints that say what the screen does not show open again (#1051 port)
lmliheng2ae710f305b5
diff --git a/changelog/unreleased/2026-10-16-key-hints-restored.md b/changelog/unreleased/2026-10-16-key-hints-restored.mdnew file mode 100644index 00000000..6dae07f2--- /dev/null+++ b/changelog/unreleased/2026-10-16-key-hints-restored.md@@ -0,0 +1,18 @@+# Hover hints that say what the screen does not show open again++- **Date:** 2026-10-16+- **Type:** fix+- **Scope:** `ui`, `web`++[中文版](2026-10-16-key-hints-restored.zh.md)++Ported from upstream PenguinHarness (#1051, commit `e5639b32`).++The tooltip rule opens a hint only on an element with no words of its own or with its words cut off. Hints that carried something the screen does not show — what a click discards, a shortcut, the full path behind a folder's name, why a control is disabled — had stopped opening on controls with visible text, and an avatar's initial or a letter used as an icon counted as visible words, silencing the hint that names it. The rule now leaves such text out, and a hint that adds to visible text is marked and opens over it.++## Details++- `hintAllowedFor` no longer counts text inside an SVG or inside `aria-hidden` as the element's words, so the hints naming an avatar open again (a Session row's Agent, the collapsed rail's account, a company page's employee). The Session row's approval count and a chip's × became `aria-hidden` marks; the approval count is named in hidden text instead.+- A `data-tooltip` marked `data-tooltip-extra` opens over fully visible text; `<Tooltip extra>`, `tooltipExtra` on a chip and a nav row's hint, and `titleExtra` on the form picker's trigger set the same mark. A `Badge`'s tooltip and a `BetaBadge`'s title are always marked; `Breadcrumbs`, `DockTabs`, `Legend`, `FileTree` and `ToolCallCard` mark a hint that says more than the label.+- A hint that only repeats the words already on screen is never marked, and never shows — that rule is unchanged.+- Not every site on the upstream audit list exists in this tree: the plugin market cards, the find bar, the draft page's example folders (this fork keeps user shortcuts there instead), the transcript note and the API-try panel are not part of this port. The hint on a shortcut row's fill action was marked in their place, since it carries the same kind of information.diff --git a/changelog/unreleased/2026-10-16-key-hints-restored.zh.md b/changelog/unreleased/2026-10-16-key-hints-restored.zh.mdnew file mode 100644index 00000000..b78b1f8d--- /dev/null+++ b/changelog/unreleased/2026-10-16-key-hints-restored.zh.md@@ -0,0 +1,28 @@+# 承载屏幕上没有的信息的悬停提示重新显示++- **Date:** 2026-10-16+- **Type:** fix+- **Scope:** `ui`, `web`++[English](2026-10-16-key-hints-restored.md)++移植自上游 PenguinHarness(#1051,提交 `e5639b32`)。++悬停提示的规则只在元素没有自己的文字、或文字被截断时才弹出提示。于是那些承载屏幕上没有的信息的提示 ——+点击会丢弃什么、快捷键、文件夹名背后的完整路径、控件为何置灰 —— 在带可见文字的控件上不再出现;头像+首字母和当图标用的字母也被算作可见文字,让为它们命名的提示一并失效。规则现在不计这类文字,补充可见+文字的提示经标记后照常显示。++## 细节++- `hintAllowedFor` 不再把 SVG 内与 `aria-hidden` 内的文字算作元素自己的文字,为头像命名的提示因此重新+ 显示(会话行的 Agent、收起侧栏的账号、公司页面的员工)。会话行的待审批数与标签的 × 改为 `aria-hidden`+ 的标记,待审批数改由隐藏文字命名。+- 带 `data-tooltip-extra` 标记的 `data-tooltip` 在文字完整可见时也显示;`<Tooltip extra>`、标签与+ 导航行的 `tooltipExtra`、表单选择器的 `titleExtra` 打同一标记。`Badge` 的 tooltip 与 `BetaBadge`+ 的 title 一律带标记;`Breadcrumbs`、`DockTabs`、`Legend`、`FileTree` 与 `ToolCallCard` 在提示多于+ 标签时标记。+- 只重复屏幕上已有文字的提示永不标记、也永不显示 —— 这条规则没变。+- 上游那份清单上的位置并非本树都有:插件市场的卡片、查找栏、草稿页的示例文件夹(本树这里放的是用户+ 自己的快捷提示)、转录注记与 API 试用面板都不在这次移植里。快捷提示行的填充动作改打了标记,因为它+ 承载的是同一类信息。diff --git a/packages/ui/src/components/charts/legend/legend.tsx b/packages/ui/src/components/charts/legend/legend.tsxindex 56414614..bdb1de68 100644--- a/packages/ui/src/components/charts/legend/legend.tsx+++ b/packages/ui/src/components/charts/legend/legend.tsx@@ -31,7 +31,10 @@ export interface LegendItem {shape?: ChartSwatchShape;/** Drawn in the swatch's place. */mark?: ReactNode;- /** The tooltip over a truncated label, when it should say more than the label (a file's path). */+ /**+ * The tooltip, when it should say more than the label (a file's path): it then shows over the+ * label in full. Without it the label is its own tooltip, shown only when cut off.+ */title?: string;/** What a `list` row prints after its label. */value?: ReactNode;@@ -87,6 +90,7 @@ export function Legend({<spandata-tooltip={item.title ?? item.label}data-tooltip-content={mono ? "code" : "text"}+ data-tooltip-extra={(item.title ?? item.label) !== item.label || undefined}className={`min-w-0 truncate ${list ? "flex-1" : ""} ${mono ? "font-mono" : ""}`}>{item.label}diff --git a/packages/ui/src/components/chat/composer/toolbar-trigger.tsx b/packages/ui/src/components/chat/composer/toolbar-trigger.tsxindex 80d3098a..06d142c7 100644--- a/packages/ui/src/components/chat/composer/toolbar-trigger.tsx+++ b/packages/ui/src/components/chat/composer/toolbar-trigger.tsx@@ -89,7 +89,9 @@ export function ToolbarTrigger({{pill && <span className="hidden min-w-0 truncate @md:block">{label}</span>}{pill && caret && <ChevronDown size={ICON_SIZE.caretDense} />}{!pill && badge > 0 && (- <span className="absolute -right-1 -top-0.5">+ // Hidden from assistive technology like the glyph: the count is a mark on the button,+ // and the button's name (or its tooltip) is what says it.+ <span aria-hidden className="absolute -right-1 -top-0.5"><Count n={badge} /></span>)}diff --git a/packages/ui/src/components/chat/tool-call-card/tool-call-card.tsx b/packages/ui/src/components/chat/tool-call-card/tool-call-card.tsxindex a4ce99bf..331532b9 100644--- a/packages/ui/src/components/chat/tool-call-card/tool-call-card.tsx+++ b/packages/ui/src/components/chat/tool-call-card/tool-call-card.tsx@@ -169,6 +169,8 @@ export function ToolCallCard({variant="link"size="sm"title={action.hint}+ // What the click does to the call is not in its label.+ data-tooltip-extraonClick={action.onClick}className="shrink-0">diff --git a/packages/ui/src/components/feedback/badge/badge.tsx b/packages/ui/src/components/feedback/badge/badge.tsxindex 5d829eeb..b3ea946a 100644--- a/packages/ui/src/components/feedback/badge/badge.tsx+++ b/packages/ui/src/components/feedback/badge/badge.tsx@@ -32,6 +32,8 @@ export interface BadgeStyle {export interface BadgeProps extends BadgeStyle {size?: BadgeSize;+ /** The sentence behind the badge's word, on hover (a discount's terms, what "built in" means). */+ tooltip?: string;children: ReactNode;}@@ -73,9 +75,17 @@ const SIZE: Record<BadgeSize, string> = {sm: "px-1.5 py-px",};-export function Badge({ tone = "neutral", variant = "soft", size = "md", children }: BadgeProps) {+export function Badge({+ tone = "neutral",+ variant = "soft",+ size = "md",+ tooltip,+ children,+}: BadgeProps) {return (<span+ // The sentence says what the word cannot, so it shows over the word in full.+ {...(tooltip !== undefined ? { "data-tooltip": tooltip, "data-tooltip-extra": true } : {})}className={`inline-flex items-center rounded-[var(--ui-radius-pill)] text-xs font-semibold ${SIZE[size]} ${VARIANT[variant][tone]}`}>{children}diff --git a/packages/ui/src/components/feedback/beta-badge/beta-badge.tsx b/packages/ui/src/components/feedback/beta-badge/beta-badge.tsxindex 149360a6..79c420e2 100644--- a/packages/ui/src/components/feedback/beta-badge/beta-badge.tsx+++ b/packages/ui/src/components/feedback/beta-badge/beta-badge.tsx@@ -9,7 +9,7 @@export function BetaBadge({ label, title }: { label: string; title?: string }) {return (<span- {...(title !== undefined ? { "data-tooltip": title } : {})}+ {...(title !== undefined ? { "data-tooltip": title, "data-tooltip-extra": true } : {})}className="whitespace-nowrap rounded-sm border border-line-emphasis px-0.5 py-px text-xs font-medium leading-none text-fg-muted">{label}diff --git a/packages/ui/src/components/files/file-tree/file-tree.tsx b/packages/ui/src/components/files/file-tree/file-tree.tsxindex 52a63388..6cf97093 100644--- a/packages/ui/src/components/files/file-tree/file-tree.tsx+++ b/packages/ui/src/components/files/file-tree/file-tree.tsx@@ -75,7 +75,11 @@ export interface FileTreeProps<Row extends FileTreeRow> {scrollTo?: { path: string } | null;/** The directory last opened or closed, whose subtree animates. Null: nothing to animate. */toggled?: TreeToggle | null;- /** A row's tooltip; the path by default. */+ /**+ * A row's tooltip, when it says more than the row shows (a size, an exact time): it then shows+ * over the row's name in full. Without it the tooltip is the path, shown only over a name cut+ * short.+ */rowTitle?: (row: Row) => string;/*** A row's accessible name, for the row whose visible text leaves out what the row means — the@@ -237,6 +241,7 @@ export function FileTree<Row extends FileTreeRow>({// resolve a row by this attribute, and neither may land on one that is on its way out.{...(retained ? {} : { "data-tree-path": row.path, "data-tree-kind": row.kind })}data-tooltip={rowTitle?.(row) ?? row.path}+ data-tooltip-extra={rowTitle !== undefined || undefined}aria-label={rowLabel?.(row)}{...(retained ? {} : { onClick: () => activate(row), onFocus: () => setFocused(row.path) })}style={{ paddingLeft: TREE_PAD_PX + row.depth * TREE_INDENT_PX }}diff --git a/packages/ui/src/components/forms/select/form-picker.tsx b/packages/ui/src/components/forms/select/form-picker.tsxindex 1a90aa76..25967a71 100644--- a/packages/ui/src/components/forms/select/form-picker.tsx+++ b/packages/ui/src/components/forms/select/form-picker.tsx@@ -28,7 +28,13 @@ export interface FormPickerTriggerProps {labelClassName?: string;/** Grays the label as a placeholder (nothing selected yet). */muted?: boolean;- title: string;+ /**+ * The tooltip, only when it says more than the visible value (the field name with the value in+ * it, e.g. "Model: GPT-6"). Omit it when it would repeat the field label above the control.+ */+ title?: string;+ /** `title` holds what the label leaves out (a full path, an id): it shows over the label in full. */+ titleExtra?: boolean;ariaLabel: string;ariaHaspopup?: "listbox" | "dialog";/** Whether the thing it opens is open (announced as `aria-expanded`). */@@ -50,6 +56,7 @@ export function FormPickerTrigger({labelClassName = "",muted = false,title,+ titleExtra = false,ariaLabel,ariaHaspopup = "listbox",expanded,@@ -61,6 +68,7 @@ export function FormPickerTrigger({<buttontype="button"data-tooltip={title}+ data-tooltip-extra={titleExtra || undefined}aria-label={ariaLabel}aria-haspopup={ariaHaspopup}aria-expanded={expanded}diff --git a/packages/ui/src/components/forms/tag-input/tag-input.tsx b/packages/ui/src/components/forms/tag-input/tag-input.tsxindex 3a0b3d33..c5739421 100644--- a/packages/ui/src/components/forms/tag-input/tag-input.tsx+++ b/packages/ui/src/components/forms/tag-input/tag-input.tsx@@ -34,6 +34,8 @@ export interface ChipProps {meta?: ReactNode;/** The whole of what the chip stands for, on hover (a path, a description). */tooltip?: string;+ /** `tooltip` says what the label does not (a full path, what sending does): it shows over the label in full. */+ tooltipExtra?: boolean;/** Set the chip in the mono face: it names an id, a file or a command. */mono?: boolean;variant?: ChipVariant;@@ -49,6 +51,12 @@ const VARIANT: Record<ChipVariant, string> = {outline: "border border-line bg-surface-muted py-1",};+/** A chip's tooltip attributes, marked as adding to the label when the caller says it does. */+const hint = (tooltip: string, extra: boolean) => ({+ "data-tooltip": tooltip,+ ...(extra ? { "data-tooltip-extra": true } : {}),+});+/** How wide a chip may grow before its label truncates. */const WIDTH: Record<ChipVariant, string> = { soft: "max-w-48", outline: "max-w-56" };@@ -58,6 +66,7 @@ export function Chip({suffix,meta,tooltip,+ tooltipExtra = false,mono = false,variant = "soft",control,@@ -67,13 +76,13 @@ export function Chip({const inline = control !== undefined && control !== null;return (<span- {...(tooltip !== undefined && !inline ? { "data-tooltip": tooltip } : {})}+ {...(tooltip !== undefined && !inline ? hint(tooltip, tooltipExtra) : {})}className={`anim-pop flex ${inline ? "max-w-full" : WIDTH[variant]} items-center gap-1 rounded-md ${VARIANT[variant]} pl-2 pr-1 text-xs text-fg ${mono ? "font-mono" : ""}`}>{inline ? (<><span- {...(tooltip !== undefined ? { "data-tooltip": tooltip } : {})}+ {...(tooltip !== undefined ? hint(tooltip, tooltipExtra) : {})}className="flex shrink-0 items-center gap-1">{glyph}@@ -103,7 +112,7 @@ export function Chip({onClick={onRemove}className="flex h-5 shrink-0 items-center rounded px-0.5 text-fg-subtle transition-colors duration-150 hover:text-fg">- ×+ <span aria-hidden>×</span></button>)}</span>diff --git a/packages/ui/src/components/navigation/breadcrumbs/breadcrumbs.tsx b/packages/ui/src/components/navigation/breadcrumbs/breadcrumbs.tsxindex 0e61c7eb..f4895040 100644--- a/packages/ui/src/components/navigation/breadcrumbs/breadcrumbs.tsx+++ b/packages/ui/src/components/navigation/breadcrumbs/breadcrumbs.tsx@@ -13,7 +13,9 @@** An item with `onClick` is a button that goes there; without, the item is read out and nothing* more — the Files panel's path is not navigable, because the tree beside it is what navigates.- * `title` is the strip's tooltip: the whole path, however much of it is on screen.+ * `title` is the strip's tooltip: the whole path, however much of it is on screen. It shows while+ * leading items are folded into the "…", where it holds what the strip left out, and otherwise+ * only over an item cut short.*/import { Fragment, useLayoutEffect, useRef, useState } from "react";import { CRUMB_ELLIPSIS, crumbItemWidth, splitFileName, visibleCrumbSegments } from "./crumb-fit";@@ -59,6 +61,7 @@ export function Breadcrumbs({<divref={ref}data-tooltip={title}+ data-tooltip-extra={fit.collapsed || undefined}className={`flex min-w-0 items-center gap-1 overflow-hidden px-1 text-sm ${className}`}>{fit.collapsed && <span className="shrink-0 text-fg-subtle">{CRUMB_ELLIPSIS}</span>}diff --git a/packages/ui/src/components/navigation/dock-tabs/dock-tabs.tsx b/packages/ui/src/components/navigation/dock-tabs/dock-tabs.tsxindex bdd88c7d..08cd2d9f 100644--- a/packages/ui/src/components/navigation/dock-tabs/dock-tabs.tsx+++ b/packages/ui/src/components/navigation/dock-tabs/dock-tabs.tsx@@ -23,7 +23,10 @@ export interface DockTabItem {/** Stable id: the tab's `data-tab-id`, and what `onSelect` / `onClose` receive. */key: string;label: string;- /** The hover hint; the label when omitted (a terminal's names its shell and directory). */+ /**+ * The hover hint; the label when omitted (a terminal's names its shell and directory). One that+ * says more than the label shows over it in full.+ */title?: string;glyph: ReactNode;/** An attention dot beside the name (a pending approval behind the tab). */@@ -68,6 +71,7 @@ export function DockTabButton({role="tab"aria-selected={active}data-tooltip={tab.title ?? tab.label}+ data-tooltip-extra={(tab.title ?? tab.label) !== tab.label || undefined}onClick={onSelect}className="flex h-full min-w-0 flex-1 items-center gap-1.5 pl-2 pr-1 text-left text-xs">diff --git a/packages/ui/src/components/navigation/nav-list/nav-list.tsx b/packages/ui/src/components/navigation/nav-list/nav-list.tsxindex 176a6d36..8b4aa9e4 100644--- a/packages/ui/src/components/navigation/nav-list/nav-list.tsx+++ b/packages/ui/src/components/navigation/nav-list/nav-list.tsx@@ -154,6 +154,7 @@ export interface NavRowLinkProps {"aria-current"?: "page";"aria-label"?: string;"data-tooltip"?: string;+ "data-tooltip-extra"?: true;/** `false`: the link starts no drag of its own address (the row around it is the handle). */draggable?: false;onClick?: () => void;@@ -192,6 +193,8 @@ export interface NavRowProps {ariaLabel?: string;/** A hint on hover and focus. */tooltip?: string;+ /** `tooltip` holds what the label leaves out (a shortcut, a full path): it shows over the label in full. */+ tooltipExtra?: boolean;className?: string;}@@ -210,6 +213,7 @@ export function NavRow({onClick,ariaLabel,tooltip,+ tooltipExtra = false,className = "",}: NavRowProps) {const orientation = useContext(NavOrientationContext);@@ -218,6 +222,7 @@ export function NavRow({const named = {...(ariaLabel !== undefined ? { "aria-label": ariaLabel } : {}),...(tooltip !== undefined ? { "data-tooltip": tooltip } : {}),+ ...(tooltip !== undefined && tooltipExtra ? { "data-tooltip-extra": true as const } : {}),};const dragless = draggable === false ? { draggable: false as const } : {};const content = (diff --git a/packages/ui/src/components/overlays/tooltip/tooltip.tsx b/packages/ui/src/components/overlays/tooltip/tooltip.tsxindex e55be6f5..420990dd 100644--- a/packages/ui/src/components/overlays/tooltip/tooltip.tsx+++ b/packages/ui/src/components/overlays/tooltip/tooltip.tsx@@ -10,7 +10,12 @@** Either way in, a hint shows only for an element with no visible text of its own or one* whose visible text is cut off (`hintAllowed`, checked when the hint would open): a label the- * reader can already read in full gets no tooltip.+ * reader can already read in full gets no tooltip. Text that is not read as words does not+ * count — an SVG's own text (an avatar's initial) and anything `aria-hidden` (a letter or a+ * count drawn as an icon). The one exception is a hint marked as carrying what the screen does+ * not show — a consequence, a shortcut, the full value behind an abbreviation, what a state+ * means: `data-tooltip-extra`, or `<Tooltip extra>`, opens it over fully visible text. A hint+ * that only repeats the visible words is never marked, and never shows.** Two ways in, one panel:* - `<Tooltip label>` wraps its trigger in a measuring span — for a trigger that needs the@@ -19,8 +24,9 @@* root, which listens once on the document. It adds no wrapper, so it is what replaces a* `title` in place: a table cell, a truncated span or a flex child keeps its layout exactly.* `data-tooltip-content` picks the panel's kind, `data-tooltip-placement` its side- * (default `bottom`). Unlike `title`, it names nothing to assistive technology, so an- * element whose only name was its title carries an `aria-label` with the same words.+ * (default `bottom`), `data-tooltip-extra` marks the hint as adding to the visible text.+ * Unlike `title`, it names nothing to assistive technology, so an element whose only name+ * was its title carries an `aria-label` with the same words.** Portaled to document.body at fixed viewport coordinates, like every other overlay here* (see use-portal-panel.ts): an in-place absolute panel is a descendant of its trigger, so a@@ -90,6 +96,14 @@ const contentMaxWidth: Record<TooltipContent, string> = {/** The attribute `TooltipLayer` reads; its value is the panel's text. */export const TOOLTIP_ATTR = "data-tooltip";+/**+ * Marks a `data-tooltip` as carrying what the screen does not show, so it opens over text the+ * reader can see in full. Any value but `"false"` sets it, so `data-tooltip-extra={cond}`+ * reads as written; a shared component writes `{cond || undefined}`, leaving no attribute on+ * the instances that are not marked.+ */+export const TOOLTIP_EXTRA_ATTR = "data-tooltip-extra";+/** A box that may clip its content: the four numbers a truncation check reads. */export interface ClipBox {scrollWidth: number;@@ -112,14 +126,15 @@ export function isCutOff(box: ClipBox): boolean {/*** The tooltip rule: a hint shows only where its words are not already on screen — for an* element that shows no text of its own (an icon-only control, a chart mark, a status glyph)- * or one whose visible text is cut off. An element whose text is fully visible gets no hint,- * whatever it carries: a hint that repeats what the reader can see is noise, and one that- * adds to it hides that information behind a hover. `boxes` are the element and its- * descendants, measured when the hint would open, since a column resize can cut a label off- * or give it back at any time.+ * or one whose visible text is cut off. An element whose text is fully visible gets no hint:+ * one that repeats what the reader can see is noise. The exception is `extra`, a hint the+ * caller marked as carrying what the screen does not show (a consequence, a shortcut, the full+ * value behind an abbreviation, what a state means), which shows whatever the text. `boxes`+ * are the element and its descendants, measured when the hint would open, since a column+ * resize can cut a label off or give it back at any time.*/-export function hintAllowed(visibleText: string, boxes: Iterable<ClipBox>): boolean {- if (visibleText.trim() === "") return true;+export function hintAllowed(visibleText: string, boxes: Iterable<ClipBox>, extra = false): boolean {+ if (extra || visibleText.trim() === "") return true;for (const box of boxes) if (isCutOff(box)) return true;return false;}@@ -132,20 +147,64 @@ function unseen(node: Element | null): boolean {return check !== undefined && !check.call(node);}-/** `hintAllowed`, with its inputs read off the element at the moment the hint would open. */-export function hintAllowedFor(el: Element): boolean {+/** The part of a DOM node `readingText` walks; structural, so a hand-built tree serves too. */+export interface ReadingNode {+ nodeType: number;+ nodeValue: string | null;+ childNodes: ArrayLike<ReadingNode>;+ localName?: string;+ getAttribute?(name: string): string | null;+ classList?: { contains(token: string): boolean };+ checkVisibility?(): boolean;+}++const ELEMENT_NODE = 1;+const TEXT_NODE = 3;++/**+ * Whether an element's text is out of the reading: an SVG's (an avatar's initial is part of a+ * picture), anything hidden from assistive technology (a letter or a count drawn as an icon,+ * its control named elsewhere), screen-reader-only copy, and anything the page does not render.+ */+function outOfReading(el: ReadingNode): boolean {+ return (+ el.localName === "svg" ||+ el.getAttribute?.("aria-hidden") === "true" ||+ el.classList?.contains("sr-only") === true ||+ el.checkVisibility?.() === false+ );+}++/** The words a reader reads in a subtree: its text, minus any inside an element out of the reading. */+export function readingText(node: ReadingNode): string {+ if (node.nodeType === TEXT_NODE) return node.nodeValue ?? "";+ if (node.nodeType !== ELEMENT_NODE || outOfReading(node)) return "";let text = "";- const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);- for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {- if (!unseen(node.parentElement)) text += node.textContent ?? "";- }- const boxes: ClipBox[] = [];+ for (let i = 0; i < node.childNodes.length; i++) text += readingText(node.childNodes[i]!);+ return text;+}++/** Whether an element's `data-tooltip` is marked as adding to its visible text. */+function marksExtra(el: Pick<Element, "getAttribute">): boolean {+ const value = el.getAttribute(TOOLTIP_EXTRA_ATTR);+ return value !== null && value !== "false";+}++/** The boxes of an element and its descendants that can clip text, measured only as read. */+function* clipBoxes(el: Element): Generator<ClipBox> {for (const node of [el, ...el.querySelectorAll("*")]) {// An inline box or a hidden one has no area to clip, and a screen-reader-only span is// clipped on purpose — neither says the visible text was cut.- if (node instanceof HTMLElement && node.clientWidth > 0 && !unseen(node)) boxes.push(node);+ if (node instanceof HTMLElement && node.clientWidth > 0 && !unseen(node)) yield node;}- return hintAllowed(text, boxes);+}++/**+ * `hintAllowed`, with its inputs read off the element at the moment the hint would open;+ * `extra` is the caller's mark that the hint adds to the visible text.+ */+export function hintAllowedFor(el: Element, extra = false): boolean {+ return hintAllowed(readingText(el), clipBoxes(el), extra);}/** The trigger's viewport box — the part of a DOMRect the geometry reads. */@@ -221,6 +280,7 @@ export function Tooltip({label,placement = "right",content = "label",+ extra = false,suppressed,className,children,@@ -231,6 +291,8 @@ export function Tooltip({placement?: TooltipPlacement;/** What `label` is: a control's name (the default), or a truncated line of code shown whole. */content?: TooltipContent;+ /** `label` carries what the screen does not show (a shortcut, a consequence): open it over visible text too. */+ extra?: boolean;/*** Hold the panel closed and refuse to open it. For a trigger that owns something else on* screen while it is active: the rail avatar's open user menu hangs off the same corner,@@ -261,7 +323,7 @@ export function Tooltip({const trigger = anchorRef.current;// Measured now, not when the trigger rendered: whether its label is cut off depends on// the width it has at this moment.- if (trigger === null || !hintAllowedFor(trigger)) return;+ if (trigger === null || !hintAllowedFor(trigger, extra)) return;setAnchor(trigger.getBoundingClientRect());}, OPEN_DELAY_MS);};@@ -369,6 +431,8 @@ export interface TooltipRequest {label: string;content: TooltipContent;placement: TooltipPlacement;+ /** Marked `data-tooltip-extra`: the hint adds to the visible text, so it opens over it. */+ extra: boolean;}/** Reads an element's `data-tooltip` request, or null when it carries none (or an empty one). */@@ -381,6 +445,7 @@ export function tooltipRequest(el: Pick<Element, "getAttribute">): TooltipRequeslabel,content: content === "code" || content === "text" ? content : "label",placement: placement === "right" ? "right" : "bottom",+ extra: marksExtra(el),};}@@ -414,7 +479,8 @@ export function TooltipLayer() {timer = null;const el = current;const request = el === null ? null : tooltipRequest(el);- if (el === null || request === null || !el.isConnected || !hintAllowedFor(el)) return;+ if (el === null || request === null || !el.isConnected) return;+ if (!hintAllowedFor(el, request.extra)) return;setOpen({ ...request, anchor: el.getBoundingClientRect() });}, OPEN_DELAY_MS);};diff --git a/packages/ui/src/components/shell/session-row/session-row.tsx b/packages/ui/src/components/shell/session-row/session-row.tsxindex 86038064..1dc38ed3 100644--- a/packages/ui/src/components/shell/session-row/session-row.tsx+++ b/packages/ui/src/components/shell/session-row/session-row.tsx@@ -338,13 +338,15 @@ export function SessionRow({)}<StatusSlot activity={activity} />{/* A numeral in the attention ink, with no pill: a filled chip beside the title reads as- a second button. */}+ a second button. The numeral is a mark, so its words reach a screen reader as hidden+ text and a pointer as the hint. */}{approvals !== undefined && approvals.count > 0 && (<spandata-tooltip={approvals.label}className="shrink-0 text-xs font-semibold tabular-nums text-tone-attention-fg">- {approvals.count}+ <span aria-hidden>{approvals.count}</span>+ <span className="sr-only">{approvals.label}</span></span>)}</button>diff --git a/packages/ui/test/session-row.test.ts b/packages/ui/test/session-row.test.tsindex 88bb93a8..5b89f925 100644--- a/packages/ui/test/session-row.test.ts+++ b/packages/ui/test/session-row.test.ts@@ -87,7 +87,7 @@ describe("SessionRow", () => {expect(html).toContain('role="img" aria-label="定时任务"');expect(html).toContain('role="img" aria-label="2 个后台任务"');expect(html).toMatch(- /data-tooltip="3 个待审批" class="[^"]*tabular-nums text-tone-attention-fg">3</,+ /data-tooltip="3 个待审批" class="[^"]*tabular-nums text-tone-attention-fg"><span aria-hidden="true">3<\/span><span class="sr-only">3 个待审批<\/span>/,);});diff --git a/packages/ui/test/tag-input.test.ts b/packages/ui/test/tag-input.test.tsindex 1d91c76d..bebb8dcd 100644--- a/packages/ui/test/tag-input.test.ts+++ b/packages/ui/test/tag-input.test.ts@@ -15,7 +15,7 @@ describe("Chip", () => {createElement(Chip, { label: "notes.md", removeLabel: "Remove notes.md" }),);expect(removable).toContain('aria-label="Remove notes.md"');- expect(removable).toContain(">×</button>");+ expect(removable).toContain('<span aria-hidden="true">×</span></button>');const fixed = renderStatic(createElement(Chip, { label: "notes.md" }));expect(fixed).not.toContain("<button");});diff --git a/packages/ui/test/tooltip.test.ts b/packages/ui/test/tooltip.test.tsindex 7a385a28..c7112d47 100644--- a/packages/ui/test/tooltip.test.ts+++ b/packages/ui/test/tooltip.test.ts@@ -16,7 +16,9 @@* - Given a panel too tall for either side, then it takes the roomier one.** The rule: a hint shows for an element with no visible text of its own, or one whose visible- * text is cut off — never for a label the reader can already read in full.+ * text is cut off — never for a label the reader can already read in full. An SVG's text and+ * anything `aria-hidden` are not read as words; a hint marked as carrying what the screen does+ * not show (`data-tooltip-extra`) opens over visible text all the same.** The panel itself mounts only while hovered and through a portal, which a static render cannot* reach; what it may be drawn with (the overlay surface, token inks, the glass hook) is pinned@@ -34,7 +36,9 @@ import {hintAllowed,isCutOff,namedHint,+ readingText,tooltipRequest,+ type ReadingNode,} from "../src/components/overlays/tooltip/tooltip";import { renderStatic } from "../src/testing";import { SRC_DIR } from "./helpers/paths";@@ -145,6 +149,44 @@ describe("hintAllowed", () => {});});+describe("what counts as visible text, and the mark that overrides it", () => {+ const text = (value: string): ReadingNode => ({ nodeType: 3, nodeValue: value, childNodes: [] });+ const el = (+ localName: string,+ children: ReadingNode[],+ attrs: Record<string, string> = {},+ ): ReadingNode => ({+ nodeType: 1,+ nodeValue: null,+ localName,+ childNodes: children,+ getAttribute: (name) => attrs[name] ?? null,+ });++ it("skips an SVG's text and anything aria-hidden: an avatar's initial or a letter icon is no label", () => {+ const avatar = el("span", [el("svg", [el("text", [text("A")])])]);+ const caseToggle = el("button", [el("span", [text("Aa")], { "aria-hidden": "true" })]);+ const labelled = el("button", [text("Clear "), el("span", [text("exited")])]);+ expect(readingText(avatar)).toBe("");+ expect(readingText(caseToggle)).toBe("");+ expect(readingText(labelled)).toBe("Clear exited");+ expect(hintAllowed(readingText(avatar), [clip(16, 16)])).toBe(true);+ });++ it("opens a hint marked data-tooltip-extra over text that is fully visible, React's false left unmarked", () => {+ const request = (extra: string) => {+ const attrs: Record<string, string> = {+ "data-tooltip": "Their captured output is discarded too",+ "data-tooltip-extra": extra,+ };+ return tooltipRequest({ getAttribute: (name: string) => attrs[name] ?? null });+ };+ expect(request("true")?.extra).toBe(true);+ expect(request("false")?.extra).toBe(false);+ expect(hintAllowed("Clear exited", [clip(80, 80)], true)).toBe(true);+ });+});+describe("a data-tooltip request", () => {const el = (attrs: Record<string, string>) => ({getAttribute: (name: string) => attrs[name] ?? null,@@ -155,6 +197,7 @@ describe("a data-tooltip request", () => {label: "Rename",content: "label",placement: "bottom",+ extra: false,});expect(tooltipRequest(@@ -164,7 +207,7 @@ describe("a data-tooltip request", () => {"data-tooltip-placement": "right",}),),- ).toEqual({ label: "npm run dev", content: "code", placement: "right" });+ ).toEqual({ label: "npm run dev", content: "code", placement: "right", extra: false });});it("asks for nothing when the text is missing or blank", () => {diff --git a/packages/web/src/components/layout/sidebar.tsx b/packages/web/src/components/layout/sidebar.tsxindex 66a76e01..c309fcb6 100644--- a/packages/web/src/components/layout/sidebar.tsx+++ b/packages/web/src/components/layout/sidebar.tsx@@ -2448,6 +2448,8 @@ export function Sidebar({surface="muted"label={S.chat.newSessionMenu}tooltip={newChatTitle}+ // The title adds the shortcut when one is bound.+ tooltipExtra={newChatTitle !== S.chat.newSessionMenu}glyph={NEW_CHAT_ICON}active={activeSessionId === DRAFT_SESSION_ID}onClick={() => newChat()}diff --git a/packages/web/src/features/agents/agents-page.tsx b/packages/web/src/features/agents/agents-page.tsxindex 20a91bb4..691b1ec0 100644--- a/packages/web/src/features/agents/agents-page.tsx+++ b/packages/web/src/features/agents/agents-page.tsx@@ -580,6 +580,7 @@ export function AgentsPage() {<spanclassName="shrink-0 font-mono text-xs normal-case text-gray-400 dark:text-gray-500"data-tooltip={elsewhereTitle}+ data-tooltip-extra>{S.chat.machineTag(machineName)}</span>@@ -692,6 +693,7 @@ export function AgentsPage() {<spanclassName="inline-flex shrink-0 items-center gap-1"data-tooltip={`${S.agent.updatedAt} ${a.updatedAt ? formatDateTime(a.updatedAt) : "—"}`}+ data-tooltip-extra={Boolean(a.updatedAt)}><GlyphIcon d={STAT_ICONS.elapsed} size={ICON_SIZE.inlineGlyph} />{a.updatedAt ? formatRelativeDays(a.updatedAt, locale) : "—"}@@ -726,7 +728,7 @@ export function AgentsPage() {<Buttonsize="sm"disabled={elsewhere}- {...(elsewhere ? { title: elsewhereTitle } : {})}+ {...(elsewhere ? { title: elsewhereTitle, "data-tooltip-extra": true } : {})}onClick={() => {setCurrentAgentId(a.agentId);navigate(`/agents/${a.agentId}`);diff --git a/packages/web/src/features/agents/mcp-servers-section.tsx b/packages/web/src/features/agents/mcp-servers-section.tsxindex b98a2165..44e39fe2 100644--- a/packages/web/src/features/agents/mcp-servers-section.tsx+++ b/packages/web/src/features/agents/mcp-servers-section.tsx@@ -106,6 +106,7 @@ function TestBadge({ result }: { result: RowTestResult | undefined }) {return (<spandata-tooltip={result.error}+ data-tooltip-extraclassName={`text-xs font-medium whitespace-nowrap ${toneInk.danger}`}>{S.agent.mcpTestBadgeFail}diff --git a/packages/web/src/features/agents/memory-tab.tsx b/packages/web/src/features/agents/memory-tab.tsxindex 0d6505d7..01071a56 100644--- a/packages/web/src/features/agents/memory-tab.tsx+++ b/packages/web/src/features/agents/memory-tab.tsx@@ -622,6 +622,7 @@ export function MemoryTab({size="sm"variant="ghost"title={S.memory.exportScopeHint}+ data-tooltip-extraaria-label={S.memory.exportScopeLabel(scopeTitle(scope))}onClick={() => void exportScope(scope)}>@@ -632,6 +633,7 @@ export function MemoryTab({<labelclassName={`${GHOST_LABEL_CLASS} shrink-0`}data-tooltip={S.memory.importScopeHint}+ data-tooltip-extraaria-label={S.memory.importScopeLabel(scopeTitle(scope))}><HiddenFileInput@@ -713,6 +715,7 @@ export function MemoryTab({)}data-tooltip={S.memory.insertToken}+ data-tooltip-extraclassName="shrink-0 rounded border border-gray-200 bg-white px-1.5 py-0.5 font-mono font-semibold text-gray-800 transition-colors duration-150 hover:border-gray-400 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:hover:border-gray-500 dark:hover:bg-gray-700">{token}diff --git a/packages/web/src/features/agents/schedules-tab.tsx b/packages/web/src/features/agents/schedules-tab.tsxindex f921f259..1cce268a 100644--- a/packages/web/src/features/agents/schedules-tab.tsx+++ b/packages/web/src/features/agents/schedules-tab.tsx@@ -208,7 +208,7 @@ export function SchedulesTab({</TableCell><TableCell nowrap>{/* invalid reason is folded into the hover title. */}- <span data-tooltip={item.invalidReason}>+ <span data-tooltip={item.invalidReason} data-tooltip-extra><Badge {...STATUS_BADGE[item.status]}>{S.schedule.statusNames[item.status] ?? item.status}</Badge>diff --git a/packages/web/src/features/agents/skills-tab.tsx b/packages/web/src/features/agents/skills-tab.tsxindex c1f4f5d6..52747469 100644--- a/packages/web/src/features/agents/skills-tab.tsx+++ b/packages/web/src/features/agents/skills-tab.tsx@@ -279,6 +279,7 @@ export function SkillsTab({className="mt-0.5 truncate text-xs text-gray-500 dark:text-gray-400"data-tooltip={skill.description}data-tooltip-content="text"+ data-tooltip-extra={skill.description !== localizedShortText(locale, skill)}>{localizedShortText(locale, skill)}</p>diff --git a/packages/web/src/features/benchmark/benchmark-page.tsx b/packages/web/src/features/benchmark/benchmark-page.tsxindex 0a07e5d4..913e4570 100644--- a/packages/web/src/features/benchmark/benchmark-page.tsx+++ b/packages/web/src/features/benchmark/benchmark-page.tsx@@ -132,6 +132,8 @@ function TestedAgents({<divclassName="hidden shrink-0 sm:flex"data-tooltip={`${S.benchmark.testedAgents}: ${agentIds.map(nameOf).join(", ")}`}+ // The avatars name no one, and past the cap a "+N" stands for the rest.+ data-tooltip-extra><AvatarStackitems={agentIds.map((agentId) => ({ id: agentId, name: nameOf(agentId) }))}diff --git a/packages/web/src/features/builtin-browser/browser-tab-strip.tsx b/packages/web/src/features/builtin-browser/browser-tab-strip.tsxindex 82ed8aa3..df949c56 100644--- a/packages/web/src/features/builtin-browser/browser-tab-strip.tsx+++ b/packages/web/src/features/builtin-browser/browser-tab-strip.tsx@@ -121,6 +121,7 @@ export function BrowserTabStrip({role="tab"aria-selected={active}data-tooltip={title}+ data-tooltip-extra={lines.length > 1}onClick={() => onSelect(tab.id)}// A middle click closes a tab, as in every browser.onAuxClick={(event) => {diff --git a/packages/web/src/features/chat/chat-input.tsx b/packages/web/src/features/chat/chat-input.tsxindex dd172a0e..a1138f59 100644--- a/packages/web/src/features/chat/chat-input.tsx+++ b/packages/web/src/features/chat/chat-input.tsx@@ -305,6 +305,7 @@ function SteerModeRow({<buttontype="button"data-tooltip={hint}+ data-tooltip-extraaria-pressed={steerMode === mode}onClick={() => onChangeSteerMode(mode)}className={`h-5 rounded px-1.5 text-xs transition-colors duration-150 ${@@ -1987,6 +1988,7 @@ export function ChatInput({/>),tooltip: S.chat.handoffTargetTitle(agentDisplayName(target)),+ tooltipExtra: true,removeLabel: S.chat.handoffRemove,},]@@ -2000,6 +2002,7 @@ export function ChatInput({<ProviderLogo provider={pendingModel.provider} className="h-3.5 w-3.5 shrink-0" />),tooltip: S.chat.modelSwitchTargetTitle(modelLabel(pendingModel)),+ tooltipExtra: true,removeLabel: S.chat.modelSwitchRemove,},]@@ -2011,7 +2014,7 @@ export function ChatInput({label: name,mono: true,glyph: <SkillIcon icon={meta?.icon} size={13} className="shrink-0 text-fg-muted" />,- ...(meta ? { tooltip: localizedShortText(locale, meta) } : {}),+ ...(meta ? { tooltip: localizedShortText(locale, meta), tooltipExtra: true } : {}),removeLabel: `${S.chat.skillRemove} ${name}`,};}),@@ -2355,6 +2358,7 @@ export function ChatInput({label={S.chat.goalMode}glyph={<GlyphIcon d={GOAL_ICON} size={13} className="text-fg-muted" />}tooltip={S.chat.goalModeDesc}+ tooltipExtraremoveLabel={S.chat.goalRemove}onRemove={() => toggleGoal(false)}control={goalBudgetPicker}@@ -2557,6 +2561,7 @@ export function ChatInput({fields (no prefix parsing). */<spandata-tooltip={modelRef?.modelId ?? ""}+ data-tooltip-extra={lockedModelLabel !== modelRef?.modelId}className="flex h-8 min-w-0 max-w-44 shrink items-center gap-1.5 rounded-md px-1 text-gray-400 dark:text-gray-500"><ProviderLogodiff --git a/packages/web/src/features/chat/chat-page.tsx b/packages/web/src/features/chat/chat-page.tsxindex 8826e14c..f806de23 100644--- a/packages/web/src/features/chat/chat-page.tsx+++ b/packages/web/src/features/chat/chat-page.tsx@@ -2407,6 +2407,7 @@ export function ChatPage() {<buttontype="button"data-tooltip={S.chat.processClearExitedHint}+ data-tooltip-extradisabled={procBusy !== null}onClick={() => void onClearExitedProcesses()}className="shrink-0 cursor-pointer text-xs text-gray-400 transition-colors duration-150 hover:text-gray-600 disabled:cursor-default disabled:opacity-60 dark:text-gray-500 dark:hover:text-gray-300"@@ -2475,6 +2476,7 @@ export function ChatPage() {<buttontype="button"data-tooltip={S.chat.processRemoveHint}+ data-tooltip-extradisabled={procBusy !== null}onClick={() => void onRemoveProcess(p.processId)}className="shrink-0 rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-600 transition-colors duration-150 hover:border-red-200 hover:bg-red-50 hover:text-red-600 disabled:cursor-default disabled:opacity-60 dark:border-gray-700 dark:text-gray-300 dark:hover:border-red-900 dark:hover:bg-red-950/40 dark:hover:text-red-400"diff --git a/packages/web/src/features/chat/context-gauge.tsx b/packages/web/src/features/chat/context-gauge.tsxindex bee56bbc..cde8c725 100644--- a/packages/web/src/features/chat/context-gauge.tsx+++ b/packages/web/src/features/chat/context-gauge.tsx@@ -514,6 +514,7 @@ function ContextPanel({ranking === "tools" ? S.chat.contextTopToolsHint : S.chat.contextTopFilesHint}data-tooltip-content="text"+ data-tooltip-extraclassName="min-w-0 truncate text-gray-400 dark:text-gray-500">{ranking === "tools" ? S.chat.contextTopTools : S.chat.contextTopFiles}diff --git a/packages/web/src/features/chat/draft-view.tsx b/packages/web/src/features/chat/draft-view.tsxindex 9719d9fe..90bf1e0d 100644--- a/packages/web/src/features/chat/draft-view.tsx+++ b/packages/web/src/features/chat/draft-view.tsx@@ -1013,6 +1013,7 @@ function VersionBadge() {type="button"onClick={openUpdateModal}data-tooltip={note}+ data-tooltip-extraaria-label={note}className={`${versionBadgeClass} hover:underline`}>diff --git a/packages/web/src/features/chat/memory-view.tsx b/packages/web/src/features/chat/memory-view.tsxindex d512c9b3..e434f52e 100644--- a/packages/web/src/features/chat/memory-view.tsx+++ b/packages/web/src/features/chat/memory-view.tsx@@ -229,6 +229,7 @@ export function ChatMemoryView({className="min-w-0 flex-1 truncate text-xs text-gray-500 dark:text-gray-400"data-tooltip={group.workspacePath}data-tooltip-content="text"+ data-tooltip-extra>{groupTitle(group)}</p>diff --git a/packages/web/src/features/chat/model-picker-modal.tsx b/packages/web/src/features/chat/model-picker-modal.tsxindex 6e1f33df..4e8a14e1 100644--- a/packages/web/src/features/chat/model-picker-modal.tsx+++ b/packages/web/src/features/chat/model-picker-modal.tsx@@ -258,6 +258,7 @@ function ModelPickerBody({type="button"tabIndex={-1}data-tooltip={label === m.modelId ? label : `${label} · ${m.modelId}`}+ data-tooltip-extra={label !== m.modelId}// Mouse movement, not mouseenter: rows scrolling under a resting pointer while the// keyboard drives the list must not steal the highlight.onMouseMove={isHighlighted ? undefined : onHover}@@ -354,6 +355,7 @@ function ModelPickerBody({tabIndex={-1}aria-current={active ? "true" : undefined}data-tooltip={i < 9 ? `${g.provider.label} · ${mod}${i + 1}` : g.provider.label}+ data-tooltip-extra={i < 9}onClick={() => activateGroup(i, "rail")}className={`flex shrink-0 items-center gap-2 whitespace-nowrap rounded-full border px-2.5 py-1 text-sm transition-colors duration-150 sm:w-full sm:rounded-md sm:border-transparent sm:py-1.5 sm:dark:border-transparent ${activediff --git a/packages/web/src/features/chat/permission-select.tsx b/packages/web/src/features/chat/permission-select.tsxindex 71619bd5..ee121d67 100644--- a/packages/web/src/features/chat/permission-select.tsx+++ b/packages/web/src/features/chat/permission-select.tsx@@ -109,6 +109,7 @@ function Choice({checked={selected}disabled={unavailable}data-tooltip={hint}+ data-tooltip-extratrailing={unavailable ? (note ?? S.chat.permission.unsupported) : undefined}onSelect={onPick}/>@@ -261,6 +262,7 @@ export function PermissionSelect({<divrole="presentation"data-tooltip={P.advancedHint}+ data-tooltip-extraclassName="px-3 pt-1 pb-1.5 text-xs font-medium text-fg-subtle">{P.advancedActive}diff --git a/packages/web/src/features/chat/reference-chip.tsx b/packages/web/src/features/chat/reference-chip.tsxindex 188f6190..9c5fa0ff 100644--- a/packages/web/src/features/chat/reference-chip.tsx+++ b/packages/web/src/features/chat/reference-chip.tsx@@ -71,6 +71,7 @@ export function ReferenceChip({/>}tooltip={title}+ tooltipExtramono// An excerpt is named by its label here: its tooltip is the whole passage, which is far too// long to announce as the name of a remove button.diff --git a/packages/web/src/features/chat/shortcuts-folder.tsx b/packages/web/src/features/chat/shortcuts-folder.tsxindex 4aacc65a..19bc1cf7 100644--- a/packages/web/src/features/chat/shortcuts-folder.tsx+++ b/packages/web/src/features/chat/shortcuts-folder.tsx@@ -167,6 +167,8 @@ export function ShortcutsFolder({<buttontype="button"data-tooltip={`${shortcut.title}\n${S.chat.shortcutFillHint}`}+ // The hint says what the click does to the composer, which the label cannot.+ data-tooltip-extraonClick={() => onFill(shortcut.prompt)}className={`flex min-w-0 flex-1 items-center gap-2 ${folderRowClass}`}>diff --git a/packages/web/src/features/chat/subagents-view.tsx b/packages/web/src/features/chat/subagents-view.tsxindex 6aef370e..cc4be445 100644--- a/packages/web/src/features/chat/subagents-view.tsx+++ b/packages/web/src/features/chat/subagents-view.tsx@@ -258,6 +258,7 @@ export function SubagentsView({</span><spandata-tooltip={active.sessionId}+ data-tooltip-extraclassName="shrink-0 font-mono text-xs text-fg-subtle">{shortSessionId(active.sessionId)}diff --git a/packages/web/src/features/chat/workspace-browser.tsx b/packages/web/src/features/chat/workspace-browser.tsxindex aca674ed..a312ef95 100644--- a/packages/web/src/features/chat/workspace-browser.tsx+++ b/packages/web/src/features/chat/workspace-browser.tsx@@ -2335,6 +2335,7 @@ export function WorkspaceBrowser({<spanclassName={`shrink-0 text-xs ${toneInk.attention}`}data-tooltip={S.files.changedOnDiskHint}+ data-tooltip-extra>{S.files.changedOnDisk}</span>diff --git a/packages/web/src/features/chat/workspace-finder.tsx b/packages/web/src/features/chat/workspace-finder.tsxindex e7217e16..ce07869a 100644--- a/packages/web/src/features/chat/workspace-finder.tsx+++ b/packages/web/src/features/chat/workspace-finder.tsx@@ -1022,6 +1022,8 @@ export function WorkspaceFinder({<buttontype="button"data-tooltip={fullTitle}+ // A row whose hint is the path says more than the name it shows, so it opens over it.+ data-tooltip-extra={fullTitle !== label || undefined}disabled={disabled}aria-current={active ? "location" : undefined}data-finder-focus@@ -1323,6 +1325,7 @@ export function WorkspaceFinder({? {"aria-current": "page" as const,"data-tooltip": `${f.editPath} (${editChord})`,+ "data-tooltip-extra": true,}: {})}className={`rounded px-1 py-0.5 transition-colors duration-150 ${@@ -1582,6 +1585,9 @@ export function WorkspaceFinder({aria-selected={isSel}aria-disabled={folder ? undefined : true}data-tooltip={folder ? entry.path : f.fileNotSelectable}+ // A file row is not selectable: that is what its hint says, and the name it+ // shows cannot.+ data-tooltip-extra={!folder}data-finder-path={entry.path}data-finder-kind={folder ? "folder" : "file"}onClick={() => {@@ -1661,6 +1667,7 @@ export function WorkspaceFinder({<Buttonsize="sm"title={clear.fullPath ?? clearTitle}+ data-tooltip-extraclassName="mr-auto min-w-0 self-center"onClick={() => onClear?.(machine)}>@@ -1677,6 +1684,7 @@ export function WorkspaceFinder({className="shrink-0 self-center whitespace-nowrap"disabled={chooseTarget === null || loading}title={chooseTarget ?? undefined}+ data-tooltip-extraonClick={choose}>{f.choose}diff --git a/packages/web/src/features/chat/workspace-select.tsx b/packages/web/src/features/chat/workspace-select.tsxindex 0ee14c57..eaeaa5e0 100644--- a/packages/web/src/features/chat/workspace-select.tsx+++ b/packages/web/src/features/chat/workspace-select.tsx@@ -89,6 +89,8 @@ export function WorkspaceSelect({const label = trimmed ? baseName(trimmed) : (emptyLabel ?? S.chat.workspaceAuto);// The field and its value, the whole path where the label shows only its last segment.const title = `${fieldName}:${trimmed || label}`;+ // The label keeps only the last segment: the tooltip is where the rest of the path shows.+ const pathHidden = trimmed !== "" && trimmed !== label;const finder = (<WorkspaceFinder@@ -147,6 +149,7 @@ export function WorkspaceSelect({label={label}{...(trimmed ? { labelClassName: "font-mono" } : {})}title={title}+ titleExtra={pathHidden}ariaLabel={fieldName}ariaHaspopup="dialog"/>@@ -161,6 +164,7 @@ export function WorkspaceSelect({<buttontype="button"data-tooltip={title}+ data-tooltip-extra={pathHidden}aria-label={fieldName}aria-haspopup="dialog"aria-expanded={open}diff --git a/packages/web/src/features/company/calendar-page.tsx b/packages/web/src/features/company/calendar-page.tsxindex 7b9f1ce5..056b3795 100644--- a/packages/web/src/features/company/calendar-page.tsx+++ b/packages/web/src/features/company/calendar-page.tsx@@ -413,6 +413,7 @@ export function CalendarPage() {key={i.key}type="button"data-tooltip={title}+ data-tooltip-extraonClick={() => {opts.onOpen?.();openEdit(i.event);@@ -771,6 +772,7 @@ export function CalendarPage() {data-tooltip={active ? S.company.calendar.allEmployees : S.company.calendar.legendFilter(e.name)}+ data-tooltip-extraaria-pressed={active}onClick={() => setEmployeeFilter(active ? "" : e.agentId)}className={`inline-flex max-w-full items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition-colors duration-150 hover:bg-gray-100 dark:hover:bg-gray-800 ${@@ -793,6 +795,7 @@ export function CalendarPage() {className={`truncate ${struck ? "text-gray-400 dark:text-gray-500" : "text-gray-500 dark:text-gray-400"}`}data-tooltip={cadences.join(" · ")}data-tooltip-content="text"+ data-tooltip-extra={rest > 0}>{cadences.length === 0? S.company.calendar.legendEmptydiff --git a/packages/web/src/features/company/channel-view.tsx b/packages/web/src/features/company/channel-view.tsxindex 2c05993b..3b39ea6f 100644--- a/packages/web/src/features/company/channel-view.tsx+++ b/packages/web/src/features/company/channel-view.tsx@@ -509,6 +509,7 @@ export function ChannelView() {<div key={m.id} id={m.id} className="my-2 flex justify-center"><pdata-tooltip={formatDateTime(m.time)}+ data-tooltip-extraclassName="max-w-[85%] rounded-md border border-gray-200 bg-gray-50 px-3 py-1.5 text-center text-xs leading-relaxed text-gray-500 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-400"><span className="sr-only">{S.company.channels.systemMessage} </span>@@ -550,7 +551,11 @@ export function ChannelView() {// The relay chip names what it is and carries the @-chain rule in its tooltip: "hop 3"// alone tells a reader nothing about why a message arrived.hopChipShown(item.hop) ? (- <span data-tooltip={S.company.channels.hopInfo} className="text-fg-muted">+ <span+ data-tooltip={S.company.channels.hopInfo}+ data-tooltip-extra+ className="text-fg-muted"+ >{S.company.channels.hop(item.hop)}</span>) : undefined@@ -741,6 +746,7 @@ function RefChip({<buttontype="button"data-tooltip={title}+ data-tooltip-extraonClick={onClick}className={`inline-flex items-center ${ICON_GAP.tight} rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs text-gray-600 transition-colors duration-150 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100`}>diff --git a/packages/web/src/features/company/chart-card.tsx b/packages/web/src/features/company/chart-card.tsxindex cd7aa9f0..d2f8e558 100644--- a/packages/web/src/features/company/chart-card.tsx+++ b/packages/web/src/features/company/chart-card.tsx@@ -162,12 +162,14 @@ export function ChartCard({className="group absolute"style={{ left: x, top: y, width: CHART_NODE_W, height: CHART_NODE_H }}>- {/* The tooltip carries what the two truncating lines may have cut, and nothing else:- the face has no click of its own, so it must not promise one either. */}+ {/* The tooltip carries what the two truncating lines may have cut, and why a flagged card+ is flagged — nothing else: the face has no click of its own, so it must not promise+ one either. */}<divdata-tooltip={flag !== undefined ? `${employee.name} · ${flag}` : `${employee.name} · ${employee.title}`}+ data-tooltip-extra={flag !== undefined}className={`absolute inset-0 flex flex-col rounded-lg border bg-white px-3 py-2.5 shadow-sm dark:bg-gray-900 ${flagged ? "border-red-300 dark:border-red-800" : "border-gray-200 dark:border-gray-700"}`}@@ -191,6 +193,7 @@ export function ChartCard({<spanclassName="flex min-w-0 flex-1 items-center gap-1 font-mono text-fg-subtle"data-tooltip={flag ?? employee.resolvedWorkspace ?? employee.workspace}+ data-tooltip-extra>{flag !== undefined ? (<span className={toneInk.danger}>@@ -206,6 +209,7 @@ export function ChartCard({tone === "attention" || tone === "danger" ? `font-medium ${toneInk[tone]}` : ""}`}data-tooltip={spendTitle}+ data-tooltip-extra>{spend}</span>diff --git a/packages/web/src/features/company/finance-page.tsx b/packages/web/src/features/company/finance-page.tsxindex 9832730b..b74a9e7c 100644--- a/packages/web/src/features/company/finance-page.tsx+++ b/packages/web/src/features/company/finance-page.tsx@@ -554,6 +554,7 @@ export function FinancePage() {},(value) => formatMoney(value, currency),)}+ data-tooltip-extra><TableCell style={{ paddingLeft: 8 + depth * INDENT_PX }}><span className={`flex min-w-0 items-center ${ICON_GAP.row}`}>diff --git a/packages/web/src/features/company/handbook-page.tsx b/packages/web/src/features/company/handbook-page.tsxindex 50cb2c88..d5cbcb9b 100644--- a/packages/web/src/features/company/handbook-page.tsx+++ b/packages/web/src/features/company/handbook-page.tsx@@ -363,6 +363,7 @@ export function HandbookPage() {formatDateTime(selectedFile.updatedAt),formatBytes(selectedFile.size),)}+ data-tooltip-extra>{formatRelativeShort(selectedFile.updatedAt, locale)}</span>diff --git a/packages/web/src/features/company/overview-page.tsx b/packages/web/src/features/company/overview-page.tsxindex e8674591..3db389b4 100644--- a/packages/web/src/features/company/overview-page.tsx+++ b/packages/web/src/features/company/overview-page.tsx@@ -578,6 +578,8 @@ export function OverviewPage() {data-tooltip={S.company.overview.openColumn(S.company.tickets.columns[seg.status] ?? seg.status,)}+ // The hint says what the click opens, which the count above it cannot.+ data-tooltip-extraonClick={() => page("tickets", `?column=${seg.status}`)}className={`inline-flex items-center ${ICON_GAP.tight} rounded px-1 text-xs transition-colors duration-150 hover:bg-gray-100 dark:hover:bg-gray-800`}>@@ -753,7 +755,9 @@ export function OverviewPage() {)}<spanclassName="w-20 shrink-0 text-right text-xs tabular-nums text-gray-400 dark:text-gray-500"- {...(row.time !== null ? { "data-tooltip": formatDateTime(row.time) } : {})}+ {...(row.time !== null+ ? { "data-tooltip": formatDateTime(row.time), "data-tooltip-extra": true }+ : {})}>{row.time === null ? "—" : formatRelativeShort(row.time, locale)}</span>diff --git a/packages/web/src/features/company/path-capsule.tsx b/packages/web/src/features/company/path-capsule.tsxindex 0932dffb..7e97ba62 100644--- a/packages/web/src/features/company/path-capsule.tsx+++ b/packages/web/src/features/company/path-capsule.tsx@@ -35,6 +35,7 @@ export function PathCapsule({ path }: { path: string }) {<buttontype="button"data-tooltip={copied ? S.common.copied : S.company.pathCapsule.hint(path)}+ data-tooltip-extraaria-label={S.company.pathCapsule.copy(path)}onClick={() => flash(path)}// Baseline-aligned on the label, so the capsule sits on the sentence's line; the glyphdiff --git a/packages/web/src/features/company/shared.tsx b/packages/web/src/features/company/shared.tsxindex 92dc9d7a..0e6ac53d 100644--- a/packages/web/src/features/company/shared.tsx+++ b/packages/web/src/features/company/shared.tsx@@ -132,7 +132,9 @@ export function OrgStatusPill({ org }: { org: { status: OrgStatus; invalid?: strconst kind = orgStatusKind(org);return (<span- {...(org.invalid !== undefined ? { "data-tooltip": org.invalid } : {})}+ {...(org.invalid !== undefined+ ? { "data-tooltip": org.invalid, "data-tooltip-extra": true }+ : {})}className="inline-flex"><Badge tone={ORG_STATUS_BADGE[kind]}>{orgStatusLabel(kind)}</Badge>@@ -404,6 +406,7 @@ export function BlockedBadge({ reason, by }: { reason: string; by?: string }) {return (<spandata-tooltip={S.company.tickets.blockedTooltip(reason, by ?? "—")}+ data-tooltip-extraclassName="inline-flex"><Badge tone="attention">{S.company.tickets.blocked}</Badge>diff --git a/packages/web/src/features/company/tickets-page.tsx b/packages/web/src/features/company/tickets-page.tsxindex dd9bbee5..eb094cfd 100644--- a/packages/web/src/features/company/tickets-page.tsx+++ b/packages/web/src/features/company/tickets-page.tsx@@ -263,6 +263,7 @@ export function TicketsPage() {data-tooltip={overdue ? `${S.company.tickets.overdue} · ${t.due}` : S.company.tickets.due}+ data-tooltip-extra={overdue}><GlyphIcon d={ICONS.clockCompact} size={ICON_SIZE.inlineGlyph} />{t.due}diff --git a/packages/web/src/features/machines/machines-page.tsx b/packages/web/src/features/machines/machines-page.tsxindex e65fb251..be851f02 100644--- a/packages/web/src/features/machines/machines-page.tsx+++ b/packages/web/src/features/machines/machines-page.tsx@@ -433,6 +433,7 @@ export function MachinesPage() {<Verblabel={showAll ? S.machines.fewer : S.machines.expand}title={showAll ? S.machines.fewer : S.machines.allHosts(hiddenCount)}+ titleExtra={!showAll}d={CHEVRON_PATH}glyphClass={showAll ? "rotate-180" : ""}ariaExpanded={showAll}@@ -599,6 +600,7 @@ function Verb({onClick,variant = "secondary",title,+ titleExtra = false,glyphClass = "",ariaExpanded,wordless = false,@@ -609,6 +611,8 @@ function Verb({onClick: () => void;variant?: "secondary" | "danger";title?: string;+ /** `title` says what the word does not (how many hosts the click shows): it shows over the word. */+ titleExtra?: boolean;glyphClass?: string;ariaExpanded?: boolean;wordless?: boolean;@@ -638,6 +642,7 @@ function Verb({variant={variant}disabled={disabled}title={title ?? label}+ data-tooltip-extra={titleExtra}aria-expanded={ariaExpanded}className="whitespace-nowrap"onClick={click}diff --git a/packages/web/src/features/messaging/messaging-binding-editor.tsx b/packages/web/src/features/messaging/messaging-binding-editor.tsxindex ad8e829c..3515608b 100644--- a/packages/web/src/features/messaging/messaging-binding-editor.tsx+++ b/packages/web/src/features/messaging/messaging-binding-editor.tsx@@ -809,6 +809,7 @@ export function MessagingBindingBody({ b }: { b: MessagingBindingEditorState })<labelclassName="flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300"data-tooltip={S.messaging.bindByEnableHint}+ data-tooltip-extra>{/* Natively disabled only while a request is in flight. A missing prerequisitedims it the same way but leaves it clickable (aria-disabled), because adiff --git a/packages/web/src/features/messaging/qq-scan-connect.tsx b/packages/web/src/features/messaging/qq-scan-connect.tsxindex cd52d2ec..30b13d93 100644--- a/packages/web/src/features/messaging/qq-scan-connect.tsx+++ b/packages/web/src/features/messaging/qq-scan-connect.tsx@@ -273,7 +273,7 @@ export function QQScanConnect({<Buttonsize="sm"disabled={phase.kind === "starting" || enabled}- {...(enabled ? { title: S.qq.scanDisableFirst } : {})}+ {...(enabled ? { title: S.qq.scanDisableFirst, "data-tooltip-extra": true } : {})}onClick={() => void start(false)}>{phase.kind === "starting" ? S.qq.scanStarting : S.qq.scanStart}diff --git a/packages/web/src/features/messaging/wechat-scan-connect.tsx b/packages/web/src/features/messaging/wechat-scan-connect.tsxindex 1d7ac557..38c64f42 100644--- a/packages/web/src/features/messaging/wechat-scan-connect.tsx+++ b/packages/web/src/features/messaging/wechat-scan-connect.tsx@@ -296,7 +296,7 @@ export function WeChatScanConnect({<Buttonsize="sm"disabled={phase.kind === "starting" || enabled}- {...(enabled ? { title: S.wechat.scanDisableFirst } : {})}+ {...(enabled ? { title: S.wechat.scanDisableFirst, "data-tooltip-extra": true } : {})}onClick={() => void start(false)}>{phase.kind === "starting"diff --git a/packages/web/src/features/models/models-page.tsx b/packages/web/src/features/models/models-page.tsxindex 1c902109..807df1c3 100644--- a/packages/web/src/features/models/models-page.tsx+++ b/packages/web/src/features/models/models-page.tsx@@ -2111,6 +2111,7 @@ function AddGroupDialog({disabled={busy}onClick={() => void detect()}title={S.models.detectProtocolHint}+ data-tooltip-extraclassName="shrink-0">{detecting ? S.models.detecting : S.models.detectProtocol}@@ -2288,6 +2289,7 @@ export function ModelCard({<spanclassName="shrink-0 text-xs font-medium text-red-600 dark:text-red-400"data-tooltip={speed.message}+ data-tooltip-extra>{S.models.speedFailed}</span>@@ -3279,6 +3281,8 @@ function ModelDialog({<Buttonsize="sm"title={S.models.visionModelHint}+ // The hint says what setting this model as the vision one does, which its label cannot.+ data-tooltip-extraonClick={() => setConfirming("setVisionModel")}>{S.models.setVisionModel}@@ -3631,6 +3635,7 @@ function ModelDialog({loading={visionDetecting}onClick={() => void detectVisionFromButton()}title={S.models.detectVisionHint}+ data-tooltip-extraclassName="shrink-0">{visionDetecting ? S.models.detectingVision : S.models.detectVision}@@ -3657,6 +3662,7 @@ function ModelDialog({<labelclassName={`inline-flex items-center gap-2 ${canEdit ? "cursor-pointer" : "cursor-not-allowed"}`}data-tooltip={S.models.fastModeHint}+ data-tooltip-extra><span className="text-xs font-semibold text-gray-600 dark:text-gray-400">{S.models.fastMode}diff --git a/packages/web/src/features/models/protocol-suffix.tsx b/packages/web/src/features/models/protocol-suffix.tsxindex 119edb7d..e75fa09c 100644--- a/packages/web/src/features/models/protocol-suffix.tsx+++ b/packages/web/src/features/models/protocol-suffix.tsx@@ -83,6 +83,7 @@ export function ProtocolSuffixMenu({aria-expanded={open}aria-label={`${S.models.protocol}: ${name}`}data-tooltip={S.models.protocolTriggerTitle(name)}+ data-tooltip-extraonClick={() => setOpen((v) => !v)}className={"flex items-center gap-1 rounded px-1 py-0.5 font-mono text-xs transition-colors duration-150 " +diff --git a/packages/web/src/features/schedules/schedule-form-modal.tsx b/packages/web/src/features/schedules/schedule-form-modal.tsxindex 8f28681d..5afe9598 100644--- a/packages/web/src/features/schedules/schedule-form-modal.tsx+++ b/packages/web/src/features/schedules/schedule-form-modal.tsx@@ -146,6 +146,7 @@ function SessionSelect({label={label}muted={!value}title={value ? `${S.schedule.sessionId}:${value}` : S.schedule.chooseSession}+ titleExtra={selected !== null}ariaLabel={S.schedule.chooseSession}ariaHaspopup="listbox"menuClass="w-80 origin-top-left"diff --git a/packages/web/src/features/settings/plugin-config-field-cell.tsx b/packages/web/src/features/settings/plugin-config-field-cell.tsxindex e1fed82e..49940caa 100644--- a/packages/web/src/features/settings/plugin-config-field-cell.tsx+++ b/packages/web/src/features/settings/plugin-config-field-cell.tsx@@ -118,6 +118,7 @@ export function Cell({// without a role is not announced.<spandata-tooltip={S.settings.pluginCellLocked}+ data-tooltip-extraclassName="block px-1.5 text-xs break-words text-fg-muted">{shown}diff --git a/packages/web/src/features/traces/trace-panel.tsx b/packages/web/src/features/traces/trace-panel.tsxindex 8efdb9eb..11d751fe 100644--- a/packages/web/src/features/traces/trace-panel.tsx+++ b/packages/web/src/features/traces/trace-panel.tsx@@ -150,6 +150,7 @@ export function TracePanel({type="button"onClick={() => setFileIndex(f.index)}data-tooltip={`${f.date} · ${formatBytes(f.sizeBytes)}`}+ data-tooltip-extraclassName={`rounded-md border px-2 py-0.5 font-mono text-xs transition-colors duration-150 ${f.index === activeFile.index? "border-gray-400 bg-gray-200/70 font-semibold text-gray-900 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"diff --git a/packages/web/src/features/usage/errors-panel.tsx b/packages/web/src/features/usage/errors-panel.tsxindex 19ad8e2f..590a3f71 100644--- a/packages/web/src/features/usage/errors-panel.tsx+++ b/packages/web/src/features/usage/errors-panel.tsx@@ -314,6 +314,7 @@ export function ErrorsPanel({data-tooltip={e.count > 1 ? S.usage.errorsFirstAt(formatDateTime(e.firstTs)) : undefined}+ data-tooltip-extra={e.count > 1}>{formatDateTime(e.ts)}</td>diff --git a/packages/web/src/features/workflows/workflow-tabs.tsx b/packages/web/src/features/workflows/workflow-tabs.tsxindex 55607faf..e5afc7b6 100644--- a/packages/web/src/features/workflows/workflow-tabs.tsx+++ b/packages/web/src/features/workflows/workflow-tabs.tsx@@ -123,6 +123,7 @@ export function WorkflowTabStrip({className="shrink-0 truncate px-3 py-1 text-xs"data-tooltip={n.error ?? n.hints.join("\n")}data-tooltip-content="text"+ data-tooltip-extra={n.error === null && n.hints.length > 1}><span className="font-mono">{n.workflowId}</span>: {n.error ?? n.hints[0]}</NoticeStrip>@@ -149,6 +150,7 @@ export function WorkflowTabStrip({role="tab"aria-selected={active === t.tabId}data-tooltip={t.error ?? undefined}+ data-tooltip-extra={t.error !== null}className={`${TAB_BASE} ${active === t.tabId ? TAB_ACTIVE : TAB_IDLE}`}onClick={() => onSelect(t.tabId)}>@@ -318,6 +320,7 @@ export function WorkflowFrame({variant="secondary"size="sm"title={S.workflows.fillAppHint(paletteShortcut)}+ data-tooltip-extraonClick={fillApp}>{S.workflows.fillApp}