Repository navigation
perf(Text): take a new text's first truncation measurement from the shared observer - #10668
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Requesting changes for one test; the change itself looks correct.
Moving the first measurement to the shared observer's first notification keeps Text's and Heading's truncation contract. The new test fails before the change and passes after it. Chromium and Firefox both send a first notification to a newly observed element and none for a repeated observe(), which is the split isResizeObserved relies on.
Required
useTruncation.test.tsx's "skips the first measurement when measuring turns off in the same task" can no longer fail: its observer stub never calls back and nothing else watches the span, so deleting theunobserveRef.current === unobserveguard inuseTruncation.tsleaves every test in that file passing — register another subscriber on the span before the hook's ref runs (as "measures an element another subscriber already observes" does) so the microtask path runs and the guard decides.
Optional
- The new comment block in
useTruncation.tshas a 27-word sentence with three topics, andsharedResizeObserver.ts's header@outputdoes not mentionisResizeObserved; short active sentences and an updated header would match the repository's conventions.
[Automated review]
f700397 to
9c78fe1
Compare
b6090d0 to
907dee3
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Taking a new element's first truncation measurement from the shared resize observer's first notification keeps Text's and Heading's truncation contract. The one gap from the last review is closed: the same-task turn-off test now registers another subscriber first, so it fails without the microtask guard, and each first-measurement test now fails when its branch is broken. In Chromium and Firefox a newly mounted element is read only inside the observer's delivery.
Optional
useTruncationcallers now seeisTruncatedturn true one animation frame after mount instead of in the first frame; Text and Heading paint nothing from it, but the Changeset could mention it for direct hook users.- The comment block in
useTruncation.tsopens with a sentence that restates the code, and thesharedResizeObserver.tsheader now runs to 17 lines; see the inline notes.
[Automated review]
| // text whose element another subscriber already observes is measured | ||
| // too. The truncated state only decides whether to compose the | ||
| // tooltip, so nothing paints differently. | ||
| // Observe via the shared singleton, if available. The call that |
There was a problem hiding this comment.
Non-blocking: "Observe via the shared singleton, if available." restates the typeof ResizeObserver branch and the observeResize call below it. Dropping it lets the comment start with its reason:
// The call that observeResize makes on registration runs inside React's
// commit, so it measures nothing. The observer's first notification
// measures a new element. ...| * @input ResizeObserver API | ||
| * @output Exports observeResize / unobserveResize for shared observation | ||
| * @output Exports observeResize / unobserveResize for shared observation, and | ||
| * the internal isResizeObserved |
There was a problem hiding this comment.
Non-blocking: this header is now 17 lines, past the "about 12 lines" the source-comment convention sets for @input, @output, @position and SYNC:. Most of the excess is the older four-line rationale paragraph; moving it onto the callbacks declaration brings the header to about 13 lines.
56046e1 to
6ea613c
Compare
…hared observer A newly observed truncating element is first measured on the shared ResizeObserver's first notification, which the browser sends after its own layout, instead of in a microtask after the commit that forced a layout pass. An element another subscriber already observes gets no new first notification, so it keeps the microtask measurement. The tooltip behaves as before. This diff was generated with AI assistance (Navi). Tags: ai-generated
907dee3 to
8a30faf
Compare
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Markdown | 186.7 kB (+61 B) · 20.6 kB CSS (0) | — | — · — · — |
| MultiSelector | 94.7 kB (+48 B) · 16.8 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 60.8 kB (+46 B) · 10.0 kB CSS (0) | — | — · — · — |
119 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| RadioListItem | 67.3 kB (+42 B) · 10.1 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 61.1 kB (+42 B) · 10.0 kB CSS (0) | — | — · — · — |
| Calendar | 71.2 kB (+41 B) · 10.6 kB CSS (0) | — | — · — · — |
| ChatSendButton | 60.7 kB (+40 B) · 10.0 kB CSS (0) | — | — · — · — |
| ToggleButton | 86.7 kB (+40 B) · 10.1 kB CSS (0) | — | — · — · — |
| Tokenizer | 91.4 kB (+39 B) · 18.8 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 69.7 kB (+39 B) · 11.8 kB CSS (0) | — | — · — · — |
| DateRangeInput | 92.4 kB (+38 B) · 12.5 kB CSS (0) | — | — · — · — |
| DateTimeInput | 206.5 kB (+38 B) · 18.7 kB CSS (0) | — | — · — · — |
| Lightbox | 120.9 kB (+38 B) · 10.6 kB CSS (0) | — | — · — · — |
| ListItem | 69.9 kB (+38 B) · 11.4 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 60.6 kB (+38 B) · 10.0 kB CSS (0) | — | — · — · — |
| Switch | 102.2 kB (+38 B) · 9.9 kB CSS (0) | — | — · — · — |
| Thumbnail | 64.6 kB (+38 B) · 11.6 kB CSS (0) | — | — · — · — |
| DrawerHeader | 63.2 kB (+37 B) · 12.9 kB CSS (0) | — | — · — · — |
| DropdownMenu | 96.9 kB (+37 B) · 17.6 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 70.9 kB (+36 B) · 11.4 kB CSS (0) | — | — · — · — |
| IconButton | 60.3 kB (+36 B) · 10.0 kB CSS (0) | — | — · — · — |
| MoreMenu | 97.2 kB (+36 B) · 17.6 kB CSS (0) | — | — · — · — |
| PowerSearch | 284.7 kB (+36 B) · 24.1 kB CSS (0) | — | — · — · — |
| Banner | 62.2 kB (+35 B) · 10.5 kB CSS (0) | — | — · — · — |
| Button | 60.3 kB (+35 B) · 10.0 kB CSS (0) | — | — · — · — |
| CheckboxList | 67.6 kB (+34 B) · 7.7 kB CSS (0) | — | — · — · — |
| RadioList | 56.3 kB (+34 B) · 7.3 kB CSS (0) | — | — · — · — |
| TextInput | 67.7 kB (+34 B) · 11.2 kB CSS (0) | — | — · — · — |
| Field | 54.9 kB (+33 B) · 7.2 kB CSS (0) | — | — · — · — |
| Heading | 12.3 kB (+33 B) · 5.4 kB CSS (0) | — | — · — · — |
| InputGroup | 56.5 kB (+32 B) · 7.8 kB CSS (0) | — | — · — · — |
| TopNav | 72.2 kB (+32 B) · 10.9 kB CSS (0) | — | — · — · — |
| AppShell | 90.9 kB (+31 B) · 13.5 kB CSS (0) | — | — · — · — |
| TopNavHeading | 75.2 kB (+31 B) · 11.2 kB CSS (0) | — | — · — · — |
| SideNavHeading | 75.5 kB (+30 B) · 11.3 kB CSS (0) | — | — · — · — |
| ChatMessageList | 27.9 kB (+29 B) · 7.0 kB CSS (0) | — | — · — · — |
| SideNav | 112.6 kB (+29 B) · 11.4 kB CSS (0) | — | — · — · — |
| DialogHeader | 63.1 kB (+28 B) · 11.5 kB CSS (0) | — | — · — · — |
| Popover | 89.5 kB (+28 B) · 14.2 kB CSS (0) | — | — · — · — |
| Spinner | 24.6 kB (+28 B) · 6.2 kB CSS (0) | — | — · — · — |
| Timestamp | 32.7 kB (+28 B) · 10.3 kB CSS (0) | — | — · — · — |
| DateInput | 184.9 kB (+27 B) · 17.0 kB CSS (0) | — | — · — · — |
| NumberInput | 71.7 kB (+27 B) · 11.4 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 70.4 kB (+27 B) · 13.2 kB CSS (0) | — | — · — · — |
| Toast | 98.1 kB (+27 B) · 10.3 kB CSS (0) | — | — · — · — |
| Carousel | 69.8 kB (+26 B) · 10.9 kB CSS (0) | — | — · — · — |
| ContextMenu | 107.6 kB (+26 B) · 17.4 kB CSS (0) | — | — · — · — |
| MobileNav | 70.5 kB (+26 B) · 10.6 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 84.5 kB (+25 B) · 12.1 kB CSS (0) | — | — · — · — |
| ChatLayout | 81.4 kB (+24 B) · 10.5 kB CSS (0) | — | — · — · — |
| CheckboxInput | 64.2 kB (+24 B) · 9.2 kB CSS (0) | — | — · — · — |
| CodeBlock | 75.0 kB (+24 B) · 11.3 kB CSS (0) | — | — · — · — |
| CommandPalette | 73.1 kB (+24 B) · 12.7 kB CSS (0) | — | — · — · — |
| TableCell | 108.9 kB (+24 B) · 17.9 kB CSS (0) | — | — · — · — |
| Text · Storybook | 11.7 kB (+23 B) · 5.4 kB CSS (0) | 717 (+3) | ✓ · ✓ · — |
| Typeahead | 79.6 kB (+23 B) · 12.4 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 31.8 kB (+22 B) · 8.3 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 70.1 kB (+21 B) · 9.7 kB CSS (0) | — | — · — · — |
| Timer | 13.8 kB (+21 B) · 6.0 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 71.1 kB (+20 B) · 10.9 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 75.6 kB (+20 B) · 11.3 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 75.6 kB (+20 B) · 11.3 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 60.8 kB (+20 B) · 10.2 kB CSS (0) | — | — · — · — |
| SideNavItem | 70.4 kB (+20 B) · 11.1 kB CSS (0) | — | — · — · — |
| TextArea | 62.4 kB (+19 B) · 9.3 kB CSS (0) | — | — · — · — |
| TimeInput | 160.3 kB (+19 B) · 16.0 kB CSS (0) | — | — · — · — |
| Link | 53.1 kB (+18 B) · 7.0 kB CSS (0) | — | — · — · — |
| TabMenu | 71.7 kB (+18 B) · 11.1 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 31.5 kB (+17 B) · 7.5 kB CSS (0) | — | — · — · — |
| FileInput | 69.1 kB (+17 B) · 10.9 kB CSS (0) | — | — · — · — |
| ComplexSelector | 71.0 kB (+16 B) · 11.8 kB CSS (0) | — | — · — · — |
| Stepper | 61.9 kB (+16 B) · 10.1 kB CSS (0) | — | — · — · — |
| ChatComposer | 77.9 kB (+15 B) · 12.0 kB CSS (0) | — | — · — · — |
| AlertDialog | 105.4 kB (+14 B) · 14.6 kB CSS (0) | — | — · — · — |
| Slider | 107.7 kB (+13 B) · 8.8 kB CSS (0) | — | — · — · — |
| Table | 123.9 kB (+13 B) · 18.3 kB CSS (0) | — | — · — · — |
| TopNavMenu | 74.5 kB (+9 B) · 11.2 kB CSS (0) | — | — · — · — |
| Pagination | 109.5 kB (+8 B) · 17.8 kB CSS (0) | — | — · — · — |
| Selector | 99.4 kB (+7 B) · 17.4 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 108.5 kB (+2 B) · 17.7 kB CSS (0) | — | — · — · — |
| BottomSheet | 66.4 kB (+1 B) · 7.7 kB CSS (0) | — | — · — · — |
| Avatar | 43.1 kB (0) · 5.5 kB CSS (0) | — | — · — · — |
| AvatarGroup | 45.9 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 48.9 kB (0) · 5.6 kB CSS (0) | — | — · — · — |
| FieldLabel | 51.0 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| HoverCard | 27.6 kB (0) · 4.4 kB CSS (0) | — | — · — · — |
| InfoTip | 46.6 kB (0) · 5.3 kB CSS (0) | — | — · — · — |
| LayoutContent | 17.7 kB (0) · 1.7 kB CSS (0) | — | — · — · — |
| LayoutPanel | 21.3 kB (0) · 4.9 kB CSS (0) | — | — · — · — |
| ProgressBar | 11.7 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| ScrollableArea | 10.8 kB (0) · 4.3 kB CSS (0) | — | — · — · — |
| SegmentedControl | 94.5 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| StackItem | 16.3 kB (0) · 219 B CSS (0) | — | — · — · — |
| StatusDot | 31.2 kB (0) · 5.3 kB CSS (0) | — | — · — · — |
| TabList | 43.8 kB (0) · 6.5 kB CSS (0) | — | — · — · — |
| Toolbar | 43.7 kB (0) · 8.1 kB CSS (0) | — | — · — · — |
| Tooltip | 29.5 kB (0) · 4.4 kB CSS (0) | — | — · — · — |
| OverflowList | 10.5 kB (−1 B) · 3.6 kB CSS (0) | — | — · — · — |
| charts/Chart | 201.9 kB (new) · 494 B CSS (new) | — | — · — · — |
| charts/ChartLegend | 49.1 kB (new) · 224 B CSS (new) | — | — · — · — |
| charts/ChartTooltip | 179.3 kB (new) · 423 B CSS (new) | — | — · — · — |
| lab/ChatEmojiPicker | 104.2 kB (new) · 773 B CSS (new) | — | — · — · — |
| lab/ChatReactionBar | 105.3 kB (new) · 1.1 kB CSS (new) | — | — · — · — |
| lab/CommentComposer | 149.2 kB (new) · 1.9 kB CSS (new) | — | — · — · — |
| lab/CommentPin | 57.1 kB (new) · 1.2 kB CSS (new) | — | — · — · — |
| lab/Comments | 347.5 kB (new) · 2.5 kB CSS (new) | — | — · — · — |
| lab/CommentThread | 340.8 kB (new) · 2.4 kB CSS (new) | — | — · — · — |
| lab/DialogHeroHeader | 83.0 kB (new) · 372 B CSS (new) | — | — · — · — |
| lab/DiffViewer | 86.8 kB (new) · 2.1 kB CSS (new) | — | — · — · — |
| lab/EmojiPicker | 86.3 kB (new) · 751 B CSS (new) | — | — · — · — |
| lab/LineClamp | 13.8 kB (new) · 168 B CSS (new) | — | — · — · — |
| lab/ListInput | 101.8 kB (new) · 1.6 kB CSS (new) | — | — · — · — |
| lab/NavigationScreen | 80.6 kB (new) · 1.5 kB CSS (new) | — | — · — · — |
| lab/NavigationStack | 80.6 kB (new) · 1.5 kB CSS (new) | — | — · — · — |
| lab/Schedule | 105.8 kB (new) · 3.9 kB CSS (new) | — | — · — · — |
| lab/SelectableCardGroup | 64.4 kB (new) · 162 B CSS (new) | — | — · — · — |
| lab/TourStep | 95.8 kB (new) · 590 B CSS (new) | — | — · — · — |
| lab/TransferList | 107.9 kB (new) · 1.7 kB CSS (new) | — | — · — · — |
| lab/TransferListSelector | 114.4 kB (new) · 1.9 kB CSS (new) | — | — · — · — |
| richtext/RichTextEditor | 297.0 kB (new) · 2.6 kB CSS (new) | — | — · — · — |
| richtext/RichTextEditorToolbar | 277.3 kB (new) · 454 B CSS (new) | — | — · — · — |
| richtext/RichTextView | 276.0 kB (new) · 2.3 kB CSS (new) | — | — · — · — |
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: cli +22 · ~7 · −0 (against the merge base's committed report); theme-butter +1 · ~0 · −0 (against the merge base's committed report); theme-y2k +1 · ~0 · −0 (against the merge base's committed report)
Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
31 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./api · Functions · function exportSearchIndex |
function exportSearchIndex @experimental: (options?: { cwd?: string | undefined; package?: string | undefined }) => Promise<SearchIndex> |
import {exportSearchIndex} from '@astryxdesign/cli/api'; exportSearchIndex(…) |
| + | cli |
./api · Functions · function rankSearchIndex |
function rankSearchIndex @experimental: (query: string, indexes: SearchIndex | SearchIndex[], options?: { type?: SearchDomain | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {rankSearchIndex} from '@astryxdesign/cli/api'; rankSearchIndex(…) |
| + | cli |
./api · Types · type DocsListChild |
type DocsListChild = DocsNodeChild & { topic: string; description: string; children?: DocsListChild[]; childCount?: number } |
import type {DocsListChild} from '@astryxdesign/cli/api' |
| + | cli |
./api · Types · type DocsListNamespace |
childCount?: number | undefined |
import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {childCount: …} |
| + | cli |
./api · Types · type DocsListNamespace |
children?: DocsListChild[] | undefined |
import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {children: …} |
| + | cli |
./api · Types · type SearchIndex |
type SearchIndex |
import type {SearchIndex} from '@astryxdesign/cli/api' |
| + | cli |
./api · Types · type SearchResultEntry |
deprecated?: ComponentDeprecation | undefined |
import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …} |
| + | cli |
./authoring · Types · interface ComponentDeprecation |
interface ComponentDeprecation |
import type {ComponentDeprecation} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface ComponentIconSlotDoc |
interface ComponentIconSlotDoc |
import type {ComponentIconSlotDoc} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface ComponentIconSlotStateDoc |
interface ComponentIconSlotStateDoc |
import type {ComponentIconSlotStateDoc} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface MultiComponentDoc |
deprecated?: ComponentDeprecation |
import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …} |
| + | cli |
./authoring · Types · interface SingleComponentDoc |
deprecated?: ComponentDeprecation |
import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface ComponentBaseDoc |
deprecated?: ComponentDeprecation |
import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface SubComponentDoc |
deprecated?: ComponentDeprecation |
import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …} |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/doc' |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentIconSlotDoc |
ComponentIconSlotDoc (./authoring) |
import {ComponentIconSlotDoc} from '@astryxdesign/cli/doc' |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentIconSlotStateDoc |
ComponentIconSlotStateDoc (./authoring) |
import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/doc' |
| + | cli |
./json · Also exported from an earlier entry point · DocsListChild |
DocsListChild (./api) |
import {DocsListChild} from '@astryxdesign/cli/json' |
| + | cli |
./json · Also exported from an earlier entry point · SearchIndex |
SearchIndex (./api) |
import {SearchIndex} from '@astryxdesign/cli/json' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/template' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentIconSlotDoc |
ComponentIconSlotDoc (./authoring) |
import {ComponentIconSlotDoc} from '@astryxdesign/cli/template' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentIconSlotStateDoc |
ComponentIconSlotStateDoc (./authoring) |
import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/template' |
| ~ | cli |
./api · Functions · function search |
function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {search} from '@astryxdesign/cli/api'; search(…) |
| ~ | cli |
./api · Types · type SwizzleCopyResponse |
data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; feedback?: SwizzleFeedback | undefined } → data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; dependencies: Record<string, string>; marker … #84d9505b |
import type {SwizzleCopyResponse} from '@astryxdesign/cli/api'; const x: SwizzleCopyResponse = {data: …} |
| ~ | cli |
./authoring · Types · interface MultiComponentDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {theming: …} |
| ~ | cli |
./authoring · Types · interface SingleComponentDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {theming: …} |
| ~ | cli |
./authoring · Types · type TemplateCategory |
type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #e7c18378 → type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #a8be998f |
import type {TemplateCategory} from '@astryxdesign/cli/authoring' |
| ~ | cli |
./doc · Types · interface ComponentBaseDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {theming: …} |
| ~ | cli |
./doc · Types · interface SubComponentDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {theming: …} |
| + | theme-butter |
Public attributes · attr data-astryx-pressable |
attr data-astryx-pressable (public data attribute) |
[data-astryx-pressable] { … } |
| + | theme-y2k |
Public attributes · attr data-astryx-pressable |
attr data-astryx-pressable (public data attribute) |
[data-astryx-pressable] { … } |
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
There was a problem hiding this comment.
Approved.
Taking a new element's first truncation measurement from the shared resize observer's first notification keeps Text's and Heading's truncation contract. Each first-measurement branch (a new element, an element another subscriber already watches, and measuring turned off in the same task) has a test that fails when that branch is broken, and in Chromium a newly mounted truncating text is now read only inside the observer's delivery, with no forced layout after the commit. CI passes on this head.
Optional
- The two comment suggestions from the earlier review still apply: the narrating first sentence at
useTruncation.ts:126, and the 17-line header insharedResizeObserver.ts.
[Automated review]
Stack
Row virtualization is split into eight stacked PRs, each under the 2,000-line limit. Each PR's base is the one above it, so review and merge from the top of this list down.
Two record amendments the stack relies on: #10665 (Table adopts the shared list-windowing module first) and #10666 (a windowed row-number column fits its last position).
Maintainer impact
A windowed table mounts a few rows on each scroll step, and each default text cell in truncate mode is a
<Text maxLines={1}>. Text took each new element's first truncation measurement in a microtask after the commit, which forced a synchronous layout pass inside the scroll's task. In the row-virtualization release spec that measurement was about half of the scroll-to-commit time (1.5 of 1.9 ms p95 for three text columns), and it put the supported-plugin budget at its limit. Any page that mounts many truncating texts pays the same forced layout.Intended invariant
Mounting truncating text forces no layout. A newly observed element is first measured when the shared resize observer delivers its first notification, which the browser sends after its own layout; an element another subscriber already observes, which gets no new first notification, is still measured after the commit (
component:TextPR1: measured only when needed, through the shared observer).Change
Text/useTruncation.ts: the microtask measurement runs only for an element the shared observer already watches. Every other element is first measured on the observer's first notification.utils/sharedResizeObserver.ts: an internalisResizeObserved(element); it is not exported from the package..changeset/text-truncation-first-measure.md([perf]).Evidence
Scope
Testing
--max-warnings=0) on every changed file, andpnpm typecheckinpackages/corepass on this exact head.vitest run --project ui packages/coreat the top of this stack: 20,720 tests pass. Four locale time-format tests (DateTimeInput,TimeInput,timeFormat) fail on the local machine's ICU data and pass in CI; they do not touch Text.node scripts/pre-review.mjs --base <the branch below>: 84 authored lines.main, that is, after the PRs below it merge.This PR was generated with AI assistance (Navi).