Tooltip subtlety round: 500ms rest delay, quiet chip, parens suffixes, drops + trims

Owner round 2026-09-25, over 09c0f6e. The wave's tooltips read as
distracting; this round makes them quiet:

- Delay: TOOLTIP_DELAY_MS = 500 in the primitive — tooltips appear when
  you pause on a control, never in passing (Radix focus-opens stay
  instant by design; keyboard users don't wait).
- Vanish on leave: disableHoverableContent — the chip is un-hoverable,
  so the instant the cursor leaves the trigger it's gone, even mid-move
  onto the chip's own pixels.
- Look: bg-accent (#2a2a2a, the hover-chip tone) instead of the white
  bg-foreground slab; 11px; px-2 py-1; arrow culled (nothing purely
  decorative); text-foreground/85.
- Suffix: parentheses, not em-dash — "Dictate (⌘D)"; the registry
  source unchanged (still override-aware).
- Drops (owner-selected): send square, start square, stats summary —
  the icons/numbers describe themselves.
- Home logo kept but to the RIGHT with its real shortcut "Home (⌘G)"
  (jump-graph routes to /, the same destination).
- Trims: "Model selector (⌘K)", "Thinking level", "Graph costs —
  click for details", "How much of this session isn't mapped yet".
- Added: Import Notes gets "Import notes into the graph" — the one
  button whose destination wasn't obvious.

Pins: TOOLTIP_DELAY_MS=500; hintText parens expectations updated.
Live-verified on :3001 — 508ms hover delay measured, close within 10ms
of pointerout, chip styles probed (rgb(42,42,42), 11px, 4px/8px), arrow
gone, all new labels + sides confirmed, drops carry no tooltip and no
aria-describedby.
This commit is contained in:
amosblomqvist
2026-09-25 02:26:37 +03:00
parent b19e7e7eae
commit 6b83d3248b
10 changed files with 105 additions and 80 deletions
+7 -13
View File
@@ -133,18 +133,13 @@ export function Composer({
</button> </button>
</div> </div>
) : ( ) : (
<Hint // No tooltip on the send square — the ↵ glyph is the
// Per-state truth (tooltip wave): busy → the square STOPS the // affordance and Enter is obvious (owner, subtlety
// stream, and Esc aborts it too; otherwise Enter sends when the // round 2026-09-25).
// box has text. <button
label={busy ? "Stop the reply" : "Send"} type="submit"
binding={busy ? "escape" : "enter"} aria-label={busy ? "Stop" : "Send"}
side="left" disabled={!busy && !canSend}
>
<button
type="submit"
aria-label={busy ? "Stop" : "Send"}
disabled={!busy && !canSend}
className={cn( className={cn(
"flex size-10 shrink-0 items-center justify-center rounded-[10px] transition-colors", "flex size-10 shrink-0 items-center justify-center rounded-[10px] transition-colors",
busy busy
@@ -154,7 +149,6 @@ export function Composer({
> >
{busy ? <SquareIcon className="size-4" /> : <CornerDownLeftIcon className="size-5" />} {busy ? <SquareIcon className="size-4" /> : <CornerDownLeftIcon className="size-5" />}
</button> </button>
</Hint>
)} )}
</form> </form>
); );
+2 -3
View File
@@ -292,9 +292,8 @@ export function CoverageRing({ chatId, refreshKey = 0 }: { chatId: string; refre
return ( return (
<div ref={rootRef} className="lh-no-drag relative shrink-0"> <div ref={rootRef} className="lh-no-drag relative shrink-0">
<Hint <Hint
// Plain language (tooltip wave) — "uncovered tokens vs the chunk // Trimmed (owner, subtlety round 2026-09-25).
// threshold" was internal vocabulary. label="How much of this session isn't mapped yet"
label="How much of this session isn't in your graph yet — click for details"
side="bottom" side="bottom"
> >
<button <button
+18 -10
View File
@@ -328,8 +328,8 @@ function GraphCostControl({ costs }: { costs: GraphCostSummary }) {
return ( return (
<div ref={rootRef} className="relative"> <div ref={rootRef} className="relative">
<Hint <Hint
// Plain language (tooltip wave) — no internal vocabulary. // Trimmed (owner, subtlety round 2026-09-25).
label="What the graph has spent — click for details" label="Graph costs — click for details"
side="bottom" side="bottom"
> >
<button <button
@@ -884,16 +884,24 @@ export function GraphChromeRow({
e.target.value = ""; // allow re-picking the same file e.target.value = ""; // allow re-picking the same file
}} }}
/> />
<button <Hint
type="button" // The one button whose action isn't obvious from its label:
disabled={importing} // the missing fact is where imports go (owner, subtlety
onClick={() => fileInputRef.current?.click()} // round 2026-09-25).
data-testid="import-notes" label="Import notes into the graph"
side="bottom"
>
<button
type="button"
disabled={importing}
onClick={() => fileInputRef.current?.click()}
data-testid="import-notes"
className="flex h-7 items-center gap-1.5 rounded-lg px-2.5 text-xs text-muted-foreground transition-colors hover:bg-accent disabled:opacity-50" className="flex h-7 items-center gap-1.5 rounded-lg px-2.5 text-xs text-muted-foreground transition-colors hover:bg-accent disabled:opacity-50"
> >
<UploadIcon className="size-3" /> <UploadIcon className="size-3" />
{importing ? "Importing…" : "Import notes…"} {importing ? "Importing…" : "Import notes…"}
</button> </button>
</Hint>
</div> </div>
{!isEmpty && ( {!isEmpty && (
// Rendering settings — own component; the gear toggles it. The // Rendering settings — own component; the gear toggles it. The
+4 -10
View File
@@ -5,7 +5,6 @@ import { useRouter } from "next/navigation";
import { CornerDownLeftIcon } from "lucide-react"; import { CornerDownLeftIcon } from "lucide-react";
import { GraphView } from "@/components/graph-view"; import { GraphView } from "@/components/graph-view";
import { SetupDialog } from "@/components/setup-dialog"; import { SetupDialog } from "@/components/setup-dialog";
import { Hint } from "@/components/ui/hint";
import { useStrongKeyless, useZeroKeys, ZeroKeysPill } from "@/components/setup-cta"; import { useStrongKeyless, useZeroKeys, ZeroKeysPill } from "@/components/setup-cta";
import { useDefaultSettings } from "@/components/default-settings"; import { useDefaultSettings } from "@/components/default-settings";
import { DictationBar, useDictation } from "@/components/dictation"; import { DictationBar, useDictation } from "@/components/dictation";
@@ -177,21 +176,16 @@ export function Home({ initialSettings, initialConfigured }: { initialSettings:
rows={1} rows={1}
className="field-sizing-content lh-input max-h-48 min-h-10 flex-1 resize-none bg-transparent px-2.5 py-2 outline-none placeholder:text-muted-foreground" className="field-sizing-content lh-input max-h-48 min-h-10 flex-1 resize-none bg-transparent px-2.5 py-2 outline-none placeholder:text-muted-foreground"
/> />
<Hint {/* No tooltip on the start square — the ↵ glyph is the
// Enter starts the session too (the form submits). affordance (owner, subtlety round 2026-09-25). */}
label="Start session" <button
binding="enter"
side="left"
>
<button
type="submit" type="submit"
aria-label="Start session" aria-label="Start session"
disabled={!topic.trim() || busy} disabled={!topic.trim() || busy}
className="flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-primary text-primary-foreground transition-colors hover:opacity-90 disabled:opacity-40" className="flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-primary text-primary-foreground transition-colors hover:opacity-90 disabled:opacity-40"
> >
<CornerDownLeftIcon className="size-5" /> <CornerDownLeftIcon className="size-5" />
</button> </button>
</Hint>
</form> </form>
{/* Same as the chat view's under-composer stats bar (owner) — no {/* Same as the chat view's under-composer stats bar (owner) — no
session yet, so the LEFT side renders nothing (wave 7 sweep) session yet, so the LEFT side renders nothing (wave 7 sweep)
+6 -5
View File
@@ -254,9 +254,10 @@ export function ModelControl() {
return ( return (
<div ref={containerRef} className="relative flex items-center gap-1.5" data-testid="model-control"> <div ref={containerRef} className="relative flex items-center gap-1.5" data-testid="model-control">
<Hint <Hint
// User language (tooltip wave): no tier/prober vocabulary. ⌘K // Trimmed (owner, subtlety round 2026-09-25): "Model selector"
// opens this same menu (registry, override-aware). // — the long sentence was way too much. ⌘K opens this same
label="The main model for your sessions" // menu (registry, override-aware).
label="Model selector"
action="open-model-picker" action="open-model-picker"
side="bottom" side="bottom"
> >
@@ -276,8 +277,8 @@ export function ModelControl() {
</button> </button>
</Hint> </Hint>
<Hint <Hint
// User language (tooltip wave) — no "tier" vocabulary. // Trimmed (owner, subtlety round 2026-09-25).
label="How much the main model thinks" label="Thinking level"
side="bottom" side="bottom"
> >
<button <button
+9 -1
View File
@@ -544,7 +544,15 @@ function SessionsSidebar() {
with the lights' own edge-inset as the gap. */} with the lights' own edge-inset as the gap. */}
{/* Hover mirrors the ghost toggle buttons (owner ask, 2026-09-17): {/* Hover mirrors the ghost toggle buttons (owner ask, 2026-09-17):
same size-9 chip geometry, same hover:bg-accent treatment. */} same size-9 chip geometry, same hover:bg-accent treatment. */}
<Hint label="Home" side="bottom"> <Hint
// Kept (owner, subtlety round 2026-09-25) but to the RIGHT
// of the logo, carrying its real shortcut: ⌘G jumps to
// the graph view (keyboard-shortcuts routes it to "/",
// the same destination as this logo).
label="Home"
action="jump-graph"
side="right"
>
<Link <Link
href="/" href="/"
aria-label="Home" aria-label="Home"
+15 -21
View File
@@ -4,7 +4,6 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
import { contextWindow, sessionCost, turnCost, type ChatSettings, type TurnUsage } from "@/src/core"; import { contextWindow, sessionCost, turnCost, type ChatSettings, type TurnUsage } from "@/src/core";
import { formatTokens, formatUsd, prettyModel } from "@/components/usage-format"; import { formatTokens, formatUsd, prettyModel } from "@/components/usage-format";
import { ModelControl, catalogLimits, useModelCatalog } from "@/components/model-picker"; import { ModelControl, catalogLimits, useModelCatalog } from "@/components/model-picker";
import { Hint } from "@/components/ui/hint";
/** /**
* The below-composer stats bar (wave 4 observability): the session's * The below-composer stats bar (wave 4 observability): the session's
@@ -93,26 +92,21 @@ export function StatsBar({
exists (turns). Pre-chat renders nothing (see the header). */} exists (turns). Pre-chat renders nothing (see the header). */}
{turns.length > 0 && ( {turns.length > 0 && (
<div ref={barRef} className="relative"> <div ref={barRef} className="relative">
<Hint {/* No tooltip — the numbers describe themselves and the popover
// Copy kept (the scout approved) — machinery moved to the speaks on click (owner, subtlety round 2026-09-25). */}
// styled tooltip (tooltip wave). <button
label="Session stats — per-turn detail" type="button"
side="bottom" onClick={() => setOpen((o) => !o)}
> aria-expanded={open}
<button data-testid="stats-summary"
type="button" className="flex items-center gap-1.5 tabular-nums transition-colors hover:text-foreground"
onClick={() => setOpen((o) => !o)} >
aria-expanded={open} <span data-testid="stats-context">
data-testid="stats-summary" {ctx ? (ctx.limit !== null ? `${formatTokens(ctx.usedTokens)} / ${formatTokens(ctx.limit)}` : formatTokens(ctx.usedTokens)) : "—"}
className="flex items-center gap-1.5 tabular-nums transition-colors hover:text-foreground" </span>
> <span aria-hidden>·</span>
<span data-testid="stats-context"> <span data-testid="stats-cost">{costLabel}</span>
{ctx ? (ctx.limit !== null ? `${formatTokens(ctx.usedTokens)} / ${formatTokens(ctx.limit)}` : formatTokens(ctx.usedTokens)) : "—"} </button>
</span>
<span aria-hidden>·</span>
<span data-testid="stats-cost">{costLabel}</span>
</button>
</Hint>
{open && ( {open && (
<div <div
data-testid="stats-detail" data-testid="stats-detail"
+6 -5
View File
@@ -6,9 +6,10 @@ import { bindingForAction, formatBinding, type KeyAction } from "@/src/core"
/** /**
* The tooltip composition for icon and pill controls (tooltip wave, owner * The tooltip composition for icon and pill controls (tooltip wave, owner
* 2026-09-25). The styled Radix tooltip (ui/tooltip.tsx, adopted as-is — * 2026-09-25; subtlety round same day). The styled Radix tooltip carries
* no restyling) carries the label, with the control's shortcut appended as * the label, with the control's shortcut appended in parentheses when
* an em-dash suffix when it has one ("Dictate — ⌘D"). * it has one ("Dictate (⌘D)") — the owner call: the em-dash suffix read
* as too much air.
* *
* The binding is override-aware: pass `action` for registry shortcuts (a * The binding is override-aware: pass `action` for registry shortcuts (a
* user rebind in Settings → Keyboard changes the suffix live), or * user rebind in Settings → Keyboard changes the suffix live), or
@@ -31,7 +32,7 @@ interface HintProps {
children: React.ReactElement children: React.ReactElement
} }
/** The composition itself, pure — "Dictate" + ⌘D → "Dictate — ⌘D". Exported /** The composition itself, pure — "Dictate" + ⌘D → "Dictate (⌘D)". Exported
* for the mechanism pins (tests/tooltip-mechanism.test.tsx). */ * for the mechanism pins (tests/tooltip-mechanism.test.tsx). */
export function hintText(label: string, action?: KeyAction, binding?: string): string { export function hintText(label: string, action?: KeyAction, binding?: string): string {
const live = action const live = action
@@ -39,7 +40,7 @@ export function hintText(label: string, action?: KeyAction, binding?: string): s
: binding : binding
? formatBinding(binding) ? formatBinding(binding)
: "" : ""
return live ? `${label} — ${live}` : label return live ? `${label} (${live})` : label
} }
export function Hint({ label, action, binding, side = "top", children }: HintProps) { export function Hint({ label, action, binding, side = "top", children }: HintProps) {
+25 -6
View File
@@ -5,8 +5,21 @@ import { Tooltip as TooltipPrimitive } from "radix-ui"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
/**
* The styled tooltip (tooltip wave → subtlety round, owner 2026-09-25):
* a quiet dark chip, not a white slab — accent tone (the hover-chip color),
* 11px, minimal padding, no arrow (nothing purely decorative). Opens after
* a 500ms rest, so tooltips appear when you pause on a control, never in
* passing; disableHoverableContent means the chip is un-hoverable — the
* instant the cursor leaves the trigger it's gone, even mid-move onto the
* chip's own pixels.
*/
/** The rest delay (ms): shared by hover and focus opens. */
export const TOOLTIP_DELAY_MS = 500
function TooltipProvider({ function TooltipProvider({
delayDuration = 0, delayDuration = TOOLTIP_DELAY_MS,
...props ...props
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) { }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
return ( return (
@@ -19,9 +32,16 @@ function TooltipProvider({
} }
function Tooltip({ function Tooltip({
disableHoverableContent = true,
...props ...props
}: React.ComponentProps<typeof TooltipPrimitive.Root>) { }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
return <TooltipPrimitive.Root data-slot="tooltip" {...props} /> return (
<TooltipPrimitive.Root
data-slot="tooltip"
disableHoverableContent={disableHoverableContent}
{...props}
/>
)
} }
function TooltipTrigger({ function TooltipTrigger({
@@ -32,7 +52,7 @@ function TooltipTrigger({
function TooltipContent({ function TooltipContent({
className, className,
sideOffset = 0, sideOffset = 6,
children, children,
...props ...props
}: React.ComponentProps<typeof TooltipPrimitive.Content>) { }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
@@ -42,16 +62,15 @@ function TooltipContent({
data-slot="tooltip-content" data-slot="tooltip-content"
sideOffset={sideOffset} sideOffset={sideOffset}
className={cn( className={cn(
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-accent px-2 py-1 text-[11px] text-foreground/85 text-balance fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
className className
)} )}
{...props} {...props}
> >
{children} {children}
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
</TooltipPrimitive.Content> </TooltipPrimitive.Content>
</TooltipPrimitive.Portal> </TooltipPrimitive.Portal>
) )
} }
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
+13 -6
View File
@@ -17,18 +17,19 @@ import { describe, it } from "node:test";
import { createElement } from "react"; import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { Hint, hintText } from "../components/ui/hint.tsx"; import { Hint, hintText } from "../components/ui/hint.tsx";
import { TOOLTIP_DELAY_MS } from "../components/ui/tooltip.tsx";
import { AUTO_UPDATE_HINT } from "../components/settings/settings-dialog.tsx"; import { AUTO_UPDATE_HINT } from "../components/settings/settings-dialog.tsx";
describe("hintText — the em-dash composition", () => { describe("hintText — the parenthesized composition", () => {
it("a registry action appends the LIVE binding (override-aware source)", () => { it("a registry action appends the LIVE binding (override-aware source)", () => {
assert.equal(hintText("Dictate", "toggle-dictation"), "Dictate — ⌘D"); assert.equal(hintText("Dictate", "toggle-dictation"), "Dictate (⌘D)");
assert.equal(hintText("Settings", "open-settings"), "Settings — ⌘,"); assert.equal(hintText("Settings", "open-settings"), "Settings (⌘,)");
assert.equal(hintText("Search sessions", "sessions-search"), "Search sessions — ⌘⇧F"); assert.equal(hintText("Search sessions", "sessions-search"), "Search sessions (⌘⇧F)");
}); });
it("surface-owned keys ride the binding prop (no registry entry)", () => { it("surface-owned keys ride the binding prop (no registry entry)", () => {
assert.equal(hintText("Close", undefined, "escape"), "Close — Esc"); assert.equal(hintText("Close", undefined, "escape"), "Close (Esc)");
assert.equal(hintText("Send", undefined, "enter"), "Send — ↵"); assert.equal(hintText("Send", undefined, "enter"), "Send (↵)");
}); });
it("no shortcut = the label alone, no dangling dash", () => { it("no shortcut = the label alone, no dangling dash", () => {
@@ -37,6 +38,12 @@ describe("hintText — the em-dash composition", () => {
}); });
}); });
describe("subtlety round pins (owner 2026-09-25)", () => {
it("the rest delay is 500ms — tooltips appear on pause, never in passing", () => {
assert.equal(TOOLTIP_DELAY_MS, 500);
});
});
describe("spot-pins: the dev-speak cull (owner copy review at merge)", () => { describe("spot-pins: the dev-speak cull (owner copy review at merge)", () => {
it("the auto-update hint is honest user language — no stream jargon", () => { it("the auto-update hint is honest user language — no stream jargon", () => {
assert.equal(AUTO_UPDATE_HINT, "Automatic updates arrive in an upcoming release"); assert.equal(AUTO_UPDATE_HINT, "Automatic updates arrive in an upcoming release");