Repository navigation
feat(Table): the row-expansion toggle resolves its glyph through the table-row-expand icon slot - #9834
Conversation
…g with CodeBlock's copy button
defineTheme({componentIcons}) maps a component icon slot to a shared icon
name, null, a partial {icon, variant, size} request, or a pure function of
the slot's state. One shared resolution applies caller content, then the
theme's slot, then the component's fallback, field by field, and ignores a
malformed field with one development warning. CodeBlock's copy button is the
first slot, code-block-copy, with state {copied}. The static view reads back
through theme.componentIcons; theme build carries static slot values and
fails on a slot function. Component docs, the CLI, and the docsite registry
list a component's slots.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
… values DefinedTheme['componentIcons'] keeps the same shape as a Partial<Record>, so documentation that names DefinedTheme does not have to enumerate every icon name a slot may hold.
4d44b82 to
d2ad6f6
Compare
There was a problem hiding this comment.
Approval waits on one engineering-owner decision. Otherwise the code and tests look ready.
This change amends component:Table FR7 in docs/specs/components/Table/Table.spec.md. That record is current, and the amendment is the only authority for the new slot. An engineering owner needs to approve or amend that FR7 text by commenting /approve-spec <full head SHA> on this pull request; the author is an engineering owner and may record it. The decision settles:
- the
table-row-expandslot and its{expanded}state, withchevronRightas the fallback; - the quarter turn and right-to-left mirror applied to whatever the slot resolves, including per-state artwork from a slot function (an expanded
chevronDownwould point toward the inline start); nullhiding only the glyph, which leaves an empty but focusable toggle in each expandable row.
No blocking defects were found: the default toggle renders as before, and the new slot suite fails when the slot is ignored or the turn is dropped.
[Automated review]
…template's componentIcons example builds The icon slot architecture record's baseline points to ComponentIconSlotMap and each owning component's docs for Core's slots. The theme template's componentIcons example is a static value, which astryx theme build carries.
…table-row-expand icon slot
The toggle passes {expanded} to the theme's componentIcons['table-row-expand']
and keeps chevronRight as its fallback. The toggle still turns the glyph a
quarter turn while expanded and mirrors it in right-to-left layouts. null
hides only the glyph; the toggle keeps its name, aria-expanded, and its
toggling.
d2ad6f6 to
2036ec4
Compare
There was a problem hiding this comment.
Approval waits on one engineering-owner decision. Otherwise the code and tests look ready.
This change amends component:Table FR7 in docs/specs/components/Table/Table.spec.md. That record is current, and the amendment is the only authority for the new slot. An engineering owner needs to approve or amend that FR7 text by commenting /approve-spec <full head SHA> on this pull request; the author is an engineering owner and may record it. The decision settles:
- the
table-row-expandslot and its{expanded}state, withchevronRightas the fallback; - the quarter turn and right-to-left mirror applied to whatever the slot resolves, including per-state artwork from a slot function (an expanded
chevronDownwould point toward the inline start); nullhiding only the glyph, which leaves an empty but focusable toggle in each expandable row.
No blocking defects were found: the default toggle renders as before, and the new slot suite fails when the slot is ignored or the turn is dropped.
[Automated review]
…states only its reason
humbertovirtudes
left a comment
There was a problem hiding this comment.
Table-scoped review of exact head 2036ec430b53b70ffd346437aed108a7368ab4e0.
No blocking code defect was found in the authored expansion-icon change. The pending FR7 decision must explicitly cover the table-row-expand slot, expanded state, chevronRight fallback, component-owned turn/RTL mirror on mapped artwork, and null leaving a named empty toggle. Preserve the #9828/#9829 prerequisite order and verify the integrated head. Current stack-base CI does not execute the runtime/browser suite; a successful administrative gate is not that evidence. I am leaving approval pending, not rejecting the implementation.
…de-block # Conflicts: # docs/specs/components/CodeBlock/CodeBlock.spec.md # packages/cli/test/__golden__/no-icon-set/search-icon-set.json # packages/cli/test/__golden__/no-icon-set/search-icon-set.txt
Table.spec.md takes main's text; the row-expand slot is recorded in component:Table FR7 by the separate spec pull request.
The merge commit's lint hook reformatted this unrelated file; it now matches main again.
There was a problem hiding this comment.
Approval waits on an engineering-owner decision about the Table record, and one layout fix is needed.
The table-row-expand slot needs component:Table FR7 to state it: the current record says only that the toggle draws an Icon-owned glyph, and the new wording is in the open spec pull request #10045. An engineering owner records approval by commenting /approve-spec <full head SHA> on #10045 (the author may do so as an engineering owner), and this pull request follows once that text is on main. The decision settles the slot and its {expanded} state with the chevronRight fallback; the quarter turn and right-to-left mirror on any resolved glyph, so per-state artwork is turned too; null leaving a named, empty toggle; and a request size changing only the glyph.
Required change:
- Miss: a theme
sizeornullfortable-row-expandmakes every expandable row taller (42.5 px with no entry, 44.5, 46.5 and 48.5 px atsm,mdandlg, and 48.5 px withnull) because theinline-flextoggle takes its baseline from the glyph, which breaks AST-087 FR14's "A slot size changes only the icon's size"; addingverticalAlign: 'middle'tochevronButtonkeeps every row at 42.5 px, and a browser test should pin the row height.
[Automated review]
| <Icon | ||
| icon="chevronRight" | ||
| size="xsm" | ||
| <ComponentIcon |
There was a problem hiding this comment.
A theme size or null for this slot changes the row height. The button is inline-flex, so its baseline comes from this glyph. In Chromium each expandable row is 42.5 px with no entry, 44.5, 46.5 and 48.5 px at sm, md and lg, and 48.5 px with null, against AST-087 FR14 ("A slot size changes only the icon's size"). Adding verticalAlign: 'middle' to expansionStyles.chevronButton keeps every case at 42.5 px; a browser test should pin it.
…spring turns it The glyph box is the toggle's first child, which the glide gives its spring, so the quarter turn and its right-to-left mirror move onto the box. Under animatedLayout the glyph again turns on the row glide's motion. The unit tests check that the toggle's first child holds the glyph and carries the turn.
|
Fixed in 2fa0c7f: the quarter turn, its transition, and the right-to-left mirror moved from the Icon to the glyph box. The box is the toggle's first child, the element that |
There was a problem hiding this comment.
Approval waits on an engineering-owner decision about the Table record; the code itself has no blocking issue at this head.
The table-row-expand slot needs component:Table FR7 as the open spec pull request #10045 words it. An engineering owner records that approval by commenting /approve-spec <full head SHA> on #10045 (the author may do so as an engineering owner), and this pull request follows once that text is on main. The decision covers the slot and its {expanded} state, the chevronRight fallback, the quarter turn and right-to-left mirror on any resolved glyph (so per-state artwork is turned too), null leaving a named, focusable toggle with no glyph, and a request size changing only the glyph.
The glide fix works: under animatedLayout the glyph box now takes the glide's 735 ms spring, as the glyph did before this change, and rows keep their height for every slot size and for null.
- Optional:
ComponentIcon's newxstyleprop no longer has a caller after the last commit; consider dropping it and the description line that mentions it.
[Automated review]
| fallback: ComponentIconFallback; | ||
| color?: IconColor; | ||
| /** The component's own styles for the glyph, such as a state transform. */ | ||
| xstyle?: StyleXStyles; |
There was a problem hiding this comment.
Non-blocking: after the last commit the turn styles sit on the Table toggle's glyph box, so no caller passes xstyle any more (useTableRowExpansion.tsx and CodeBlock.tsx both omit it). Consider dropping this prop, its JSDoc and the pass-through on line 73 until a slot needs it.
The expansion turn now sits on the toggle's glyph box, so no slot passes styles to the glyph.
|
Took the optional cleanup in 29fa564: dropped |
There was a problem hiding this comment.
Approval waits on an engineering-owner decision about the Table record; the code has no blocking issue at this head, and the xstyle cleanup is in.
The table-row-expand slot needs component:Table FR7 as the open spec pull request #10045 words it: the slot and its {expanded} state, the chevronRight fallback, the quarter turn and right-to-left mirror on any resolved glyph (so per-state artwork is turned too), null leaving a named, focusable toggle with no glyph, and a request size changing only the glyph. An engineering owner records that approval by commenting /approve-spec <full head SHA> on #10045 (the author may do so as an engineering owner), and this pull request follows once that text is on main and #9828 has merged.
[Automated review]
…de-block # Conflicts: # packages/cli/test/__golden__/no-icon-set/search-icon-set.json # packages/cli/test/__golden__/no-icon-set/search-icon-set.txt
There was a problem hiding this comment.
Approval still waits on an engineering-owner decision about the Table record; the code has no blocking issue at this head.
The table-row-expand slot needs component:Table FR7 as the open spec pull request #10045 words it: the slot and its {expanded} state, the chevronRight fallback, the quarter turn and right-to-left mirror on any resolved glyph (so per-state artwork is turned too), null leaving a named, focusable toggle with no glyph, and a request size changing only the glyph. An engineering owner records that approval by commenting /approve-spec <full head SHA> on #10045 (the author may do so as an engineering owner), and this pull request follows once that text is on main and #9828 has merged.
[Automated review]
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head, because its checks run only for pull requests into main. They run when this change reaches main together with #9828, which it merges after.
The table-row-expand slot now matches component:Table FR7 on main. With no theme entry, the toggle looks and moves exactly as before in both directions. A theme's glyph size or null keeps every row's height and leaves a named, focusable toggle.
[Automated review]
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableBody | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
| TableFooter | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
| TableHeader | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
82 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableRow | 6.7 kB (0) · 3.9 kB CSS (0) | — | ✓ · ✓ · ✗ |
| AppShell | 80.3 kB (0) · 12.3 kB CSS (0) | — | — · — · — |
| Banner | 52.5 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 60.9 kB (0) · 9.7 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 75.2 kB (0) · 11.4 kB CSS (0) | — | — · — · — |
| Calendar | 61.4 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| Carousel | 57.4 kB (0) · 9.5 kB CSS (0) | — | — · — · — |
| ChatComposer | 67.1 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 51.1 kB (0) · 8.8 kB CSS (0) | — | — · — · — |
| ChatLayout | 53.8 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 51.1 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| ChatMessageMetadata | 19.9 kB (0) · 4.1 kB CSS (0) | — | — · — · — |
| ChatSendButton | 51.0 kB (0) · 8.7 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 26.1 kB (0) · 8.3 kB CSS (0) | — | — · — · — |
| Citation | 20.2 kB (0) · 4.4 kB CSS (0) | — | — · — · — |
| CodeBlock | 65.0 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| Collapsible | 25.0 kB (0) · 4.5 kB CSS (0) | — | — · — · — |
| CommandPalette | 58.7 kB (0) · 12.4 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 27.0 kB (0) · 7.5 kB CSS (0) | — | — · — · — |
| ComplexSelector | 61.4 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| ContextMenu | 88.0 kB (0) · 16.4 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 26.4 kB (0) · 6.1 kB CSS (0) | — | — · — · — |
| DateInput | 165.8 kB (0) · 15.6 kB CSS (0) | — | — · — · — |
| DateRangeInput | 80.4 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| DateTimeInput | 188.3 kB (0) · 17.3 kB CSS (0) | — | — · — · — |
| DrawerHeader | 53.6 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| DropdownMenu | 85.0 kB (0) · 16.5 kB CSS (0) | — | — · — · — |
| DropdownMenuCheckboxItem | 21.1 kB (0) · 6.4 kB CSS (0) | — | — · — · — |
| DropdownMenuItem | 20.3 kB (0) · 6.0 kB CSS (0) | — | — · — · — |
| DropdownMenuRadioItem | 21.1 kB (0) · 6.4 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 63.6 kB (0) · 9.4 kB CSS (0) | — | — · — · — |
| FileInput | 59.2 kB (0) · 9.7 kB CSS (0) | — | — · — · — |
| Icon · Storybook | 7.8 kB (0) · 681 B CSS (0) | 926 (+1) | ✓ · ✓ · — |
| Lightbox | 58.7 kB (0) · 9.2 kB CSS (0) | — | — · — · — |
| Link | 48.1 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| Markdown | 159.1 kB (0) · 19.3 kB CSS (0) | — | — · — · — |
| MobileNav | 60.4 kB (0) · 9.4 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 50.9 kB (0) · 8.7 kB CSS (0) | — | — · — · — |
| MoreMenu | 85.2 kB (0) · 16.5 kB CSS (0) | — | — · — · — |
| MultiSelector | 84.9 kB (0) · 15.7 kB CSS (0) | — | — · — · — |
| NumberInput | 61.7 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| Pagination | 98.0 kB (0) · 16.7 kB CSS (0) | — | — · — · — |
| PowerSearch | 262.5 kB (0) · 22.7 kB CSS (0) | — | — · — · — |
| Selector | 88.0 kB (0) · 16.3 kB CSS (0) | — | — · — · — |
| SelectorOption | 19.3 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| SideNav | 80.3 kB (0) · 10.2 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 51.4 kB (0) · 8.8 kB CSS (0) | — | — · — · — |
| SideNavHeading | 65.4 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| SideNavItem | 60.5 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| Step | 29.6 kB (0) · 5.6 kB CSS (0) | — | — · — · — |
| Stepper | 52.2 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| Table | 97.3 kB (0) · 17.0 kB CSS (0) | — | ✓ · ✓ · — |
| TableCell | 89.2 kB (0) · 16.8 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableHeaderCell | 88.8 kB (0) · 16.5 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableSelectionToolbar | 60.1 kB (0) · 11.9 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TabList | 40.1 kB (0) · 6.4 kB CSS (0) | — | — · — · — |
| TabMenu | 62.0 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| TextArea | 53.3 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| Thumbnail | 54.8 kB (0) · 10.3 kB CSS (0) | — | — · — · — |
| TimeInput | 142.6 kB (0) · 14.6 kB CSS (0) | — | — · — · — |
| Toast | 64.5 kB (0) · 9.1 kB CSS (0) | — | — · — · — |
| Token | 27.2 kB (0) · 4.7 kB CSS (0) | — | — · — · — |
| Tokenizer | 79.2 kB (0) · 17.2 kB CSS (0) | — | — · — · — |
| TopNav | 62.1 kB (0) · 9.7 kB CSS (0) | — | — · — · — |
| TopNavHeading | 64.8 kB (0) · 9.9 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 59.9 kB (0) · 10.6 kB CSS (0) | — | — · — · — |
| TopNavMenu | 64.8 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| TreeList | 41.2 kB (0) · 5.4 kB CSS (0) | — | — · — · — |
| Typeahead | 68.8 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 114.2 kB (0) · 1.9 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 52.2 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/Comments | 279.2 kB (0) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 273.4 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 76.9 kB (0) · 2.1 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 76.3 kB (0) · 722 B CSS (0) | — | — · — · — |
| lab/ListInput | 90.0 kB (0) · 1.6 kB CSS (0) | — | — · — · — |
| lab/Schedule | 69.0 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| lab/TransferList | 84.7 kB (0) · 1.7 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 91.8 kB (0) · 1.9 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 287.5 kB (0) · 2.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 238.6 kB (0) · 454 B CSS (0) | — | — · — · — |
| richtext/RichTextView | 267.8 kB (0) · 2.3 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 6.61 MB packed (+862 B); no new dependencies.
API changes: core +1 · ~0 · −0
Committed API report behind this build: cli 19 rows, core 23 rows; run pnpm api:report.
1 API change (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | core |
. · Types · interface ComponentIconSlotMap |
table-row-expand: { readonly expanded: boolean } |
import type {ComponentIconSlotMap} from '@astryxdesign/core'; const x: ComponentIconSlotMap = {table-row-expand: …} |
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. The table-row-expand slot matches component:Table FR7 on main: with no theme entry the row-expansion toggle looks and moves exactly as before in both directions, and a theme's glyph size or null keeps every row's height and leaves a named, focusable toggle. CI passes on this head.
[Automated review]
Specified by #10045 (the record PR for the first component icon slots); this PR merges after it.
Stack: on #9828 (component icon slots and CodeBlock's
code-block-copy). Review and merge after it.User need
Expandable Table rows show a chevron toggle. A theme whose disclosure language uses a different glyph (a plus, a caret, or a filled triangle) can only remap
chevronRight, which also changes every breadcrumb, pagination arrow, and menu submenu. A theme needs to change the row-expansion glyph alone, and to know whether the row is open.Problem and solution fit
table-row-expandslot, with state{expanded: boolean}, is declared inComponentIconSlotMap.useTableRowExpansion's toggle resolves its glyph through the slot with the sharedComponentIconrenderer.chevronRight, as before.Table.doc.mjsgains thetheming.componentIconsentry. It says the glyph is turned while expanded and mirrored in RTL, so a theme maps a glyph that points toward the inline end.Scope: the row-expansion plugin toggle only. Tree rows, grouped rows, and the context menu's "Expand row" item icon are unchanged.
Name check:
table-row-expandis<component-kebab>-<semantic-role>, andexpandedis the toggle's existingaria-expandedstate.Current specification
architecture:icon-resolution-and-component-slots: slot model; INV8 keeps transforms with the component; INV2, INV4–INV8; change coupling.spec:AST-087: FR11–FR17.component:TableFR7, recorded by spec: record component icon slots in CodeBlock, Timestamp, and Table #10045. This PR changes no record.Public delta and caller burden
table-row-expand(type{readonly expanded: boolean}) inComponentIconSlotMap.defineTheme({componentIcons: {'table-row-expand': 'menu'}})drawsmenu, still turned while expanded. A theme that wants different artwork per state uses a function ofexpanded.nullhides the glyph. The toggle keeps its size, its "Expand row" or "Collapse row" name,aria-expanded, and its click and keyboard toggling. A requestsizechanges only the glyph.Design and alternatives
chevronDown, because the turn already shows the open state.Evidence
useTableRowExpansion.test.tsxhas a new row expansion icon slot suite. It covers:expandedreaching a slot function in both states, and updating after a click;nullhiding only the glyph whilearia-expanded, the name, and toggling remain;The glide suite still passes, so the glyph keeps its own turn under
animatedLayout.componentIconSlots.test.tschecks that the slot is declared, rendered by the Table plugin, and listed inTable.doc.mjs.Scope
Testing
pnpm vitest run --project ui packages/core/src/Table packages/core/src/Icon packages/core/src/CodeBlock packages/core/src/theme/themingTargets.test.ts(44 files, 1,413 tests)pnpm vitest run --project node packages/cli/test/experimental-isolation.test.mjs packages/cli/test/core-doc-quality.test.mjspnpm check:knowledge;pnpm review:pre --base icons/ast087-slots-code-block; core typecheck.