Skip to content

perf(Tooltip): tooltip code loads after first paint - #11681

Draft
cixzhang wants to merge 26 commits into
mainfrom
perf/tooltip-after-first-paint
Draft

cixzhang wants to merge 26 commits into
mainfrom
perf/tooltip-after-first-paint

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

People get pages that show sooner, because tooltip code no longer loads with the page. Today every component that offers a tooltip (Button, IconButton, Link, InfoTip, the form fields with a disabledMessage or status tooltip, Avatar, StatusDot, Thumbnail, SideNav and others: 29 importers) carries the tooltip's behavior and the whole layer runtime in its first load. With this change, that code loads once per page in the background, after the page has painted.

Closes #12059. A Button with no tooltip and an Avatar with tooltip={false} now run only the trigger contract (two useState, two committed refs, two context reads, one store read and one Effect that schedules the load when the tooltip becomes enabled) and never render the tooltip surface. Server render of 200 × <Button label="Save" /> (renderToString, NODE_ENV=production, median of 100 renders after warm-up, two runs each on a loaded machine), measured at c1e6ca7 against its merge base on main (48ebdde): 5.1–5.2 ms on main, 2.6–3.4 ms here; useTooltip's share of React render samples falls from 41–44 % to 4–5 %.

First load of five app pages (one bundle per page; esbuild over Core's Babel build with Core's sideEffects list, minified ESM, every bare import external; gzip level 9), main (48ebdde) → this head (c1e6ca7):

Page Before (min / gzip) After (min / gzip) Change (min / gzip)
Docs: Text, Heading, Link, Card, Divider, List 205.4 / 68.7 KB 132.5 / 44.4 KB −72.9 / −24.3 KB
Form: Button, IconButton, TextInput, CheckboxInput, Text, Heading, Card 288.5 / 98.6 KB 239.6 / 82.7 KB −48.9 / −15.9 KB
Menu: DropdownMenu, ContextMenu, Button, Text 360.8 / 124.6 KB 353.5 / 122.1 KB −7.3 / −2.5 KB
Table: Table, Text, Button 331.7 / 114.0 KB 324.6 / 111.9 KB −7.1 / −2.1 KB
Text only: Text, Heading 23.9 / 8.9 KB 24.2 / 9.1 KB +0.3 / +0.1 KB

The text-only page gains 0.1 KB gzip: the trigger contract's loader. A tooltip whose isEnabled is false now starts no load, so a field's disabled-reason tooltip adds no tooltip code to a page where it cannot show.

Cross-bundler first load (React, React DOM and StyleX external; gzip KB / first-load requests), measured at dc537fa against main 2bfebe7:

Page Vite 8 (Rolldown) Rolldown, inline off Rolldown, inline 64 KiB webpack 5
button 61.1 / 1 → 44.3 / 2 60.4 / 1 → 43.7 / 2 63.4 / 3 → 47.8 / 6 62.4 / 1 → 44.9 / 1
docs 69.2 / 1 → 49.2 / 1 68.5 / 1 → 48.6 / 1 71.4 / 2 → 50.8 / 3 69.4 / 1 → 50.4 / 1
menu 127.7 / 5 → 126.1 / 9 127.2 / 5 → 125.6 / 9 133.8 / 8 → 132.7 / 12 129.4 / 1 → 126.5 / 1
table 118.3 / 5 → 118.1 / 10 117.8 / 5 → 117.7 / 10 124.5 / 8 → 124.6 / 13 119.9 / 1 → 117.0 / 1

In a Comet app (Vite 8 / Rolldown with React Server Components, Core packed at each ref; dc537fa against 2bfebe7), menu is 325.0 → 323.1 KB gzip (−1.9 KB) with 25 → 28 first-load requests, and table is 315.3 → 313.5 KB (−1.8 KB) with 22 → 25 requests. These totals include React and the app's entry.

Menu and table bytes fall or stay within 0.1 KB in every column, but Rolldown splits the modules the menu and table already load eagerly into four or five more first-load chunks: the lazy tooltip surface is one more dynamic entry that reaches them. Making Text's truncation tooltip import the Tooltip component statically (one dynamic entry instead of two) was measured and is not in this change: it added chunks (menu 11, table 12 under Vite) and bytes (table +1.4 KB, Text's eager size 10.2 → 12.7 KB).

Intended invariant

architecture:component-import-boundaries DEC-4 (owner decision, 2026-11-13): tooltip and hover-card code loads after first paint on every page; no input starts it sooner or hurries it; a hover during the window shows late or at the next hover (INV2, INV4). INV3 as ruled for this change: a description a surface supplies may arrive with the surface, as long as no reference ever names a missing element. component:Tooltip FR1–FR13 hold once the tooltip has loaded.

Change

  • Description, in three steps (component:Tooltip FR2 and AR1, reconciled with the lazy layer mount): before the load the trigger carries no aria-describedby; from the load until the first show it names a plain hidden copy of the text (no role="tooltip"), rendered after the trigger; from the first show it names the tooltip's content. The id is the same in the last two steps. CheckboxInput, which writes its disabled reason's id into its own markup, names it only once useIsTooltipLoaded reports the load, in the same commit as the copy.
  • A tooltip whose isEnabled is false starts no load. One that becomes enabled while its trigger is attached schedules the load then (INV10).
  • The after-paint wait (a frame, then the task it queues) is one helper, afterNextPaint(view) in utils/moduleLoader.ts. The tooltip load calls it with the trigger's window and then waits for idle, at most 2 s. Text's truncation-tooltip preload and cut-text loader, which each had their own copy, call it with the global window, so their timing is unchanged (moduleLoader.test.ts).
  • Until the load, Button's cut-label check recognises a wrapping Tooltip from the trigger contract (isTooltipTriggerBeforeLoad: an attached trigger of an enabled tooltip that describes it, recounted when isEnabled changes), so a cut label that takes keyboard focus before the load yields to the caller's tooltip (component:Button FR18). A Tooltip whose content repeats the trigger's name adds no description (AR1), so it marks the trigger (markTriggerRepeatsName) and the cut label does not yield to it, before or after the load.
  • Typeahead and Tokenizer recognise their status info-tip button from the button useInputStatusIcon registers, not from its aria-describedby, which is empty before the load. A press on the info-tip before the load keeps focus on it (component:Typeahead FR15, component:Tokenizer FR32).
  • Tooltip/useTooltip.tsx becomes the tooltip's trigger contract, with the same options and return type. It records the trigger elements, holds an early show() or hide() (the latest wins; a hide() that cancels a held show() calls onHide), and loads the surface once per page: after first paint (frame, then the next task), at idle, at most 2 s later. Each trigger window schedules the load once, from the first ref callback that attaches a trigger in it, so a frame or Picture-in-Picture window that goes away early does not stop the load; a tooltip whose trigger never attaches starts none. Its describedBy is '' until the load. The description element (the hidden copy, then the layer's content) reports from its own commit, so the reference arrives in the same task as the element, before the frame paints, and never ahead of it. The schedule copies perf(core): SegmentedControl, Switch and BottomSheet load the touch animator after first paint #11450's touch runtime (frame → task → requestIdleCallback with a 2 s timeout, else a 0 ms timer). Whichever of the two merges second imports the other's constant.
  • Tooltip/tooltipSurface.tsx (new against main, component-internal: only Tooltip/useTooltip.tsx imports it, by a dynamic import() and a type import; its load test mocks it) is today's useTooltip, moved with git mv, plus a TooltipSurface component that runs it on the recorded elements. Changes inside the moved hook: scheduleShow and handleHover take the time already elapsed since the pointer entered, the present-interest read replays a held hover with that elapsed time, and the description element reports its id and the layer's anchor name to the trigger contract. The rest of the hook is unchanged. When the surface connects, a pointer still over the trigger shows the tooltip once its delay has passed since the pointer entered. Keyboard focus still on the trigger (:focus-visible) shows it at once, through the existing TooltipPresentInterestContext path. Only a tooltip that mounted before the load reads a held intent, and only at its first connect.
  • The layer runtime (Layer/useLayer) is unchanged.
  • Callers that put describedBy straight into an attribute skip it when empty. Main already does this for Tooltip, InfoTip, Selector, MultiSelector, Switch, Slider, DateInput, DateTimeInput and DateRangeInput; this change adds ComplexSelector (.filter(Boolean)), documents the empty value on useInputStatusIcon's describedBy, and CheckboxInput names its reason's id only once the tooltip has loaded. The useTooltip doc entry, its @example, the TooltipHookUsage template and the Tooltip and ChatLayout stories show describedBy || undefined.
  • Records: component:Tooltip FR2, AR1, PR2 and the ownership list state the three-step description, and FR14 states the load, the disabled-tooltip rule and useIsTooltipLoaded. architecture:component-import-boundaries INV3 allows a description reference that arrives in the same task as its surface, and INV4 says a pre-load tap on a Tooltip trigger is not held; INV6 is unchanged and the code meets it. architecture:component-import-boundaries drops the Button and Link allowlist rows, records the HoverCard INV2 gap (a follow-up is tracked), and names the Tooltip trigger-contract modules as base code. scripts/check-component-import-boundaries.mjs keeps a listed base module as base code when an import() also targets it (Text's truncation tooltip loads the Tooltip component).
  • Test setup loads the tooltip once per file, so existing tests exercise the loaded tooltip unchanged. useTooltip.load.test.tsx covers the load itself.

Declared difference

  • Before the load (normally well under 2 s after paint): hover, focus and taps on a trigger show nothing, and a trigger carries no aria-describedby. On main, server markup carried the hidden copy and the reference; now both arrive with the load, after hydration.
  • When the load lands: a held hover shows once its delay has passed since the pointer entered, a held keyboard focus shows at once, an early show()/isOpen/isDefaultOpen opens once, and a pointer or focus that left shows nothing until the next hover or focus.
  • A failed load leaves triggers working and warns once in development. It drops a show() made before it and reports it through onHide (InfoTip's pressed state resets). A later hover, focus or show() on a trigger asks for the load again at once, as does the next trigger that mounts (INV6).
  • A tap on a trigger before the load is not held, even where a touch browser keeps :hover on the tapped element, and even for a tap on server markup before hydration (a :hover no listener saw counts only where the device can hover): the next tap is handled as on a loaded tooltip (INV4 as amended here, component:Tooltip FR5, FR14).
  • HoverCard is unchanged (DEC-4 INV2 gap): its trigger's closed-state ARIA names the card, so deferring it needs layer-runtime node adoption.

Evidence

  • Failure before the change: not run as a red test (the load tests mock the new tooltipSurface module, which main does not have). On main the first case fails by construction: Button, IconButton, Link and TextInput import Layer/useLayer statically, which the import-boundaries check also shows (Button and Link allowlist rows).

  • Success after the change: 34 load tests pass in useTooltip.load.test.tsx, plus moduleLoader.test.ts for the shared after-paint wait. Each test added during review failed first against the head before its fix:

    • since the merge after perf(Tooltip): the layer mounts at the tooltip's first show #11916: a disabled tooltip that starts no load and loads once enabled; a TextInput, CheckboxInput and Switch with no disabled reason that load nothing; a click on a Typeahead's status info-tip before the load keeps focus on it; a wrapped Button whose cut label takes keyboard focus before the load shows only the caller's tooltip; a described trigger recounted when isEnabled changes and when TooltipDescribesContext changes; a wrapped Button whose Tooltip repeats its name does not count as described. A Button with no tooltip and an Avatar with tooltip={false} that start no load and render no surface passes at earlier heads too (main has no surface module to test against).
    • before that: a pre-load finger tap with :hover kept, a show() held through a failed load, a show() after a failed load, an unseen :hover on a device that cannot hover, a disabled ComplexSelector with a tooltip status, a pre-load hide() cancelling a held show(), and a first trigger window that goes away before its load runs.

    The load tests cover:

    • no layer code on import;
    • one load after first paint with no input, and no input starting it;
    • a held hover (delay counted from the entry, or from the load when the entry came first), a held keyboard focus, an early show(), show() then hide(), and a controlled open;
    • a pointer or focus that left;
    • a failed load, its retry on the next mount, and its immediate retry on a later hover or show();
    • a show() held through a failed load, dropped and reported through onHide;
    • a finger tap before the load, with the trigger left in :hover, showing nothing at the load;
    • no load from a tooltip whose trigger never attaches;
    • no aria-describedby before the load in server markup or on the client, the reference naming the hidden copy after it and the tooltip's content after the first show, never a dangling reference in between (MutationObserver), and no new data-* attribute;
    • the Tooltip component's child.
  • Real browser: TooltipAfterPaint.a11y.browser.spec.ts runs in Chromium and WebKit. It records the trigger's reference from the first parse (none at first, never dangling), checks the hidden copy (no role, no layer) after the load and the tooltip's content after the first hover, and runs axe at each step; in Chromium, the accessibility tree gives the trigger the tooltip text as its description. Tooltip.a11y.chromium.spec.ts, TooltipDescription.a11y.browser.spec.ts and the button-disabled-with-tooltip state in Button.a11y.chromium.spec.ts wait for the description reference, which arrives with the load, before their checks. Tooltip.ssr.test.tsx and CheckboxInput.ssr.test.tsx assert server markup with no reference and a description after hydration.

  • Product behavior otherwise unchanged: the Tooltip, InfoTip, Button, TextInput, FileInput, SideNav, ComplexSelector, hooks, Selector, MultiSelector, CheckboxInput, Switch, Slider and Layer suites pass with the tooltip loaded. The full core, lab and richtext unit run is green except failures that also fail on the base commit on this machine, or that pass when rerun with less load (30 s timeouts in the a11y lanes, TransferList, Menu).

  • Screen readers: VoiceOver was not run (no interactive session on the build machine), and NVDA has no Windows machine here. Evidence gap; the Chromium accessibility-tree check above is the recorded evidence.

Scope

Components: Tooltip, CheckboxInput, ComplexSelector, useInputStatusIcon and the status-button press check (Typeahead, Tokenizer), Text's cut-label check, truncation-tooltip preload and cut-text loader (shared after-paint wait), utils/moduleLoader; Button and Avatar (tests only)

  • No intended public API, product behavior, visual direction, or policy change beyond DEC-4's after-paint load.
  • Product changes discovered during the work were removed or split (HoverCard: separate follow-up).
  • Public text and artifacts contain no internal Meta context.

Replaces #11570 (Button-only, load on intent), which DEC-4 superseded. Related: #10059 (form fields carry the tooltip layer); this change covers the form fields' tooltips too.

Writing rubric results

component:Tooltip (FR2, AR1, PR2, ownership, FR14, verification rows) and architecture:component-import-boundaries (INV3 and INV4 amendments, allowlist row and cost, base modules, INV1 gap, INV2 HoverCard gap, owning code):

  • R1 narration: none; each sentence states what the system does now.
  • R2 research: none in the records; bytes are in this description.
  • R3 evidence: the verification row names the tests and what they assert.
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none changed.
  • R7 project status: none; HoverCard is an INV2 gap: line.

Testing

  • pnpm vitest run packages/core/src/Tooltip packages/core/src/InfoTip packages/core/src/Button packages/core/src/TextInput packages/core/src/FileInput packages/core/src/SideNav packages/core/src/ComplexSelector packages/core/src/hooks …: pass.
  • node scripts/check-component-import-boundaries.mjs --base-ref <base>: boundaries hold.
  • tsc --noEmit -p packages/core/tsconfig.json: no errors in changed files (a pre-existing getLocaleDirection.ts lib-typing error is unrelated). ESLint on changed files: no errors. Prettier, pnpm check:knowledge: pass.
  • Browser specs run in this pull request's CI.
  • pnpm review:pre: merge into main is clean. It reports three findings, all in tooltipSurface.tsx and all present unchanged in main's useTooltip.tsx, which this change moves with git mv: two window pointerup/pointercancel listeners during a press (INV16), and one render-time count of disabled renders (INV17). Changing them is outside this change. Authored lines: 4,133, of which about 1,160 are that move.

useTooltip is the tooltip's trigger contract: stable refs, show() and
hide(), and its describedBy id. The tooltip's behavior and layer move to
Tooltip/tooltipSurface.tsx, which loads once per page with import() after
the first paint, when the main thread is idle and at most 2 s later. No
input starts the load. A hover or keyboard focus still on a trigger, and an
open request made before the load, are answered once when it lands.

Until the layer exists, describedBy is empty, so a trigger names no missing
element; the reference arrives in the same task as the role=tooltip layer.
No component that uses useTooltip or Tooltip changes its API; a few skip
an empty describedBy when they compose it.

Applies architecture:component-import-boundaries DEC-4 to Tooltip.
HoverCard stays loaded with the page (recorded INV2 gap).
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 27, 2026 11:27am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 14, 2026
@astracat-bot

astracat-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 27, 2026, 11:39 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec fdf8d73

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and the fixes below are needed either way.

Spec decision needed: the proposed component:Tooltip FR2 sentence and FR14 and the architecture:component-import-boundaries edits let a trigger's aria-describedby arrive when the layer loads (current INV3 keeps closed-state ARIA unchanged across the load), drop a tap made before the load (current INV4 replays it), and retry a failed load on the next tooltip mount (current INV6 retries on the next intent). An engineering owner records the decision by commenting /approve-spec followed by the full head commit SHA (the author may, as an engineering owner); otherwise, the code or the proposed records should change to match the current claims.

To fix:

  • The page's load schedule runs from a mount Effect (useTooltip.tsx:563); the trigger's ref callback should own it, since that callback already adds the pre-load pointerenter listener and can read the trigger's own window instead of the global window.
  • DateTimeInput.tsx:1853 and DateRangeInput.tsx:919 still pass describedBy straight to aria-describedby, so they render aria-describedby="" before the load; the useTooltip doc entry, its @example and the TooltipHookUsage template still teach that usage, and the changeset's "no aria-describedby until the load" is not true for them.
  • docs/architecture/component-import-boundaries.md:216-218 still says the truncation tooltip's touch code costs Button, IconButton, Link and Table nothing on its own, but at this head the check prints that row at 4.2, 4.2, 4.2 and 0.8 KB.
  • The description calls tooltipSurface.tsx the old hook "moved unchanged", but scheduleShow, handleMouseEnter, the held-hover replay and the layer ids change there.
  • INV3's verification row asks for Chromium and WebKit runs with axe before and after the load, and the new browser spec runs in Chromium only, with no axe pass.

Once loaded, tooltips render pixel-identical to main and the existing suites pass; CI has not run on this draft head yet.

Claims and files checked
  • Claim: the tooltip surface loads once per page after first paint (frame, task, idle, 2 s cap): verified, useTooltip.tsx:282-300 and the load tests.
  • Claim: no input starts or hurries the load: verified by the load test that hovers, focuses and presses before paint.
  • Claim: useTooltip keeps the same options and return type: verified, the API surface generator finds no changed rows.
  • Claim: describedBy is empty until the layer exists, and the reference arrives with the layer and never dangles: verified, useTooltip.tsx:586, the MutationObserver test and a Chromium timeline.
  • Claim: tooltipSurface.tsx is the old hook moved unchanged: false, tooltipSurface.tsx:113-114, :288-309, :634-639.
  • Claim: a held hover shows once its delay has passed since entry, held keyboard focus shows at once, and only tooltips mounted before the load read a held intent: verified by the load tests and by tests of <Tooltip> with an element child.
  • Claim: useLayer gains two internal options and no public option: verified, InternalContextLayerOptions.
  • Claim: callers that put describedBy into an attribute skip it when empty: incomplete, DateTimeInput and DateRangeInput do not.
  • Claim: the records state FR2, FR14, the removed allowlist rows, the HoverCard gap and the new base modules: verified as described, with one stale cost sentence left.
  • Claim: the boundary script keeps a listed base module as base code when an import() targets it: verified, the script diff and a passing check.
  • Claim: the shared test setup preloads the tooltip per file: verified, internal/test-utils/src/setup.ts.
  • Claim: 17 load tests pass: verified.
  • Claim: before the load, hover, focus and taps show nothing and no closed layer exists: verified; a tap made before the load is not answered later.
  • Claim: a failed load keeps triggers working, warns once in development and retries on the next mount: verified by the load test and the development-only warning.
  • Claim: HoverCard is unchanged: verified, no HoverCard file changes.
  • Claim: Button and IconButton eager size drops from 61.0 to 45.5 KB and Link from 52.3 to 35.3 KB: verified within local tolerance (61.2 → 45.7 and 52.5 → 35.5).
  • Claim: the four-page first-load table and the after-paint chunk sizes: not reproduced.
  • Claim: 29 importers carry the tooltip today: not verified; the count depends on what is counted.
  • Claim: the existing product suites pass with the tooltip loaded: verified for 70 test files and 2,149 tests.
  • Claim: type check, ESLint, Prettier and knowledge checks pass: not run.
  • Changeset: up to about 17 KB less gzipped JavaScript: consistent with the boundary check (Link −17.0 KB eager).
  • Changeset: tooltips look and behave as before once loaded: verified; frames are pixel-identical and the suites pass.
  • Changeset: a hover or keyboard focus still on a trigger shows its tooltip when the load lands: verified.
  • Changeset: until the load, no aria-describedby and no closed layer: false for DateTimeInput's calendar button and DateRangeInput's presets, which render an empty attribute.
  • .changeset/tooltip-loads-after-first-paint.md: finding (one false claim).
  • docs/architecture/component-import-boundaries.md: finding (stale cost sentence); edits await the spec decision.
  • docs/specs/components/Tooltip/Tooltip.spec.md: awaits the spec decision.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear.
  • internal/test-utils/src/setup.ts: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx: clear.
  • packages/core/src/InfoTip/InfoTip.tsx: clear.
  • packages/core/src/Layer/useLayer.tsx: clear.
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear.
  • packages/core/src/Selector/Selector.tsx: clear.
  • packages/core/src/Slider/Slider.tsx: clear.
  • packages/core/src/Switch/Switch.tsx: clear.
  • packages/core/src/Tooltip/Tooltip.tsx: clear.
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts: clear.
  • packages/core/src/Tooltip/__tests__/TooltipAfterPaint.a11y.chromium.spec.ts: evidence gap (Chromium only, no axe).
  • packages/core/src/Tooltip/tooltipPresentInterest.ts: clear.
  • packages/core/src/Tooltip/tooltipSurface.tsx: clear (the description claim about it is the finding).
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx: finding (mount Effect); __resetTooltipForTest is exported and unused.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/useAnnounceRenderedText.adopters.test.tsx: clear.
  • packages/core/src/hooks/useInputStatusIcon.tsx: clear.
  • scripts/check-component-import-boundaries.mjs: clear; the rule it implements awaits the spec decision.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The engineering owner's spec approval at this revision settles the direction of the Tooltip record (FR2 and FR14); the fixes below are still needed.

To fix:

  • docs/architecture/component-import-boundaries.md INV3, INV4 and INV6 still say a trigger's closed-state ARIA does not change at load, a pre-load tap opens at once, and a later intent retries a failed load, which contradicts the approved FR2 and FR14, so those claims and their verification rows need amending to match.
  • The page's load schedule runs from a mount Effect (useTooltip.tsx:563), but the trigger's ref callback should own it, since that callback already adds the pre-load pointerenter listener and can read the trigger's own window instead of the global window.
  • DateTimeInput.tsx:1853 and DateRangeInput.tsx:919 still pass describedBy straight to aria-describedby and render aria-describedby="" before the load, and the useTooltip doc entry, its @example and the TooltipHookUsage template still teach that usage, so the changeset's "no aria-describedby until the load" is not true for them.
  • Miss: DateInput.tsx:989 has the same pattern and renders aria-describedby="" on its "Open calendar" button until the load.
  • docs/architecture/component-import-boundaries.md:216-218 still says the truncation tooltip's touch code costs Button, IconButton, Link and Table nothing on its own, but at this revision the check prints that row at 4.2, 4.2, 4.2 and 0.8 KB.
  • The description calls tooltipSurface.tsx the old hook "moved unchanged", but scheduleShow, handleMouseEnter, the held-hover replay and the layer ids change there.
  • Miss: the new Tooltip verification row (Tooltip.spec.md:278) says VoiceOver with Safari is recorded in the pull request, while the description says VoiceOver was not run.
  • INV3's verification row asks for Chromium and WebKit runs with axe before and after the load, and the new browser spec runs in Chromium only with no axe pass.

Once loaded, tooltips behave as before and the existing suites pass; CI has not run on this draft yet.

Claims and files checked
  • Claim: the tooltip surface loads once per page after first paint (frame, task, idle, 2 s cap): verified, useTooltip.tsx:282-300 and the load tests.
  • Claim: no input starts or hurries the load: verified by the load test that hovers, focuses and presses before paint.
  • Claim: useTooltip keeps the same options and return type: verified; the API surface comparison finds no changed rows.
  • Claim: describedBy is empty until the layer exists, and the reference arrives with the layer and never dangles: verified, useTooltip.tsx:586 and the MutationObserver test.
  • Claim: tooltipSurface.tsx is the old hook moved unchanged: false, tooltipSurface.tsx:113, :290-310, :335-346, :636-639.
  • Claim: a held hover shows once its delay has passed since entry, held keyboard focus shows at once, and only tooltips mounted before the load read a held intent: verified by the load tests and useTooltip.tsx:388, :495-498.
  • Claim: useLayer gains two internal options and no public option: verified, InternalContextLayerOptions.
  • Claim: callers that put describedBy into an attribute skip it when empty: incomplete; DateInput, DateTimeInput and DateRangeInput do not.
  • Claim: the records state FR2, FR14, the removed allowlist rows, the HoverCard gap and the new base modules: verified, with a stale cost sentence and a false screen-reader line left.
  • Claim: the boundary script keeps a listed base module as base code when an import() targets it: verified, the script diff and a passing check.
  • Claim: the shared test setup loads the tooltip once per file: verified, internal/test-utils/src/setup.ts.
  • Claim: 17 load tests pass: verified.
  • Claim: before the load, hover, focus and taps show nothing and no closed layer exists: verified; a tap made before the load is not answered later.
  • Claim: a failed load keeps triggers working, warns once in development and loads again when the next tooltip mounts: verified by the load test and the development-only warning.
  • Claim: HoverCard is unchanged: verified, no HoverCard file changes.
  • Claim: Button and IconButton eager size drops from 61.0 to 45.5 KB and Link from 52.3 to 35.3 KB: verified within local tolerance (61.2 → 45.7 and 52.5 → 35.5).
  • Claim: the four-page first-load table and the after-paint chunk sizes: not reproduced.
  • Claim: 29 importers carry the tooltip today: not verified; the count depends on what is counted.
  • Claim: the existing product suites pass with the tooltip loaded: verified for the Tooltip, InfoTip, Text, date input, Button, Link, form-field and Layer suites.
  • Claim: type check, ESLint, Prettier and knowledge checks pass: not run.
  • Claim: VoiceOver and NVDA were not run: consistent; the record row says otherwise.
  • Changeset: up to about 17 KB less gzipped JavaScript: consistent with the boundary check (Link −17.0 KB eager).
  • Changeset: tooltips look and behave as before once loaded: verified by the suites.
  • Changeset: a hover or keyboard focus still on a trigger shows its tooltip when the load lands: verified.
  • Changeset: until the load, no aria-describedby and no closed layer: false for the three date inputs, which render an empty attribute.
  • Changeset: tests should wait for the tooltip: consistent with the setup change.
  • .changeset/tooltip-loads-after-first-paint.md: finding (one false claim).
  • docs/architecture/component-import-boundaries.md: finding (INV3, INV4, INV6 unamended; stale cost sentence).
  • docs/specs/components/Tooltip/Tooltip.spec.md: finding (screen-reader line).
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear.
  • internal/test-utils/src/setup.ts: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx: clear.
  • packages/core/src/InfoTip/InfoTip.tsx: clear.
  • packages/core/src/Layer/useLayer.tsx: clear.
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear.
  • packages/core/src/Selector/Selector.tsx: clear.
  • packages/core/src/Slider/Slider.tsx: clear.
  • packages/core/src/Switch/Switch.tsx: clear.
  • packages/core/src/Tooltip/Tooltip.tsx: clear.
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts: clear.
  • packages/core/src/Tooltip/__tests__/TooltipAfterPaint.a11y.chromium.spec.ts: evidence gap (Chromium only, no axe).
  • packages/core/src/Tooltip/tooltipPresentInterest.ts: clear.
  • packages/core/src/Tooltip/tooltipSurface.tsx: clear (the description claim about it is the finding).
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx: finding (mount Effect); __resetTooltipForTest is exported and unused.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/useAnnounceRenderedText.adopters.test.tsx: clear.
  • packages/core/src/hooks/useInputStatusIcon.tsx: clear.
  • scripts/check-component-import-boundaries.mjs: clear.

Automated review (maintainer link)

The loaded layer reports its own id and anchor name to the trigger
contract from its commit, so useLayer needs no internal options.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9054af3

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 14, 2026
…ribedBy everywhere, INV3/INV4 records

- The first trigger that attaches schedules the load from its ref callback,
  on its own window, instead of a mount Effect.
- After a failed load, a later hover or focus on a trigger asks again at
  once (INV6).
- DateInput, DateTimeInput and DateRangeInput skip an empty describedBy;
  the useTooltip doc, example, template and stories show the same.
- Records: INV3 allows a description reference that arrives with its
  surface; INV4 says a pre-load tap on a Tooltip trigger is not held;
  the allowlist cost row matches the check; the Tooltip verification row
  states the screen-reader gap.
- The browser spec runs in Chromium and WebKit with axe before and after
  the load.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 2d31dc5

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 8885079

@github-actions github-actions Bot added needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval labels Nov 24, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision on the rewritten Tooltip record text, and on a description fix.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text changed after the last spec-owner approval (the hidden description copy now waits for the load, a disabled tooltip loads nothing, and useIsTooltipLoaded is named), so an engineering owner, the author included, records that decision by commenting /approve-spec <full head SHA> on this pull request.

  • Regression: the description's Change section lists twelve callers that skip an empty describedBy, "each a one-line change", but this revision changes only ComplexSelector and CheckboxInput, since the other nine (Tooltip, InfoTip, Selector, MultiSelector, Switch, Slider, DateInput, DateTimeInput, DateRangeInput) already do so on main, and the Scope line lists them too.
  • The description says a Button with no tooltip runs only "two useState, one committed ref, one context read and one store read", but the trigger contract also runs the useEffect at useTooltip.tsx:659-663 on every mount.

Non-blocking: the changeset's "up to about 22 KB" and the description's 24.1 KB docs-page saving disagree; the truncation-tooltip allowlist row (1.2 KB) and the INV1, INV8 gap line (1.7 KB) give different costs for the same crossing; a few comments still say the layer reports the id (inline suggestion); and the checker's new base-module exemption has no test of its own. No test or check could run for this review and CI skipped its jobs on this draft revision, so the load tests and the after-paint browser spec still need a CI run.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Core changeset: tooltip code loads in the background after first paint — verified in code (useTooltip.tsx:298-315); its load tests were not run.
  • Core changeset: pages load up to about 22 KB less gzipped JavaScript — not verified (no build); the description's own table gives the docs page 24.1 KB.
  • Core changeset: tooltips look and behave as before once loaded — not verified by tests (none could run); the surface is the base hook with narrow additions (diff against the base hook).
  • Core changeset: a hover or keyboard focus still on a trigger when the load lands shows its tooltip — verified in code (useTooltip.tsx:380-403, :579-605).
  • Core changeset: no aria-describedby until the load, then a hidden copy until the first show, then the tooltip — verified in code (useTooltip.tsx:685-686, tooltipSurface.tsx:400-412, :1045-1048).
  • Core changeset: a tooltip whose isEnabled is false loads nothing until enabled — verified in code (useTooltip.tsx:462-468, :659-663).
  • Core changeset: describedBy is empty until the load, so write describedBy || undefined; tests should wait for the load — verified (useTooltip.tsx:686, doc entries, shared test setup preload).
  • CLI changeset: the hook block template writes describedBy || undefined — verified (TooltipHookUsage.tsx:20).
  • Description: a Button with no tooltip and an Avatar with tooltip={false} never render the surface — verified (Button.tsx:1161-1166, Avatar.tsx:960).
  • Description: they run only two useState, one committed ref, one context read and one store read — false (the trigger contract also runs the useEffect at useTooltip.tsx:659-663).
  • Description: server-render timings, the five-page first-load table, the text-only +0.1 KB and the cross-bundler table — not verified (no build could run).
  • Description: about 29 components import the tooltip — not recounted at this revision.
  • Description: a disabled tooltip starts no load, one enabled with its trigger attached schedules it, and fields with no disabled reason load no tooltip code — verified in code (useTooltip.tsx:462-468, :659-663).
  • Description: the three-step description, with CheckboxInput naming its reason once the load is reported — verified in code (CheckboxInput.tsx:403, :497-499).
  • Description: the trigger contract keeps options and return types, records triggers, holds an early show() or hide() (a cancelling hide() calls onHide) and schedules one load per trigger window — verified in code (useTooltip.tsx:412-617).
  • Description: the description element reports its id from its own commit, never ahead of the element — verified in code (tooltipSurface.tsx:400-412).
  • Description: the schedule copies an open touch-runtime pull request — consistent (that pull request is still open).
  • Description: the surface is today's hook moved plus a wrapper, with the listed changes — verified (diff of the base hook against tooltipSurface.tsx).
  • Description: the layer runtime and HoverCard are unchanged — verified (no Layer/ or HoverCard/ file in the diff).
  • Description: twelve callers skip an empty describedBy, each a one-line change — false (this revision changes only ComplexSelector and CheckboxInput; the other nine already skip it on main).
  • Description: the doc entry, @example, hook template and two stories show describedBy || undefined — verified.
  • Description: the record edits (Tooltip FR2, AR1, PR2, ownership list, FR14; INV3 and INV4 amendments; allowlist rows; HoverCard gap; base modules) — verified against the records; unapproved at this revision.
  • Description: INV6 is unchanged and the code meets it — verified in code (useTooltip.tsx:262-282, :697-703).
  • Description: the boundary script keeps a listed base module as base code when an import() targets it — verified (check-component-import-boundaries.mjs:226-232); no test of its own.
  • Description: the test setup loads the tooltip once per file — verified (setup.ts:44-46).
  • Description: 29 load tests pass, and the seven added for review each failed first — 29 tests present; not run.
  • Description: the after-paint browser spec runs in Chromium and WebKit, and the pattern spec waits for the load — present (TooltipAfterPaint.a11y.browser.spec.ts; Tooltip.a11y.chromium.spec.ts:72-74); not run.
  • Description: the server-render tests assert no reference in server markup and a description after hydration — verified by reading; not run.
  • Description: the wider suites, typecheck, lint, formatting and knowledge checks pass — not verified (nothing could run).
  • Description: VoiceOver and NVDA were not run — a stated evidence gap.
  • Description: the three pre-review findings sit in moved code — verified (present unchanged in the base hook).
  • Description: authored lines 3,170 — false at this revision (3,800 lines in the diff); size is advisory.

Files:

  • packages/core/src/Tooltip/useTooltip.tsx: non-blocking comment wording (lines 11-13, 317, 353, 644-645); otherwise clear.
  • packages/core/src/Tooltip/tooltipSurface.tsx: non-blocking comment wording (lines 187-190); otherwise clear.
  • packages/core/src/Tooltip/tooltipPresentInterest.ts, useTooltip.doc.mjs: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, ComplexSelector/ComplexSelector.tsx, hooks/useInputStatusIcon.tsx: clear.
  • docs/specs/components/Tooltip/Tooltip.spec.md: proposed FR2, AR1, PR2 and FR14 changes await an owner decision.
  • docs/architecture/component-import-boundaries.md: proposed edits await an owner decision; non-blocking cost mismatch (line 249 against line 279).
  • scripts/check-component-import-boundaries.mjs: non-blocking test gap; its test file: clear.
  • useTooltip.load.test.tsx, TooltipAfterPaint.a11y.browser.spec.ts, Tooltip.a11y.chromium.spec.ts, Tooltip.ssr.test.tsx, CheckboxInput.ssr.test.tsx, touchActionRule.test.ts, useAnnounceRenderedText.adopters.test.tsx: clear by reading; not run.
  • internal/test-utils/src/setup.ts, .github/scripts/lib/a11y-spec-files.mjs, no-comment-provenance.baseline.json: clear.
  • apps/storybook/stories/Tooltip.stories.tsx, ChatLayout.stories.tsx, TooltipHookUsage.tsx: clear.
  • .changeset/tooltip-loads-after-first-paint.md: non-blocking figure mismatch with the description; .changeset/tooltip-hook-template-empty-describedby.md: clear.

Automated review (maintainer link)

…he gap cost matches the check, a test for the base-module exemption

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and three fixes are needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text was rewritten after the last spec approval (the three-step description, no load from a disabled tooltip, useIsTooltipLoaded), and the newest commit edits the import-boundaries gap line; an engineering owner records the decision by commenting /approve-spec 7efd7db7c62a976d399edc07be402a1b24cd68c9, and the author may do so as an engineering owner.

  • Miss: before the tooltip loads, a press on a Tokenizer's or Typeahead's status info-tip moves focus to the input (and can open Tokenizer's sheet), against component:Typeahead FR15 and component:Tokenizer FR32, because hooks/statusButtonPress.ts matches the button by aria-describedby === describedBy and both are empty until the load; identify the info-tip button another way, such as an id or ref that useInputStatusIcon gives it.
  • Miss: scheduleTooltipLoad in useTooltip.tsx adds a second after-paint schedule beside the truncation tooltip's afterPaintModule preload on main, and the two already differ (one idles with a 2 s cap in the trigger's window, the other does not), so put the after-paint wait in one shared place, such as the shared module loader, and have both call it.
  • The description says scheduleShow and handleMouseEnter take the elapsed time, but handleHover is the handler that does; please correct the name.

Non-blocking: the FR2 load, FR14 verification row says Chromium's accessibility-tree check runs "with no input", but TooltipAfterPaint.a11y.browser.spec.ts hovers the trigger first. The load tests and the after-paint browser spec have no result at this revision, since CI's jobs were skipped for this draft.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later: verified (useTooltip.tsx:298-315).
  • A Button with no tooltip runs two useState, one committed ref, one context read, one store read and one Effect, and renders no surface: verified (useTooltip.tsx:649-697); the server-render timings and sample shares: not rechecked.
  • First-load tables for the five pages, four bundlers and the app build: not rebuilt.
  • No aria-describedby before the load, a hidden copy from the load, the tooltip's content after the first show: verified in code (useTooltip.tsx:673-696, tooltipSurface.tsx:401-414).
  • CheckboxInput names its reason only once the tooltip has loaded: verified (CheckboxInput.tsx:497).
  • A disabled tooltip starts no load, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:470-474, :665-669).
  • Held hover, focus and show(), a hide() that cancels a held show() reporting onHide, and one schedule per window: verified (useTooltip.tsx:386-416, :565-584, :298-302).
  • scheduleShow and handleMouseEnter take the elapsed time: false; handleHover takes it (tooltipSurface.tsx:467-492).
  • Only a tooltip that mounted before the load reads a held intent, at its first connect: verified (useTooltip.tsx:448, :593-596).
  • The layer runtime is unchanged: verified.
  • Callers skip an empty describedBy; nine components already do on the base branch and this change adds ComplexSelector: verified for described-by lists (ComplexSelector.tsx:683, utils/inputAria.ts:26-34); the info-tip press check in Tokenizer and Typeahead does not skip it (blocking finding).
  • The records state the three-step description, FR14, the INV3 and INV4 amendments, the base modules and the allowlist edits: verified in the diff; not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-233, test at .test.mjs:263-287).
  • The test setup preloads the tooltip once per file: verified (internal/test-utils/src/setup.ts:44-46).
  • 29 load tests pass, each added case failing first: the count is verified; the results were not run here.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step: verified in the spec (Firefox runs it too); not run here.
  • A failed load warns once in development: verified (utils/devWarning.ts:166).
  • Core changeset: verified against the code; its 24 KB matches the description's docs-page saving, which was not rebuilt.
  • CLI changeset: the hook block template writes describedBy || undefined: verified (TooltipHookUsage.tsx:20).

Files:

  • .changeset/tooltip-hook-template-empty-describedby.md: clear
  • .changeset/tooltip-loads-after-first-paint.md: clear
  • .github/scripts/lib/a11y-spec-files.mjs: clear
  • apps/storybook/stories/ChatLayout.stories.tsx: clear
  • apps/storybook/stories/Tooltip.stories.tsx: clear
  • docs/architecture/component-import-boundaries.md: proposed edits wait on the spec decision
  • docs/specs/components/Tooltip/Tooltip.spec.md: proposed edits wait on the spec decision; one non-blocking row wording
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear
  • internal/test-utils/src/setup.ts: clear
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear
  • packages/core/src/CheckboxInput/CheckboxInput.ssr.test.tsx: clear
  • packages/core/src/CheckboxInput/CheckboxInput.tsx: clear
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear
  • packages/core/src/Tooltip/Tooltip.ssr.test.tsx: clear
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts: clear
  • packages/core/src/Tooltip/__tests__/TooltipAfterPaint.a11y.browser.spec.ts: clear (see the record row note)
  • packages/core/src/Tooltip/tooltipPresentInterest.ts: clear
  • packages/core/src/Tooltip/tooltipSurface.tsx: clear
  • packages/core/src/Tooltip/useTooltip.doc.mjs: clear
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: clear
  • packages/core/src/Tooltip/useTooltip.tsx: blocking (second after-paint schedule)
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear
  • packages/core/src/hooks/useAnnounceRenderedText.adopters.test.tsx: clear
  • packages/core/src/hooks/useInputStatusIcon.tsx: blocking (its empty describedBy defeats the info-tip press check)
  • scripts/check-component-import-boundaries.mjs: clear
  • scripts/check-component-import-boundaries.test.mjs: clear

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and one fix is needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text was rewritten after the last spec approval (the three-step description, no load from a disabled tooltip, useIsTooltipLoaded), so it and the import-boundaries INV3 and INV4 amendments need a decision at this revision; an engineering owner records it by commenting /approve-spec 097356fbb3c87946d62264b892c08b50c389c56e, and the author may do so as an engineering owner.

  • Miss: before the tooltip loads, a wrapping Tooltip gives its Button no aria-describedby, so hasCallerTooltip in Text/cutText.tsx sees no caller tooltip, keyboard focus on a cut Button label opens the cut-label tooltip too, and both tooltips open above the Button when the load lands, against component:Button FR18 (a caller's tooltip wins); recognise a tooltip trigger without its description, as the status info-tip now is, and add a load test for a wrapped cut-label Button focused before the load.

The three findings from the last review are fixed, but the load tests and the after-paint browser spec have no result at this revision, since CI's jobs were skipped for this draft.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later: verified (useTooltip.tsx:298-312, utils/moduleLoader.ts:16-39).
  • A Button with no tooltip runs two useState, one committed ref, one context read, one store read and one Effect, and renders no surface: verified (useTooltip.tsx:649-669, Button.tsx:1161-1166); the server-render timings and sample shares: not rechecked.
  • First-load tables for the five pages, four bundlers and the app build: not rebuilt.
  • 29 tooltip importers today: not reproduced (the counting method is not stated; 31 component folders import a Tooltip module at the base).
  • No aria-describedby before the load, a hidden copy from the load, the tooltip's content after the first show: verified in code (useTooltip.tsx:688-689, tooltipSurface.tsx:401-415, :1047).
  • CheckboxInput names its reason only once the tooltip has loaded: verified (CheckboxInput.tsx:403, :497).
  • A disabled tooltip starts no load, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:465-471, :662-666).
  • One shared after-paint wait for the tooltip load and the truncation-tooltip preload: verified (utils/moduleLoader.ts:16-39, TruncationTooltip.tsx:50-53, useTooltip.tsx:305).
  • Typeahead and Tokenizer recognise their info-tip from a registered button, and a pre-load press keeps focus on it: verified (hooks/statusButtonPress.ts:16-50, useInputStatusIcon.tsx:155-158, :227; load test for Typeahead).
  • The hook keeps its options and return type: verified (useTooltip.tsx:56-224).
  • Held show()/hide() with the latest winning, and a hide() that cancels a held show() reporting onHide: verified (useTooltip.tsx:562-581).
  • One schedule per trigger window from the first attaching ref callback; a trigger that never attaches starts none: verified (useTooltip.tsx:298-302, :467-511).
  • describedBy is empty until the load and the description element reports from its own commit: verified (useTooltip.tsx:647-649, :689; tooltipSurface.tsx:401-415).
  • The surface is the old hook moved, with scheduleShow and handleHover taking the elapsed time and the held hover replayed with it: verified (tooltipSurface.tsx:422-441, :467-478, :849-856).
  • Only a tooltip that mounted before the load reads a held intent, at its first connect: verified (useTooltip.tsx:441-446, :590-594).
  • The layer runtime and HoverCard are unchanged: verified.
  • Callers skip an empty describedBy, and this change adds ComplexSelector: verified for described-by lists (ComplexSelector.tsx:683); Button's cut-label check still reads a wrapping Tooltip from the attribute (blocking finding).
  • The records state the three-step description, FR14, the INV3 and INV4 amendments, the base modules and the allowlist edits: verified in the diff; not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-233, test at .test.mjs:263-287).
  • The test setup preloads the tooltip once per file: verified (internal/test-utils/src/setup.ts:41-46).
  • A failed load warns once, drops a held show() through onHide, and a later intent or the next mount loads again: verified (useTooltip.tsx:262-282, :453-464, :562-568, :700-706).
  • A tap before the load is not held, even with :hover kept, and an unseen :hover counts only where the device can hover: verified (useTooltip.tsx:399-413).
  • 30 load tests pass: the count is verified; the results were not run here.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step: verified in the spec (Firefox runs it too); not run here.
  • About 3,800 authored lines: 3,951 at this revision.
  • Core changeset: verified against the code; its 24 KB matches the description's docs-page saving, which was not rebuilt.
  • CLI changeset: the hook block template writes describedBy || undefined: verified (TooltipHookUsage.tsx:20).

Files:

  • .changeset/tooltip-hook-template-empty-describedby.md: clear
  • .changeset/tooltip-loads-after-first-paint.md: clear
  • .github/scripts/lib/a11y-spec-files.mjs: clear
  • apps/storybook/stories/ChatLayout.stories.tsx: clear
  • apps/storybook/stories/Tooltip.stories.tsx: clear
  • docs/architecture/component-import-boundaries.md: proposed edits wait on the spec decision
  • docs/specs/components/Tooltip/Tooltip.spec.md: proposed edits wait on the spec decision
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear
  • internal/test-utils/src/setup.ts: clear
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear
  • packages/core/src/CheckboxInput/CheckboxInput.ssr.test.tsx: clear
  • packages/core/src/CheckboxInput/CheckboxInput.tsx: clear
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear
  • packages/core/src/Text/TruncationTooltip.tsx: clear
  • packages/core/src/Tooltip/Tooltip.ssr.test.tsx: clear
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts: clear
  • packages/core/src/Tooltip/__tests__/TooltipAfterPaint.a11y.browser.spec.ts: clear
  • packages/core/src/Tooltip/tooltipPresentInterest.ts: clear
  • packages/core/src/Tooltip/tooltipSurface.tsx: clear
  • packages/core/src/Tooltip/useTooltip.doc.mjs: clear
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: no test covers a wrapped cut-label Button focused before the load (blocking finding)
  • packages/core/src/Tooltip/useTooltip.tsx: empty describedBy before the load leaves the cut-label check blind (blocking finding)
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear
  • packages/core/src/hooks/statusButtonPress.ts: clear; non-blocking naming note
  • packages/core/src/hooks/useAnnounceRenderedText.adopters.test.tsx: clear
  • packages/core/src/hooks/useInputStatusIcon.tsx: clear
  • packages/core/src/utils/moduleLoader.ts: clear
  • scripts/check-component-import-boundaries.mjs: clear
  • scripts/check-component-import-boundaries.test.mjs: clear

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and two fixes are needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text was rewritten after the last spec approval (most recently FR14's isTooltipTriggerBeforeLoad sentence for the cut-label case), so it and the import-boundaries INV3 and INV4 amendments need a decision at this revision; an engineering owner records it by commenting /approve-spec 4d0a414a8b606d3abc4fc1f13c3a9cc341020620, and the author may do so as an engineering owner.

  • scheduleTooltipLoad in Tooltip/useTooltip.tsx (lines 334-345) again writes its own frame-then-task after-paint wait beside the same wait in Text/TruncationTooltip.tsx and Text/cutTextOnKeyboardFocus.tsx, and the three already differ (the trigger's window plus idle here, the global window there), so a fix to one misses the others; put one after-paint wait in utils/moduleLoader.ts, as the previous revision did, and have all three call it.
  • The description is stale at this revision: a Button with no tooltip now runs two committed refs and two context reads in useTooltip (not one of each), the server-render timing beside that list predates the change, and the pull request has 4,013 authored lines rather than about 3,800.

The cut-label finding from the last review is fixed; the load tests and the after-paint browser spec still have no result at this revision, since CI's jobs were skipped for this draft.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later, and no input starts it: verified (useTooltip.tsx:315-346).
  • A Button with no tooltip and an Avatar with tooltip={false} run two useState, one committed ref, one context read, one store read and one Effect: false (two committed refs and two context reads, useTooltip.tsx:690-712); the server-render timings and sample shares: not rechecked.
  • First-load tables for the five pages, four bundlers and the app build, and the text-only page's 0.1 KB: not rebuilt.
  • No aria-describedby before the load, a hidden copy from the load, the tooltip's content after the first show: verified in code (useTooltip.tsx:690, :731-732; tooltipSurface.tsx:399-413).
  • CheckboxInput names its reason only once the tooltip has loaded: verified (CheckboxInput.tsx:403, :497).
  • A disabled tooltip starts no load, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:500-506, :705-709).
  • Before the load, Button's cut-label check yields to a wrapping Tooltip: verified (Text/cutText.tsx:89-95, useTooltip.tsx:262-287, load test at useTooltip.load.test.tsx:582-636).
  • Typeahead and Tokenizer recognise their info-tip from a registered button, and a pre-load press keeps focus on it: verified (hooks/statusButtonPress.ts:15-51, useInputStatusIcon.tsx:155-158, :227).
  • The hook keeps its options and return type: verified (useTooltip.tsx:57-225).
  • Held show()/hide() with the latest winning, and a hide() that cancels a held show() reporting onHide: verified (useTooltip.tsx:603-622).
  • One schedule per trigger window from the first attaching ref callback; a trigger that never attaches starts none: verified (useTooltip.tsx:329-346, :502-552).
  • The description element reports from its own commit: verified (tooltipSurface.tsx:399-413, :1047).
  • The surface is the old hook moved, with the elapsed hover time added and the held hover replayed with it: verified (diff against the base hook; tooltipSurface.tsx:420-441, :467-478, :851-856).
  • Only a tooltip that mounted before the load reads a held intent, at its first connect: verified (useTooltip.tsx:480-481, :631-635).
  • The layer runtime and HoverCard are unchanged: verified.
  • Callers skip an empty describedBy, main already does for nine components, and this change adds ComplexSelector: verified (joinAriaIDs, filter(Boolean), mergeIds, || undefined; ComplexSelector.tsx:683).
  • The records state the three-step description, FR14, the INV3 and INV4 amendments, the base modules and the allowlist edits, and leave INV6 unchanged: verified in the diff; not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-234, test at .test.mjs:263-287).
  • The test setup preloads the tooltip once per file: verified (internal/test-utils/src/setup.ts:41-46).
  • A failed load warns once, drops a held show() through onHide, and a later hover, focus, show() or the next mount loads again: verified (useTooltip.tsx:293-313, :488-499, :743-749).
  • A tap before the load is not held, even with :hover kept, and an unseen :hover counts only where the device can hover: verified (useTooltip.tsx:433-447).
  • 31 load tests pass: the count is verified; the results were not run here.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step and reads Chromium's accessibility-tree description: verified in the spec; not run.
  • Unifying the three after-paint waits is left to a follow-up: accurate, and the reason for the first blocking finding.
  • About 3,800 authored lines: false (4,013).
  • VoiceOver and NVDA were not run: accurate; the record names the gap.
  • Core changeset (load after first paint, behavior once loaded, empty describedBy, disabled tooltips load nothing): verified in code; "up to about 24 KB" not rebuilt.
  • CLI changeset (the hook block template skips an empty describedBy): verified.

Files:

  • .changeset/tooltip-hook-template-empty-describedby.md, .changeset/tooltip-loads-after-first-paint.md: clear.
  • .github/scripts/lib/a11y-spec-files.mjs: clear.
  • apps/storybook/stories/ChatLayout.stories.tsx, apps/storybook/stories/Tooltip.stories.tsx: clear.
  • docs/architecture/component-import-boundaries.md, docs/specs/components/Tooltip/Tooltip.spec.md: proposed text awaiting an engineering owner's decision.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json, internal/test-utils/src/setup.ts: clear.
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, CheckboxInput.ssr.test.tsx: clear.
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear.
  • packages/core/src/Text/cutText.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx: blocking (third after-paint wait); non-blocking (described-trigger count follows attach only).
  • packages/core/src/Tooltip/tooltipSurface.tsx, tooltipPresentInterest.ts, useTooltip.doc.mjs, useTooltip.load.test.tsx, Tooltip.ssr.test.tsx, __tests__/Tooltip.a11y.chromium.spec.ts, __tests__/TooltipAfterPaint.a11y.browser.spec.ts: clear.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/statusButtonPress.ts: non-blocking naming note.
  • packages/core/src/hooks/useInputStatusIcon.tsx, useAnnounceRenderedText.adopters.test.tsx: clear.
  • scripts/check-component-import-boundaries.mjs, scripts/check-component-import-boundaries.test.mjs: clear.

Automated review (maintainer link)

… and Text's loaders; recount a described trigger when isEnabled changes
…rst-paint

# Conflicts:
#	docs/architecture/component-import-boundaries.md
#	docs/specs/components/Tooltip/Tooltip.spec.md
#	packages/core/src/utils/moduleLoader.test.ts
#	packages/core/src/utils/moduleLoader.ts

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and two fixes are needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text and the import-boundaries INV3 and INV4 amendments, base-module rule and allowlist costs have no spec approval at this revision. The truncation-tooltip allowlist costs changed again, and the merge of main reconciled both records. An engineering owner records the decision by commenting /approve-spec c1e6ca7c3ee8ea88af1093e0667a1893db88b44a, and the author may do so as an engineering owner.

  • The description is wrong at this revision: its Scope says the after-paint wait still has three copies and that unifying them is a follow-up, but afterNextPaint in utils/moduleLoader.ts now serves the tooltip load and Text's two loaders (neither change is in the Change list), and it says 31 load tests where useTooltip.load.test.tsx has 32.
  • Miss: TooltipDescription.a11y.browser.spec.ts:62 and the button-disabled-with-tooltip description read in Button.a11y.chromium.spec.ts:229 check a tooltip's description once, right after the story mounts and before the after-paint load can land, so they race the load; wait for the reference first, as Tooltip.a11y.chromium.spec.ts:74 now does.

The previous review's findings (the copied after-paint wait, the stale hook list, and the trigger count that ignored isEnabled changes) are fixed. No test or browser spec has a result at this revision, because CI skipped its jobs on this draft.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later, and no input starts it: verified (useTooltip.tsx:329-343, moduleLoader.ts:20-26).
  • A Button with no tooltip and an Avatar with tooltip={false} run two useState, two committed refs, two context reads, one store read and one Effect: verified (useTooltip.tsx:695-715). The render timings are stated as measured at an earlier revision and were not rechecked.
  • First-load tables for the pages, bundlers and app build, and the text-only page's 0.1 KB: not rebuilt.
  • No aria-describedby before the load, a hidden copy from the load, then the tooltip's content: verified in code (useTooltip.tsx:695, :734-735; tooltipSurface.tsx:401-415).
  • CheckboxInput names its reason only once the tooltip has loaded: verified (CheckboxInput.tsx:403, :497).
  • A disabled tooltip starts no load, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:503-507, :604-607, :710-712).
  • Before the load, Button's cut-label check yields to a wrapping Tooltip: verified (Text/cutText.tsx:89-95, useTooltip.tsx:262-287).
  • Typeahead and Tokenizer recognise their info-tip from a registered button: verified (hooks/statusButtonPress.ts:14-51, useInputStatusIcon.tsx:155-158).
  • The hook keeps its options and return type, and its held show()/hide() follow the latest call, with a cancelling hide() reporting onHide: verified (useTooltip.tsx:57-225, :608-627).
  • One schedule per trigger window from the first attaching ref callback, and none without an attached trigger: verified (useTooltip.tsx:329-343, :503-556).
  • The surface is the old hook moved, with the elapsed hover time and the description report added: verified (diff against the base hook).
  • The layer runtime and HoverCard are unchanged: verified.
  • Callers skip an empty describedBy, and this change adds ComplexSelector, the docs, the template and the stories: verified.
  • The records state the three-step description, FR14, the INV3 and INV4 amendments, the base modules and the allowlist edits, and leave INV6 unchanged: verified in the diff, not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-232, test at .test.mjs:263-287).
  • The test setup preloads the tooltip once per file: verified (internal/test-utils/src/setup.ts:41-46).
  • A failed load warns once and drops a held show() through onHide; a later hover, focus, show() or the next mount loads again: verified (useTooltip.tsx:293-313, :489-500, :746-752).
  • A tap before the load is not held, and an unseen :hover counts only where the device can hover: verified (useTooltip.tsx:434-448).
  • 31 load tests pass: false (32 at this revision; none run here).
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step: verified in the spec, not run.
  • Unifying the three after-paint waits is a separate follow-up: false (done at this revision).
  • About 4,000 authored lines: about right (4,127).
  • VoiceOver and NVDA were not run: accurate; the proposed record names the gap.
  • Core changeset: verified in code; "up to about 24 KB" not rebuilt. CLI changeset: verified.

Files:

  • .changeset/tooltip-hook-template-empty-describedby.md, .changeset/tooltip-loads-after-first-paint.md: clear.
  • .github/scripts/lib/a11y-spec-files.mjs: clear.
  • apps/storybook/stories/ChatLayout.stories.tsx, apps/storybook/stories/Tooltip.stories.tsx: clear.
  • docs/architecture/component-import-boundaries.md, docs/specs/components/Tooltip/Tooltip.spec.md: proposed text awaiting an engineering owner's decision; the AR1 row cites a browser check that races the load.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json, internal/test-utils/src/setup.ts: clear.
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, CheckboxInput.ssr.test.tsx: clear.
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear.
  • packages/core/src/Text/cutText.tsx, Text/TruncationTooltip.tsx, Text/cutTextOnKeyboardFocus.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx, tooltipSurface.tsx, tooltipPresentInterest.ts, useTooltip.doc.mjs, useTooltip.load.test.tsx, Tooltip.ssr.test.tsx, __tests__/Tooltip.a11y.chromium.spec.ts, __tests__/TooltipAfterPaint.a11y.browser.spec.ts: clear.
  • packages/core/src/utils/moduleLoader.ts, moduleLoader.test.ts: clear.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/statusButtonPress.ts: non-blocking naming note.
  • packages/core/src/hooks/useInputStatusIcon.tsx, useAnnounceRenderedText.adopters.test.tsx: clear.
  • scripts/check-component-import-boundaries.mjs, scripts/check-component-import-boundaries.test.mjs: clear.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and four fixes are needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text and the import-boundaries INV3 and INV4 amendments, base-module rule and allowlist costs have no spec approval at this revision; an engineering owner records the decision by commenting /approve-spec f761e0734c11d2cbc4db8044c785091a0fdaedfd, and the author may do so as an engineering owner. FR14 and the INV4 amendment also say "the next tap shows the tooltip", which under FR5 an action trigger never does, so that wording needs a look with the approval.

  • Newly live check: the core changeset says "a field with no disabled reason adds no tooltip code to its page", but a Slider's default value tooltip calls useTooltip with no isEnabled (Slider/Slider.tsx:700-705) and schedules the load, so the sentence should say what FR14 says, that a field's disabled-reason tooltip adds no tooltip code where it cannot show (the description's "a form whose fields have no disabled reason or status tooltip loads no tooltip code at all" has the same problem).
  • Newly live check: the description's declared difference says that after a tap before the load "the next tap shows the tooltip", but under the default touchTrigger="auto" a tap on a Button, IconButton or Link never shows it (FR5), so it should say the next tap is handled as on a loaded tooltip.
  • Newly live check: the description says callers skip an empty describedBy and the useTooltip docs show describedBy || undefined, but the toggle-trigger guidance in Tooltip/useTooltip.doc.mjs:212 and the hook trigger in Tooltip/__tests__/Tooltip.a11y.renders.tsx:50 still pass it raw, which renders aria-describedby="" before the load.
  • Miss: the Effect at Tooltip/useTooltip.tsx:710-712 recounts the described trigger through describes() but lists only bridge and isEnabled, so a change of the TooltipDescribesContext value above a mounted tooltip leaves isTooltipTriggerBeforeLoad stale; add that value to its dependencies.

The previous review's two browser-spec findings are fixed, though no test or browser spec has a result at this revision because CI skipped its jobs on this draft.

Claims and files checked

Review mode: full; reason: recipe-changed (many rules)

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later, and no input starts it: verified (useTooltip.tsx:329-343, moduleLoader.ts:20-26; load tests for the schedule and for input before paint).
  • Importing Button, IconButton, Link or TextInput loads no layer code, and only the trigger contract imports the surface: verified (load test; a repository search finds the dynamic import and a type import, plus test references).
  • A Button with no tooltip and an Avatar with tooltip={false} run only the trigger contract and render no surface: verified (useTooltip.tsx:695-715; load test asserting no surface for them).
  • Render timings, sample shares, first-load tables, cross-bundler and app figures, and the text-only page's 0.1 KB: reported.
  • A disabled tooltip starts no load, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:503-507, :604-607, :710-712; load test).
  • A form whose fields have no disabled reason or status tooltip loads no tooltip code, and a field with no disabled reason adds none: false (Slider's value tooltip).
  • No description before the load, a hidden copy from the load, then the tooltip's content, with the same id: verified (useTooltip.tsx:695, :734-735; tooltipSurface.tsx:113-160, :1036-1048; load tests including a MutationObserver check).
  • CheckboxInput names its reason only once the tooltip has loaded, in the same render as the copy: verified (CheckboxInput.tsx:403, :497; SSR test).
  • One shared after-paint wait serves the tooltip load and Text's two loaders, whose timing is unchanged: verified (moduleLoader.ts:20-26, TruncationTooltip.tsx:51, cutTextOnKeyboardFocus.tsx:33; unit tests).
  • Before the load, Button's cut label yields to a wrapping Tooltip, recounted when isEnabled changes: verified (Text/cutText.tsx:90-94, useTooltip.tsx:262-287, :527-534; load tests).
  • Typeahead and Tokenizer recognise their info-tip from a registered button, and a press before the load keeps focus on it: verified (statusButtonPress.ts:15-51, useInputStatusIcon.tsx:155-158; Typeahead load test; Tokenizer by code at Tokenizer.tsx:1551, :1851).
  • The hook keeps its options and return type, holds an early show() or hide() with the latest winning, and a cancelling hide() reports onHide: verified (useTooltip.tsx:57-225, :608-627; load tests).
  • One schedule per trigger window from the first attaching ref callback, none without an attached trigger, and a window that goes away does not stop the load: verified (useTooltip.tsx:329-343, :503-556; load tests).
  • The surface is the old hook moved, with the elapsed hover time and the description report added: verified (diff against the base hook).
  • A held hover shows once its delay has passed since entry, held keyboard focus shows at once, an early show(), isOpen or isDefaultOpen opens once, and a pointer or focus that left shows nothing: verified (load tests; isDefaultOpen by code at tooltipSurface.tsx:925-930).
  • A failed load warns once in development, drops a held show() through onHide, and a later hover, focus or show(), or the next mount, loads again: verified (useTooltip.tsx:293-313, :489-500, :552, :608-614; load tests for hover, show() and the next mount).
  • A tap before the load is not held, including a :hover no listener saw where the device cannot hover: verified (useTooltip.tsx:418-448; load tests); "the next tap shows the tooltip": false for action triggers.
  • The layer runtime and HoverCard are unchanged: verified (no file under them changes).
  • Callers that put describedBy into an attribute skip it when empty, and the docs, template and stories show describedBy || undefined: false (doc guidance and one story fixture).
  • The records state the three-step description, FR14, the INV3 and INV4 amendments and the base modules, and leave INV6 unchanged: verified in the diff, not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-234; unit test).
  • The test setup loads the tooltip once per file: verified (internal/test-utils/src/setup.ts:41-46).
  • 32 load tests pass: 32 tests at this revision, none run here.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step, and three browser checks wait for the reference: verified in the specs, not run.
  • About 4,133 authored lines: reported (4,152 at this revision after the test-only commit).
  • VoiceOver and NVDA were not run: accurate; the proposed record names the gap.
  • Core changeset: false for the field sentence; "up to about 24 KB": reported. CLI changeset: verified.

Files:

  • .changeset/tooltip-loads-after-first-paint.md: false field claim; .changeset/tooltip-hook-template-empty-describedby.md: clear.
  • .github/scripts/lib/a11y-spec-files.mjs: clear.
  • apps/storybook/stories/ChatLayout.stories.tsx, apps/storybook/stories/Tooltip.stories.tsx: clear.
  • docs/architecture/component-import-boundaries.md, docs/specs/components/Tooltip/Tooltip.spec.md: proposed text awaiting an engineering owner's decision, including the "next tap" wording.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json, internal/test-utils/src/setup.ts: clear.
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear.
  • packages/core/src/Button/__tests__/Button.a11y.chromium.spec.ts: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, CheckboxInput.ssr.test.tsx: clear.
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear.
  • packages/core/src/Text/cutText.tsx, Text/TruncationTooltip.tsx, Text/cutTextOnKeyboardFocus.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx: Effect dependency finding; tooltipSurface.tsx, tooltipPresentInterest.ts, Tooltip.ssr.test.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.doc.mjs: raw describedBy guidance left at line 212.
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: clear; the failed-load retry test names focus but fires only a pointer entry (non-blocking).
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts, TooltipAfterPaint.a11y.browser.spec.ts, TooltipDescription.a11y.browser.spec.ts: clear.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/statusButtonPress.ts: non-blocking naming note; useInputStatusIcon.tsx, useAnnounceRenderedText.adopters.test.tsx: clear.
  • packages/core/src/utils/moduleLoader.ts, moduleLoader.test.ts: clear.
  • scripts/check-component-import-boundaries.mjs, scripts/check-component-import-boundaries.test.mjs: clear.

Automated review (maintainer link)

…t changes; hook callers skip an empty describedBy; records say a pre-load tap leaves the next tap to FR5

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and two fixes are needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text and the import-boundaries INV3 and INV4 amendments, base-module rule and allowlist costs have no spec approval at this revision; they contradict the current INV3, INV4 and Tooltip FR2 until an engineering owner records the decision by commenting /approve-spec fd86f15e3fa1cbb60c6656754d199a8ec847d893, and the author may do so as an engineering owner.

  • Miss: before the tooltip loads, a cut Button label yields to a wrapping Tooltip whose content repeats the Button's name, because isTooltipTriggerBeforeLoad counts it (Tooltip/useTooltip.tsx:528-534) although Tooltip adds no description for it (Tooltip/Tooltip.tsx:364), so the result depends on timing and contradicts component:Button FR18 and the function's own JSDoc; skip such a Tooltip in the count, or state that pre-load rule in FR14 and the description, and add a load test either way.
  • The description says 32 load tests pass, but Tooltip/useTooltip.load.test.tsx has 33 at this head and its "Added for this head" list names tests from earlier revisions; update both.

The previous review's four fixes are in (the changeset's field sentence, the next-tap wording, the raw describedBy sites and the Effect's dependency), though no test or browser spec has a result at this revision because CI skipped its jobs on this draft.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later, and no input starts it: verified (useTooltip.tsx:329-343, moduleLoader.ts:20-26; load tests for the schedule and for input before paint).
  • About 29 components carry the tooltip and layer runtime on main: verified (29 component folders import a Tooltip module statically on main, beside Text's lazy truncation tooltip and the shared hooks folder).
  • Importing Button, IconButton, Link or TextInput loads no layer code, and only the trigger contract imports the surface: verified (load test; a repository search finds the dynamic import and a type import, plus test references).
  • A Button with no tooltip and an Avatar with tooltip={false} run only the trigger contract and render no surface: verified (useTooltip.tsx:695-717; load test).
  • Render timings, sample shares, first-load tables, cross-bundler and app figures, the text-only page's 0.1 KB and the measured static-import alternative: reported.
  • A disabled tooltip starts no load, so a field's disabled-reason tooltip adds no tooltip code where it cannot show, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:503-507, :604-607, :712-714; every disabled-reason tooltip passes isEnabled: showsDisabledMessage; load tests).
  • No description before the load, a hidden copy from the load, then the tooltip's content, with the same id: verified (load tests including a MutationObserver check; the after-paint browser spec).
  • CheckboxInput names its reason only once the tooltip has loaded, in the same commit as the copy: verified (CheckboxInput.tsx:403, :497; SSR test).
  • One shared after-paint wait serves the tooltip load and Text's two loaders, whose timing is unchanged: verified (moduleLoader.ts:20-26, TruncationTooltip.tsx:51, cutTextOnKeyboardFocus.tsx:33; unit tests).
  • Before the load, Button's cut label recognises a wrapping Tooltip as an attached trigger of an enabled tooltip that describes it, recounted when isEnabled changes, so it yields to the caller's tooltip: false for a wrapping Tooltip that repeats the Button's name, which is counted though it adds no description.
  • Typeahead and Tokenizer recognise their info-tip from a registered button, and a press before the load keeps focus on it: verified (statusButtonPress.ts:15-51, useInputStatusIcon.tsx:155-158, :241; Typeahead load test; Tokenizer by code at Tokenizer.tsx:1551, :1851).
  • The hook keeps its options and return type, holds an early show() or hide() with the latest winning, and a cancelling hide() reports onHide: verified (useTooltip.tsx:57-225, :608-627; load tests).
  • One schedule per trigger window from the first attaching ref callback, none without an attached trigger, and a window that goes away does not stop the load: verified (useTooltip.tsx:329-343, :503-556; load tests).
  • The schedule copies another pull request's touch runtime, and whichever merges second imports the other's constant: reported (main has no such schedule yet).
  • The surface is the old hook moved, with the elapsed hover time and the description report added and the rest unchanged: verified (diff against the base hook).
  • A held hover shows once its delay has passed since entry, held keyboard focus shows at once, an early show(), isOpen or isDefaultOpen opens once, and a pointer or focus that left shows nothing: verified (load tests; isDefaultOpen by code in the moved hook).
  • A failed load warns once in development, drops a held show() through onHide, and a later hover, focus or show(), or the next mount, loads again: verified (useTooltip.tsx:293-313, :489-500, :552, :608-614; load tests for hover, show() and the next mount; focus by code).
  • A tap before the load is not held, including a kept :hover and a :hover no listener saw where the device cannot hover, and the next tap is handled as on a loaded tooltip: verified (useTooltip.tsx:418-448; load tests).
  • The layer runtime and HoverCard are unchanged: verified (no file under them changes).
  • Callers that put describedBy into an attribute skip it when empty, and the docs, template, stories and fixture show describedBy || undefined: verified (every caller in the repository enumerated).
  • The records state the three-step description, FR14, the INV3 and INV4 amendments and the base modules, and leave INV6 unchanged: verified in the diff, not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-234; unit test).
  • The test setup loads the tooltip once per file: verified (internal/test-utils/src/setup.ts:41-46).
  • 32 load tests pass: false (33 at this head); the "added for this head" list: stale; the red-first runs: reported.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step, three browser checks wait for the reference, and two SSR tests assert no reference and a description after hydration: verified in the specs, not run.
  • Unit suites, typecheck, lint, formatting, knowledge and boundary checks pass: reported (CI skipped them on this draft).
  • The merge into main is clean, and the three pre-review findings sit in code moved unchanged from main's hook: verified.
  • About 4,133 authored lines: reported (4,169 at this head; size only).
  • VoiceOver and NVDA were not run: accurate; the proposed record names the gap.
  • No public API change beyond the after-paint load: verified (no export, prop or type member changes).
  • Closes the issue about a Button or Avatar with no tooltip running the whole hook: reported; the description says they still run the small trigger contract.
  • Core changeset: verified for the behavior and describedBy guidance; "up to about 24 KB": reported. CLI changeset: verified.

Files:

  • .changeset/tooltip-loads-after-first-paint.md, .changeset/tooltip-hook-template-empty-describedby.md: clear.
  • .github/scripts/lib/a11y-spec-files.mjs: clear.
  • apps/storybook/stories/ChatLayout.stories.tsx, apps/storybook/stories/Tooltip.stories.tsx: clear.
  • docs/architecture/component-import-boundaries.md, docs/specs/components/Tooltip/Tooltip.spec.md: proposed text awaiting an engineering owner's decision.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json, internal/test-utils/src/setup.ts: clear.
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear.
  • packages/core/src/Button/__tests__/Button.a11y.chromium.spec.ts: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, CheckboxInput.ssr.test.tsx: clear.
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear.
  • packages/core/src/Text/cutText.tsx: reads the over-inclusive pre-load count (finding above); Text/TruncationTooltip.tsx, Text/cutTextOnKeyboardFocus.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx: name-repeating wrapper counted before the load; tooltipSurface.tsx, tooltipPresentInterest.ts, Tooltip.ssr.test.tsx, useTooltip.doc.mjs: clear.
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: no name-repeating wrapper case; the failed-load retry test names focus but fires only a pointer entry (non-blocking).
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts, Tooltip.a11y.renders.tsx, TooltipAfterPaint.a11y.browser.spec.ts, TooltipDescription.a11y.browser.spec.ts: clear.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/statusButtonPress.ts: non-blocking naming note; useInputStatusIcon.tsx, useAnnounceRenderedText.adopters.test.tsx: clear.
  • packages/core/src/utils/moduleLoader.ts, moduleLoader.test.ts: clear.
  • scripts/check-component-import-boundaries.mjs, scripts/check-component-import-boundaries.test.mjs: clear.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and one fix is needed as well.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text and the import-boundaries INV3 and INV4 amendments, base-module rule and allowlist costs have no spec approval at this revision; they contradict the current INV3, INV4 and Tooltip FR2 until an engineering owner records the decision by commenting /approve-spec 0016c21fc87ec78a4f1040746e60ea4dbbf462ff, and the author may do so as an engineering owner.

  • The new comment at Tooltip/useTooltip.tsx:285-286 cites component:Tooltip AR1, which @astryx/no-comment-provenance reports as an error in CI because the file has no baseline allowance, so the Lint job fails; drop the parenthetical.

The previous review's blocker is fixed: before the load, a cut Button label no longer yields to a wrapping Tooltip that only repeats its name, with a load test, and the description's test count now matches. No test or browser spec has a result at this revision because CI skipped its jobs on this draft.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later, and no input starts it: verified (useTooltip.tsx:357-371, moduleLoader.ts:20-26; load tests for the schedule and for input before paint).
  • About 29 components carry the tooltip and layer runtime on main: verified (32 folders import a Tooltip module statically on main; without the shared hooks folder, the Layer re-export and Text's lazy truncation tooltip, 29 remain).
  • Importing Button, IconButton, Link or TextInput loads no layer code, and only the trigger contract imports the surface: verified (load test; a repository search finds the dynamic import and a type import, plus test references).
  • A Button with no tooltip and an Avatar with tooltip={false} run only the trigger contract and render no surface: verified (useTooltip.tsx:720-770; load test).
  • Render timings, sample shares, first-load tables, cross-bundler and app figures, the text-only page's 0.1 KB and the measured static-import alternative: reported.
  • A disabled tooltip starts no load, so a field's disabled-reason tooltip adds no tooltip code where it cannot show, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:531-535, :632-635, :740-742; load tests).
  • No description before the load, a hidden copy from the load, then the tooltip's content, with the same id: verified (load tests including a MutationObserver check; the after-paint browser spec).
  • CheckboxInput names its reason only once the tooltip has loaded, in the same commit as the copy: verified (CheckboxInput.tsx:403, :497; SSR test).
  • One shared after-paint wait serves the tooltip load and Text's two loaders, whose timing is unchanged: verified (moduleLoader.ts:20-26, TruncationTooltip.tsx:51, cutTextOnKeyboardFocus.tsx:33; unit tests).
  • Before the load, Button's cut label recognises a wrapping Tooltip from the trigger contract, recounted when isEnabled changes, so it yields to the caller's tooltip: verified (load tests for the cut label and both recounts).
  • A Tooltip whose content repeats the trigger's name marks the trigger, so the cut label does not yield to it, before or after the load: verified (Tooltip.tsx:300-305, :369-377; useTooltip.tsx:277-302; cutText.tsx:89-104; load test for the pre-load check).
  • Typeahead and Tokenizer recognise their info-tip from a registered button, and a press before the load keeps focus on it: verified (statusButtonPress.ts:23-51, useInputStatusIcon.tsx:157; Typeahead load test; Tokenizer by code at Tokenizer.tsx:1551, :1851).
  • The hook keeps its options and return type, holds an early show() or hide() with the latest winning, and a cancelling hide() reports onHide: verified (useTooltip.tsx:62-230, :636-655; load tests).
  • One schedule per trigger window from the first attaching ref callback, none without an attached trigger, and a window that goes away does not stop the load: verified (useTooltip.tsx:357-371, :531-584; load tests).
  • describedBy is empty until the load, and the reference arrives in the same task as the element it names: verified (useTooltip.tsx:765; the surface's description report; MutationObserver test).
  • The schedule copies another pull request's touch runtime, and whichever merges second imports the other's constant: reported (main has no such schedule yet).
  • The surface is the old hook moved, with the elapsed hover time and the description report added and the rest unchanged: verified (diff against the base hook).
  • A held hover shows once its delay has passed since entry, held keyboard focus shows at once, an early show(), isOpen or isDefaultOpen opens once, and a pointer or focus that left shows nothing: verified (load tests; isDefaultOpen by code in the moved hook).
  • A failed load warns once in development, drops a held show() through onHide, and a later hover, focus or show(), or the next mount, loads again: verified (useTooltip.tsx:321-341, :568-580, :636-646; load tests for hover, show() and the next mount; focus by code).
  • A tap before the load is not held, including a kept :hover and a :hover no listener saw where the device cannot hover, and the next tap is handled as on a loaded tooltip: verified (useTooltip.tsx:446-476; load tests).
  • The layer runtime and HoverCard are unchanged: verified (no file under them changes).
  • Callers that put describedBy into an attribute skip it when empty, and the docs, template, stories and fixture show describedBy || undefined: verified (every caller enumerated; none changed since).
  • The records state the three-step description, FR14 with the repeat-name rule, the INV3 and INV4 amendments and the base modules, and leave INV6 unchanged: verified in the diff, not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-234; unit test).
  • The test setup loads the tooltip once per file: verified (internal/test-utils/src/setup.ts:44-46).
  • 34 load tests pass: count verified (34 cases at this head), result reported; the red-first runs: reported.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step, three browser checks wait for the reference, and two SSR tests assert no reference and a description after hydration: verified in the specs, not run.
  • Unit suites, typecheck, formatting, knowledge and boundary checks pass: reported (CI skipped them on this draft).
  • ESLint on changed files reports no errors: false in CI's strict mode at this revision (finding above).
  • The merge into main is clean, and the three pre-review findings sit in code moved unchanged from main's hook: verified.
  • About 4,133 authored lines: reported (4,242 at this head; size only).
  • VoiceOver and NVDA were not run: accurate; the proposed record names the gap.
  • No public API change beyond the after-paint load: verified (no export, prop or type member changes).
  • Closes the issue about a Button or Avatar with no tooltip running the whole hook: reported; the description says they still run the small trigger contract.
  • Core changeset: verified for the behavior and describedBy guidance; "up to about 24 KB": reported. CLI changeset: verified.

Files:

  • .changeset/tooltip-loads-after-first-paint.md, .changeset/tooltip-hook-template-empty-describedby.md: clear.
  • .github/scripts/lib/a11y-spec-files.mjs: clear.
  • apps/storybook/stories/ChatLayout.stories.tsx, apps/storybook/stories/Tooltip.stories.tsx: clear.
  • docs/architecture/component-import-boundaries.md, docs/specs/components/Tooltip/Tooltip.spec.md: proposed text awaiting an engineering owner's decision.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: gives the new citation in useTooltip.tsx no allowance (finding above); internal/test-utils/src/setup.ts: clear.
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear.
  • packages/core/src/Button/__tests__/Button.a11y.chromium.spec.ts: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, CheckboxInput.ssr.test.tsx: clear.
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear.
  • packages/core/src/Text/cutText.tsx, Text/TruncationTooltip.tsx, Text/cutTextOnKeyboardFocus.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx: comment citation that CI's lint rejects (finding above); Tooltip.tsx, tooltipSurface.tsx, tooltipPresentInterest.ts, Tooltip.ssr.test.tsx, useTooltip.doc.mjs: clear.
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: the repeat-name case asserts only the pre-load check, and the failed-load retry test names focus but fires only a pointer entry (non-blocking).
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts, Tooltip.a11y.renders.tsx, TooltipAfterPaint.a11y.browser.spec.ts, TooltipDescription.a11y.browser.spec.ts: clear.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/statusButtonPress.ts: non-blocking naming note; useInputStatusIcon.tsx, useAnnounceRenderedText.adopters.test.tsx: clear.
  • packages/core/src/utils/moduleLoader.ts, moduleLoader.test.ts: clear.
  • scripts/check-component-import-boundaries.mjs, scripts/check-component-import-boundaries.test.mjs: clear.

Automated review (maintainer link)

…e for a cut label inside a Tooltip that repeats it

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision; no other fix is needed.

The proposed component:Tooltip FR2, AR1, PR2 and FR14 text and the import-boundaries INV3 and INV4 amendments, base-module rule and allowlist costs have no spec approval at this revision; they contradict the current INV3, INV4 and Tooltip FR2 until an engineering owner records the decision by commenting /approve-spec b05107d6d85f43b03fcaf317324cbef1e97bba74, and the author may do so as an engineering owner. The previous review's blocker is fixed, and no test or browser spec has a result here because CI skipped its jobs on this draft.

  • Non-blocking: the new cut-repeats fixture in TooltipDescriptionA11y.stories.tsx is read by no browser spec yet; a keyboard-focus case that expects the full-label tooltip and no description would prove the repeat-name rule end to end.
Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims (rechecked where this revision changes them; the rest carried, their code unchanged):

  • Tooltip code loads once per page after first paint, at idle, at most 2 s later, and no input starts it: verified (useTooltip.tsx:357-371, moduleLoader.ts:20-26; load tests for the schedule and for input before paint).
  • About 29 components carry the tooltip and layer runtime on main: verified (32 folders import a Tooltip module statically on main; without the shared hooks folder, the Layer re-export and Text's lazy truncation tooltip, 29 remain).
  • Importing Button, IconButton, Link or TextInput loads no layer code, and only the trigger contract imports the surface: verified (load test; a repository search finds the dynamic import and a type import, plus test references).
  • A Button with no tooltip and an Avatar with tooltip={false} run only the trigger contract and render no surface: verified (useTooltip.tsx:720-770; load test).
  • Render timings, sample shares, first-load tables, cross-bundler and app figures, the text-only page's 0.1 KB and the measured static-import alternative: reported.
  • A disabled tooltip starts no load, so a field's disabled-reason tooltip adds no tooltip code where it cannot show, and enabling it with its trigger attached schedules one: verified (useTooltip.tsx:531-535, :632-635, :740-742; load tests).
  • No description before the load, a hidden copy from the load, then the tooltip's content, with the same id: verified (load tests including a MutationObserver check; the after-paint browser spec).
  • CheckboxInput names its reason only once the tooltip has loaded, in the same commit as the copy: verified (CheckboxInput.tsx:403, :497; SSR test).
  • One shared after-paint wait serves the tooltip load and Text's two loaders, whose timing is unchanged: verified (moduleLoader.ts:20-26, TruncationTooltip.tsx:51, cutTextOnKeyboardFocus.tsx:33; unit tests).
  • Before the load, Button's cut label recognises a wrapping Tooltip from the trigger contract, recounted when isEnabled changes, so it yields to the caller's tooltip: verified (cutText.tsx:89-94; load tests for the cut label and both recounts).
  • A Tooltip whose content repeats the trigger's name marks the trigger, so the cut label does not yield to it, before or after the load: verified (Tooltip.tsx:300-301, :369-370; useTooltip.tsx:277-302; load test for the pre-load check).
  • Typeahead and Tokenizer recognise their info-tip from a registered button, and a press before the load keeps focus on it: verified (statusButtonPress.ts:23-51, useInputStatusIcon.tsx:157; Typeahead load test; Tokenizer by code).
  • The hook keeps its options and return type, holds an early show() or hide() with the latest winning, and a cancelling hide() reports onHide: verified (useTooltip.tsx:62-230, :636-655; load tests).
  • One schedule per trigger window from the first attaching ref callback, none without an attached trigger, and a window that goes away does not stop the load: verified (useTooltip.tsx:357-371, :564-584; load tests).
  • describedBy is empty until the load, and the reference arrives in the same task as the element it names: verified (useTooltip.tsx:765; the surface's description report; MutationObserver test).
  • The schedule copies another pull request's touch runtime, and whichever merges second imports the other's constant: reported (main has no such schedule yet).
  • The surface is the old hook moved, with the elapsed hover time and the description report added and the rest unchanged: verified (diff against the base hook).
  • A held hover shows once its delay has passed since entry, held keyboard focus shows at once, an early show(), isOpen or isDefaultOpen opens once, and a pointer or focus that left shows nothing: verified (load tests; isDefaultOpen by code in the moved hook).
  • A failed load warns once in development, drops a held show() through onHide, and a later hover, focus or show(), or the next mount, loads again: verified (useTooltip.tsx:321-341, :568-580, :636-646; load tests for hover, show() and the next mount; focus by code).
  • A tap before the load is not held, including a kept :hover and a :hover no listener saw where the device cannot hover, and the next tap is handled as on a loaded tooltip: verified (useTooltip.tsx:446-476; load tests).
  • The layer runtime and HoverCard are unchanged: verified (no file under them changes).
  • Callers that put describedBy into an attribute skip it when empty, and the docs, template, stories and fixture show describedBy || undefined: verified (every caller enumerated; none changed since).
  • The records state the three-step description, FR14 with the repeat-name rule, the INV3 and INV4 amendments and the base modules, and leave INV6 unchanged: verified in the diff, not approved at this revision.
  • The checker keeps a listed base module as base code under import(): verified (check-component-import-boundaries.mjs:226-235; unit test).
  • The test setup loads the tooltip once per file: verified (internal/test-utils/src/setup.ts:44-46).
  • 34 load tests pass: count verified (34 cases at this revision), result reported; the red-first runs: reported.
  • The after-paint browser spec runs in Chromium and WebKit with axe at each step, three browser checks wait for the reference, and two SSR tests assert no reference and a description after hydration: verified in the specs, not run.
  • Unit suites, typecheck, formatting, knowledge and boundary checks pass: reported (CI skipped them on this draft).
  • ESLint on changed files reports no errors: reported; the comment citation that failed CI's strict comment-provenance lint at the previous revision is gone, and a scan of every changed source file with that rule's patterns finds nothing beyond the baseline.
  • The merge into main is clean, and the three pre-review findings sit in code moved unchanged from main's hook: verified.
  • About 4,133 authored lines: reported (4,250 at this revision; size only).
  • VoiceOver and NVDA were not run: accurate; the proposed record names the gap.
  • No public API change beyond the after-paint load: verified (no export, prop or type member changes).
  • Closes the issue about a Button or Avatar with no tooltip running the whole hook: reported; the description says they still run the small trigger contract.
  • Core changeset: verified for the behavior and describedBy guidance; "up to about 24 KB": reported. CLI changeset: verified.

Files:

  • .changeset/tooltip-loads-after-first-paint.md, .changeset/tooltip-hook-template-empty-describedby.md: clear.
  • .github/scripts/lib/a11y-spec-files.mjs: clear.
  • apps/storybook/stories/ChatLayout.stories.tsx, apps/storybook/stories/Tooltip.stories.tsx: clear.
  • apps/storybook/stories/TooltipDescriptionA11y.stories.tsx: the new cut-label fixture under a name-repeating Tooltip is read by no spec (non-blocking).
  • docs/architecture/component-import-boundaries.md, docs/specs/components/Tooltip/Tooltip.spec.md: proposed text awaiting an engineering owner's decision.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json, internal/test-utils/src/setup.ts: clear.
  • packages/cli/assets/templates/blocks/components/Tooltip/TooltipHookUsage.tsx: clear.
  • packages/core/src/Button/__tests__/Button.a11y.chromium.spec.ts: clear.
  • packages/core/src/CheckboxInput/CheckboxInput.tsx, CheckboxInput.ssr.test.tsx: clear.
  • packages/core/src/ComplexSelector/ComplexSelector.tsx: clear.
  • packages/core/src/Text/cutText.tsx, Text/TruncationTooltip.tsx, Text/cutTextOnKeyboardFocus.tsx: clear.
  • packages/core/src/Tooltip/useTooltip.tsx, Tooltip.tsx, tooltipSurface.tsx, tooltipPresentInterest.ts, Tooltip.ssr.test.tsx, useTooltip.doc.mjs: clear.
  • packages/core/src/Tooltip/useTooltip.load.test.tsx: the repeat-name case asserts only the pre-load check, and the failed-load retry test names focus but fires only a pointer entry (non-blocking).
  • packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts, Tooltip.a11y.renders.tsx, TooltipAfterPaint.a11y.browser.spec.ts, TooltipDescription.a11y.browser.spec.ts: clear.
  • packages/core/src/gestures/__tests__/touchActionRule.test.ts: clear.
  • packages/core/src/hooks/statusButtonPress.ts: non-blocking naming note; useInputStatusIcon.tsx, useAnnounceRenderedText.adopters.test.tsx: clear.
  • packages/core/src/utils/moduleLoader.ts, moduleLoader.test.ts: clear.
  • scripts/check-component-import-boundaries.mjs, scripts/check-component-import-boundaries.test.mjs: clear.

Automated review (maintainer link)

<div data-case="cut" style={{width: 160}}>
<Button label="A very long button label that overflows its box" />
</div>
<div data-case="cut-repeats" style={{width: 160}}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: no spec reads this cut-repeats fixture yet, though the header says TooltipDescription.a11y.browser.spec.ts reads these fixtures, and the load test it pairs with (useTooltip.load.test.tsx:638) asserts only isTooltipTriggerBeforeLoad(button). A case in that spec that keyboard-focuses this button and expects the full-label tooltip and an empty description would prove the repeat-name rule end to end:

const cut = page.locator('[data-case="cut-repeats"] button');
await cut.focus();
await expect(
  page.getByRole('tooltip', {includeHidden: true}).filter({hasText: 'Another long button label that overflows its box'}),
).toBeVisible();
await expect(cut).toHaveAccessibleDescription('');

This branch was successfully deployed

1 active deployment
Preview — b05107d6 Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. lane:2 Astryx fix-loop lane 2 owns this needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Button: runs the whole tooltip hook when it has no tooltip (Avatar with tooltip={false} too)

1 participant