Repository navigation
refactor(Item, Token, ChatComposer): drop the per-site tooltip surface checks the layer boundary replaces - #9531
Conversation
…ard surface checks the layer boundary replaces Each container asked the surface registry whether a press came from an open Tooltip or HoverCard surface. The layer root now stops such a press before any React handler around the layer (architecture:layer-runtime INV17), so the three reads are removed; their tests stay and pass through the boundary (Tooltip.test.tsx Item row and Token cases, ChatComposer's body click case: each fails with a no-op boundary). The registry stays, read only by the public hasInteractiveAncestor, whose documentation promises that answer, until the next minor: component:Tooltip gains CLN-0027, which removes the registry and that JSDoc sentence at 0.8.0, and a current-state line. No behavior changes, so no changeset.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 07fc762 |
There was a problem hiding this comment.
Removing the three per-site surface checks is behavior-preserving: the layer boundary now covers every case they handled, and the Tooltip, HoverCard, Item, Token and ChatComposer suites pass. Two small fixes are needed before this can merge:
- Add a Changeset naming
@astryxdesign/core(a[chore] Internal: …patch entry); without it the requiredlintcheck fails on Changeset coverage. - In
CLN-0028, say thatINV17stops the press for bubble-phase React handlers only, so callers that askhasInteractiveAncestorfrom a native listener or a capture-phase handler see the 0.8.0 change.
[Automated review]
| | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | id | `CLN-0028` | | ||
| | lifecycle | No deprecation: the next-minor removal of a documented answer that `architecture:layer-runtime` INV17 replaces | | ||
| | delta | The Tooltip and HoverCard surface registry (`Layer/layerSurfacePress.ts`) is removed, and the public `hasInteractiveAncestor` no longer answers true for a press inside an open Tooltip or HoverCard surface; its JSDoc sentence saying so goes with it. INV17 already keeps such a press from every React handler around the layer, so only a caller that asks `hasInteractiveAncestor` from a native listener sees a change | |
There was a problem hiding this comment.
architecture:layer-runtime INV17 lets a capture-phase handler around the layer receive this press ("An ancestor's capture-phase handler runs before the stop and still receives it"), so a caller that asks hasInteractiveAncestor from onClickCapture also sees this change. Suggested: "INV17 already keeps such a press from every bubble-phase React handler around the layer, so a caller that asks hasInteractiveAncestor from a native listener or a capture-phase handler sees a change".
| // The surface check keeps hasInteractiveAncestor's documented answer for | ||
| // callers that ask from a native listener, until the next minor; React | ||
| // handlers never see such a press, because the layer root stops it. |
There was a problem hiding this comment.
Non-blocking: capture-phase React handlers still see this press, and the sentence carries two topics. Suggested:
// hasInteractiveAncestor documents this answer until the next minor.
// A layer root stops such a press before any bubble-phase React handler.
// A native listener or a capture-phase handler still sees it.
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ChatComposerDrawer | 17.5 kB (0) · 4.7 kB CSS (0) | — | ✗ · ✓ · — |
| ChatComposerInput | 53.5 kB (0) · 10.4 kB CSS (0) | — | ✗ · ✓ · — |
| ChatComposerTokenElement | 53.5 kB (0) · 10.4 kB CSS (0) | — | ✗ · ✓ · — |
130 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ChatDictationButton | 43.2 kB (0) · 9.8 kB CSS (0) | — | ✗ · ✓ · — |
| ChatLayout | 45.7 kB (0) · 10.3 kB CSS (0) | — | ✗ · ✓ · — |
| ChatLayoutScrollButton | 43.1 kB (0) · 9.9 kB CSS (0) | — | ✗ · ✓ · — |
| ChatMessage | 16.7 kB (0) · 3.7 kB CSS (0) | — | ✗ · ✓ · ✓ |
| ChatMessageBubble | 7.1 kB (0) · 3.7 kB CSS (0) | — | ✗ · ✓ · ✓ |
| ChatMessageList | 22.7 kB (0) · 7.9 kB CSS (0) | — | ✗ · ✓ · — |
| ChatMessageMetadata | 19.6 kB (0) · 4.1 kB CSS (0) | — | ✗ · ✓ · — |
| ChatSendButton | 42.4 kB (0) · 9.5 kB CSS (0) | — | ✗ · ✓ · — |
| ChatSystemMessage | 6.8 kB (0) · 3.8 kB CSS (0) | — | ✗ · ✓ · — |
| ChatTokenizedText | 7.1 kB (0) · 4.0 kB CSS (0) | — | ✗ · ✓ · — |
| ChatToolCalls | 25.8 kB (0) · 9.3 kB CSS (0) | — | ✗ · ✓ · — |
| LayerProvider | 60.8 kB (0) · 10.5 kB CSS (0) | — | ✓ · ✓ · ✗ |
| ChatComposer | 58.9 kB (−33 B) · 11.2 kB CSS (0) | — | ✗ · ✓ · — |
| Chat | — | — | ✗ · ✓ · — |
| AlertDialog | 53.8 kB (0) · 12.7 kB CSS (0) | — | — · — · — |
| AppShell | 65.8 kB (0) · 12.1 kB CSS (0) | — | — · — · — |
| Avatar | 32.4 kB (0) · 6.5 kB CSS (0) | — | — · — · — |
| AvatarGroup | 35.2 kB (0) · 6.6 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 36.3 kB (0) · 6.5 kB CSS (0) | — | — · — · — |
| Banner | 44.6 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 52.8 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| Button | 39.6 kB (0) · 9.5 kB CSS (0) | — | — · — · — |
| Calendar | 52.2 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| Carousel | 47.3 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| CheckboxInput | 46.9 kB (0) · 9.7 kB CSS (0) | — | — · — · — |
| CheckboxList | 41.5 kB (0) · 8.6 kB CSS (0) | — | — · — · — |
| ClickableCard | 14.5 kB (0) · 7.1 kB CSS (0) | — | — · — · — |
| CodeBlock | 57.0 kB (0) · 11.1 kB CSS (0) | — | — · — · — |
| CommandPalette | 48.2 kB (0) · 12.2 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 26.6 kB (0) · 8.5 kB CSS (0) | — | — · — · — |
| ComplexSelector | 53.5 kB (0) · 11.1 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 50.4 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| DateInput | 98.7 kB (0) · 15.3 kB CSS (0) | — | — · — · — |
| DateRangeInput | 67.6 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| DateTimeInput | 111.0 kB (0) · 15.8 kB CSS (0) | — | — · — · — |
| DialogHeader | 45.6 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| DrawerHeader | 45.7 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| Field | 39.6 kB (0) · 8.3 kB CSS (0) | — | — · — · — |
| FieldLabel | 33.3 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| FileInput | 51.8 kB (0) · 10.7 kB CSS (0) | — | — · — · — |
| Heading | 7.9 kB (0) · 6.0 kB CSS (0) | — | — · — · — |
| HoverCard | 18.5 kB (0) · 5.0 kB CSS (0) | — | — · — · — |
| IconButton | 39.6 kB (0) · 9.5 kB CSS (0) | — | — · — · — |
| InputGroup | 40.2 kB (0) · 8.4 kB CSS (0) | — | — · — · — |
| Lightbox | 48.3 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| Link | 40.2 kB (0) · 7.9 kB CSS (0) | — | — · — · — |
| MobileNav | 48.0 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 43.0 kB (0) · 9.7 kB CSS (0) | — | — · — · — |
| MultiSelector | 70.9 kB (0) · 15.2 kB CSS (0) | — | — · — · — |
| NumberInput | 53.1 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| Overlay | 19.8 kB (0) · 4.0 kB CSS (0) | — | — · — · — |
| Popover | 46.5 kB (0) · 12.4 kB CSS (0) | — | — · — · — |
| ProgressBar | 7.9 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| RadioList | 41.1 kB (0) · 8.3 kB CSS (0) | — | — · — · — |
| SegmentedControl | 34.2 kB (0) · 6.5 kB CSS (0) | — | — · — · — |
| SelectableCard | 14.5 kB (0) · 7.3 kB CSS (0) | — | — · — · — |
| SideNav | 63.4 kB (0) · 10.9 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 43.4 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| SideNavHeading | 55.9 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| SideNavItem | 51.8 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| Slider | 44.4 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| Spinner | 18.5 kB (0) · 6.7 kB CSS (0) | — | — · — · — |
| StatusDot | 20.4 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| Stepper | 44.2 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| Switch | 45.2 kB (0) · 9.7 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 49.4 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| TabMenu | 52.4 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| Text | 7.4 kB (0) · 6.0 kB CSS (0) | — | — · — · — |
| TextArea | 45.2 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| TextInput | 50.8 kB (0) · 10.9 kB CSS (0) | — | — · — · — |
| Thumbnail | 47.5 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| TimeInput | 86.5 kB (0) · 14.3 kB CSS (0) | — | — · — · — |
| Timer | 9.5 kB (0) · 7.0 kB CSS (0) | — | — · — · — |
| Timestamp | 21.3 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| Toast | 56.7 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| ToggleButton | 40.5 kB (0) · 9.6 kB CSS (0) | — | — · — · — |
| Tooltip | 18.2 kB (0) · 5.0 kB CSS (0) | — | — · — · — |
| TopNav | 49.5 kB (0) · 10.7 kB CSS (0) | — | — · — · — |
| TopNavHeading | 55.3 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 51.4 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| TopNavMenu | 55.2 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| TreeList | 37.8 kB (0) · 5.0 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 62.8 kB (0) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 63.3 kB (0) · 1.1 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 44.5 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 68.2 kB (0) · 722 B CSS (0) | — | — · — · — |
| lab/InfoTip | 23.4 kB (0) · 458 B CSS (0) | — | — · — · — |
| lab/ListInput | 80.0 kB (0) · 1.6 kB CSS (0) | — | — · — · — |
| lab/TourStep | 51.8 kB (0) · 590 B CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 274.3 kB (0) · 2.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 254.9 kB (0) · 2.3 kB CSS (0) | — | — · — · — |
| charts/ChartTooltip | 50.3 kB (−5 B) · 20 B CSS (0) | — | — · — · — |
| charts/Chart | 60.9 kB (−8 B) · 20 B CSS (0) | — | — · — · — |
| SelectorOption | 16.5 kB (−8 B) · 5.4 kB CSS (0) | — | — · — · — |
| lab/Schedule | 57.8 kB (−10 B) · 3.9 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 50.4 kB (−12 B) · 20 B CSS (0) | — | — · — · — |
| BreadcrumbItem | 64.9 kB (−17 B) · 11.4 kB CSS (0) | — | — · — · — |
| Item · Storybook | 13.2 kB (−18 B) · 4.9 kB CSS (0) | 1,599 (−7) | ✓ · ✓ · — |
| DropdownMenuCheckboxItem | 18.1 kB (−20 B) · 5.9 kB CSS (0) | — | — · — · — |
| DropdownMenuItem | 17.4 kB (−21 B) · 5.5 kB CSS (0) | — | — · — · — |
| Markdown | 143.6 kB (−24 B) · 18.3 kB CSS (0) | — | — · — · — |
| Selector | 75.0 kB (−26 B) · 15.6 kB CSS (0) | — | — · — · — |
| DropdownMenuRadioItem | 18.2 kB (−27 B) · 5.9 kB CSS (0) | — | — · — · — |
| TableCell | 74.2 kB (−29 B) · 15.8 kB CSS (0) | — | — · — · — |
| ContextMenu | 73.0 kB (−31 B) · 15.3 kB CSS (0) | — | — · — · — |
| Tokenizer | 67.7 kB (−32 B) · 17.1 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 78.6 kB (−32 B) · 1.9 kB CSS (0) | — | — · — · — |
| Pagination | 84.0 kB (−33 B) · 15.9 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 100.1 kB (−33 B) · 1.9 kB CSS (0) | — | — · — · — |
| PowerSearch | 180.0 kB (−36 B) · 20.5 kB CSS (0) | — | — · — · — |
| Table | 82.9 kB (−37 B) · 16.0 kB CSS (0) | — | — · — · — |
| DropdownMenu | 70.7 kB (−38 B) · 15.4 kB CSS (0) | — | — · — · — |
| ListItem | 50.9 kB (−38 B) · 11.0 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 67.8 kB (−38 B) · 2.1 kB CSS (0) | — | — · — · — |
| RadioListItem | 49.4 kB (−40 B) · 10.1 kB CSS (0) | — | — · — · — |
| lab/MobileTokenizer | 99.0 kB (−40 B) · 880 B CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 55.8 kB (−41 B) · 9.9 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 73.8 kB (−41 B) · 15.5 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 219.5 kB (−41 B) · 454 B CSS (0) | — | — · — · — |
| CheckboxListItem | 51.5 kB (−44 B) · 11.0 kB CSS (0) | — | — · — · — |
| Token · Storybook | 25.0 kB (−44 B) · 4.8 kB CSS (0) | 543 (−5) | ✓ · ✓ · — |
| MoreMenu | 71.0 kB (−45 B) · 15.4 kB CSS (0) | — | — · — · — |
| Typeahead | 60.5 kB (−45 B) · 11.8 kB CSS (0) | — | — · — · — |
| lab/TransferList | 72.3 kB (−46 B) · 1.7 kB CSS (0) | — | — · — · — |
| lab/MobilePowerSearch | 164.4 kB (−48 B) · 1.2 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 224.5 kB (−58 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 229.8 kB (−60 B) · 2.5 kB CSS (0) | — | — · — · — |
| chat | — | — | — · ✓ · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Visual changes: 4 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| Chat · Default (neutral, dark) | ![]() |
![]() |
![]() |
| Chat · Default (neutral, light) | ![]() |
![]() |
![]() |
| Chat · Clipping (neutral, dark) | ![]() |
![]() |
![]() |
| Chat · Clipping (neutral, light) | ![]() |
![]() |
![]() |
Package size: @astryxdesign/core 5.81 MB packed (−767 B); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: core 5 rows; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
…uired chore changeset INV17 still lets a capture-phase handler around a layer receive the press, so a caller asking hasInteractiveAncestor from onClickCapture also sees CLN-0028's change; the record and the useClickableContainer comment say so. The lint gate requires a changeset for a core change: a [chore] one with no behavior change.
|
/approve-spec 0654a6f |
There was a problem hiding this comment.
This looks ready to merge. The layer boundary covers every press the three removed checks handled, and both earlier requests are fixed at this head: the Changeset, and CLN-0028's capture-phase wording. One point to weigh, which does not block: the hasInteractiveAncestor surface answer arrived after 0.7.5, so no stable release has it yet. Under AST-017 FR2 it could still go before 0.7.6, instead of shipping and then being removed as a 0.8.0 breaking change.
[Automated review]












User impact
None visible. A click on an open tooltip or hover card inside an Item row, a Token or a ChatComposer body still doesn't activate the row or token or focus the input. Since #9497, the layer root provides that, not three hand-written checks.
Spec
Layer A part 2 of
architecture:layer-runtimeINV17 (#9497). Specs ruled to keep the publichasInteractiveAncestorpromise until the minor. Records needing/approve-spec:component:TooltipgainsCLN-0028: at 0.8.0, the surface registry (Layer/layerSurfacePress.ts) andhasInteractiveAncestor's JSDoc sentence ("A press inside an open Tooltip or HoverCard surface also answers true") are removed.hasInteractiveAncestorstill answers true for those presses, and Core's own containers rely on INV17 instead.Changes
innermostInteractive(target, currentTarget, isLayerSurface)check is removed, along with its imports and comments.useClickableContainer'sbelongsToSomethingElsekeeps the registry check, because it backs the publichasInteractiveAncestor. Its comment andlayerSurfacePress.ts's header say why.[chore]patch with no behavior change (the lint gate requires one for a core change).Writing rubric results
Tooltip.spec.md:CLN-0028and the new current-state bullet.Evidence
useClickableContainersuites (1,048 tests).check:knowledgeandcheck:changesetsare clean.