Repository navigation
spec: record component icon slots in CodeBlock, Timestamp, and Table - #10045
Conversation
…and Table
CodeBlock FR15 (code-block-copy, {copied}), Timestamp FR10 (timestamp-copy,
{copied}) with FR8 naming the copied glyph, Table FR5 (table-sort-indicator,
{direction}) and FR7 (table-row-expand, {expanded}). A theme value of null
hides only the glyph; a request size changes only the glyph. The icon-slot
architecture record says each Core slot is recorded in its owning
component's contract.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Outcome: this waits on an engineering-owner decision, and the Table record needs two fixes.
The four component icon slots (CodeBlock FR15, Timestamp FR10, Table FR5 and FR7) are new spec direction, so approval needs an engineering owner to approve or reject them as written, in particular null hiding only the glyph on all four slots and FR7 turning whatever glyph the slot resolves. An engineering owner records that decision by commenting /approve-spec 21e9fa60f94177a6cbe6ee0b06466f2e1ecd8b94 on this pull request; the author is an engineering owner and can do this too.
Required changes:
docs/specs/components/Table/Table.spec.md:278still makes the Sort indicator glyph a required invariant of a sortable column, and AV3 (:261) gives no theme reason for it to be absent, so both contradict FR5'snullrule; amend them, and the glyph rows at:349and:357, to allow anulltheme entry.- The description says every record's compatibility notes call the slot additive and every readiness note says it awaits implementation, but the Table record's Compatibility and migration section and Compatibility/readiness row are unchanged; add the matching notes for
table-sort-indicatorandtable-row-expand, or narrow the description.
The test-ui (3/4) failure is in CheckboxList.test.tsx, which this pull request does not touch.
[Automated review]
| | FR2 | Data-driven mode renders a Body section and a Header section with Column header cells when columns are present. Without windowing, each data item renders a standard Row and Cells; FR18 limits row/cell construction to the admitted mounted plan. Empty data renders the configured empty-state row when enabled, subject to FR22's default initial-loading suppression. It never creates a Footer section. Each Column header cell shows its column's `header`, and the column `key` only when `header` is omitted, `null`, or `undefined`; any other `header` renders as React renders it, so `header: ''`, the blank header of an actions column, renders an empty Column header cell, not the key (`architecture:react-component-runtime` INV16). | Current source, docs, and tests | Legacy rendering verified; FR18/FR22 exceptions require implementation evidence | | ||
| | FR3 | Children mode passes caller composition through to the Table. TableHeader, TableBody, and TableFooter provide the respective sections, and TableRow, TableHeaderCell, and TableCell provide standard rows and cells. | Current source, docs, and tests | Verified current composition; no new API or DOM rule | | ||
| | FR4 | `Table.doc.mjs` is the canonical aggregate consumer owner for the eight current targets: `table`, `table-scroll-wrapper`, `table-header`, `table-body`, `table-footer`, `table-row`, `table-cell`, and `table-header-cell`. Member docs retain direct lookup metadata through `subComponentOf: 'Table'`. | Current docs and CLI target tests | Verified parent ownership; focused placement coverage is partial | | ||
| | FR5 | For a sortable column, useTableSortable renders a Sort control around the column label, an Icon-owned Sort indicator glyph, and a numeric Sort priority only while multi-sort has more than one active entry. The Sort indicator glyph resolves through the `table-sort-indicator` component icon slot, passing `{direction}`: `ascending`, `descending`, or `none` while the column is unsorted. With no theme entry it is `arrowUp`, `arrowDown`, or `arrowsUpDown`. A theme value of `null` hides only the glyph: the Sort control, its label, its sorting, and the header's `aria-sort` remain, the hidden glyph takes no space beside the label, and a sorted column then shows no visible sort cue. A request `size` changes only the glyph, never the Sort control or the header row. | Current source, docs, and tests; `architecture:icon-resolution-and-component-slots/INV2,INV4–INV8` for the icon slot | Control and priority are tested; glyph presence is source-inspected only; the icon slot awaits implementation | |
There was a problem hiding this comment.
With null this glyph is removed, but the Representative states row for a sortable column (line 278) still lists the Sort indicator glyph as a required invariant, and AV3 (line 261) gives no theme reason for it to be absent. Please amend both, for example: "Column header cell contains the Sort control and, unless the theme maps table-sort-indicator to null (FR5), the Sort indicator glyph."
…e sort and expansion glyphs AV3, the sortable-column and expandable-row representative states, and the two glyph anatomy rows now say the glyph is absent when the theme maps its slot to null. The compatibility section and readiness row state that the two slots are additive and await implementation.
|
Addressed in 4411549:
|
…ponent-icon-slots
There was a problem hiding this comment.
Outcome: this waits on an engineering-owner decision on the four slots, and the Table record needs one more fix.
The four component icon slots (CodeBlock FR15, Timestamp FR10, Table FR5 and FR7) are new spec direction, so approval needs an engineering owner to approve or reject them as written, in particular null hiding only the glyph on all four slots and FR7 turning whatever glyph the slot resolves. An engineering owner records that decision by commenting /approve-spec c2760ae3a486ab38fc28179dd568e4f5cb01ccf2 on this pull request; the author is an engineering owner and can do this too.
Required change:
docs/specs/components/Table/Table.spec.md:283and:285, AV3 (:266-268) and the glyph rows (:354,:362) allow a missing glyph only when a theme maps the slot to a staticnull, but AST-087 FR13 also hides the icon for a slot function'snullresult oricon: null, so word each exception as "unless the slot resolves to no icon" and apply FR5's no-space rule to any hidden glyph.
The two earlier Table findings are resolved.
[Automated review]
| | Width-less explicit columns | Every omitted-width column remains equally flexible above a 60px floor; combined floors trigger the existing Scroll region only when they no longer fit. | Row values, header nodes, sorting/filtering, virtualization, loading or empty rows, direction, and responsive container width. | | ||
| | Empty data | Default EmptyState is present unless replaced/disabled or FR22 suppresses it during admitted initial loading; ordinary empty output resumes on completion. | Caller replacement content or no empty state. | | ||
| | Children mode | Caller-supplied sections are passed directly to Table. | Header, Body, and Footer section presence and content. | | ||
| | Sortable column | Column header cell contains the Sort control and, unless the theme maps `table-sort-indicator` to `null` (FR5), the Sort indicator glyph. | Direction and conditional multi-sort priority. | |
There was a problem hiding this comment.
This exception covers only a theme that maps the slot to a static null. AST-087 FR13 also hides the icon for a slot function's null result or icon: null, so a theme that hides only the unsorted arrow (({direction}) => direction === 'none' ? null : undefined) breaks this invariant. Suggested wording: "Column header cell contains the Sort control and, unless the table-sort-indicator slot resolves to no icon (FR5), the Sort indicator glyph." The same applies to line 285, AV3 and the glyph rows at 354 and 362.
FR15, FR10, FR5, and FR7 cover a theme value of null, a slot function that returns null, and a request with icon: null alike. Table's AV3, representative states, and glyph anatomy rows name the same condition, and FR5's no-space rule applies to any hidden sort glyph.
|
Addressed in bb9237b: the four clauses (CodeBlock FR15, Timestamp FR10, Table FR5 and FR7) now say "when the slot resolves to no icon (a theme value of |
There was a problem hiding this comment.
Outcome: this waits on an engineering-owner decision on the four slots, and the architecture record needs one fix.
The four component icon slots (CodeBlock FR15, Timestamp FR10, Table FR5 and FR7) are new spec direction, so an engineering owner must approve or reject them as written: in particular, that a slot resolving to no icon hides only the glyph on all four slots, and that FR7 turns whatever glyph the slot resolves. An engineering owner records that decision by commenting /approve-spec bb9237b5454c7549fb29400f51ff22f04edce3f8 on this pull request; the author is an engineering owner and can do this too.
Required change:
- Miss:
docs/architecture/icon-resolution-and-component-slots.md:82now says "Each Core slot is recorded in its owning component's contract", but thechat-send-button-sendslot thatspec:AST-032FR2 already specifies is not named in the ChatSendButton contract, so reword the sentence to cover it (or record the slot in that contract) and drop "first" from the title.
The Table finding from the last review is resolved.
[Automated review]
|
|
||
| The target model adds one rule for future component roles: new semantic component | ||
| slots use `componentIcons`. No Core slot has shipped. Selector's selected-option | ||
| slots use `componentIcons`. Each Core slot is recorded in its owning component's |
There was a problem hiding this comment.
Miss: spec:AST-032 FR2 already specifies a Core slot, chat-send-button-send, with its arrowUp fallback and a null mapping (FR4). The ChatSendButton contract does not name it: its FR3 lists the slot stage only as an implementation gap. So this sentence is not true at merge. One wording that is: "Each Core slot is recorded in its owning component's contract or in the system spec that adds it (spec:AST-032 FR2 for chat-send-button-send)."
spec:AST-032 FR2 already specifies chat-send-button-send outside a component contract, so the architecture record's baseline sentence names both places a Core slot is recorded.
|
Addressed in 1161351: the architecture record now says "Each Core slot is recorded in its owning component's contract or in the system spec that adds it ( |
There was a problem hiding this comment.
Outcome: this waits on an engineering-owner decision on the four component icon slots; no other change is required.
The four slots (CodeBlock FR15, Timestamp FR10, Table FR5 and FR7) are new spec direction, so an engineering owner must approve or reject them as written, in particular that a slot resolving to no icon hides only the glyph on all four slots (which leaves CodeBlock with no visible copy confirmation and a sorted column with no visible direction), and that FR7 turns whatever glyph the slot resolves. An engineering owner records that decision by commenting /approve-spec 11613512071d79121e17c33ab63ef360c4f56895 on this pull request; the author is an engineering owner and can do this too.
The architecture record's baseline sentence now covers the slot spec:AST-032 specifies, so the last review's required change is resolved.
[Automated review]
|
/approve-spec 1161351 |
Exact decision needed
This PR records four component icon slots in their owning component contracts, and the one behavior they all share.
Choice: when a slot resolves to no icon, only the glyph is hidden. "No icon" means a theme value of
null, a slot function that returnsnull, or a request withicon: null. The control stays, with its size, accessible name, tooltip, state, and action. Hiding the glyph is allowed for all four slots. Per slot, that means:nullcode-block-copytimestamp-copytable-sort-indicatoraria-sort, the column label, and click and keyboard sorting remain, and the hidden glyph takes no space.aria-sorttable-row-expandaria-expanded, and toggling remain.The alternative is to forbid
nullfor a slot whose glyph is a control's only visible content (the two copy buttons, the row toggle) or its only visible state (the sort indicator). The architecture record allowsnullfor any slot and leaves this to each component contract, which is why the choice is recorded here.Recorded per slot:
component:CodeBlockFR15code-block-copy{copied: boolean}, true while the copied feedback showscopy;checkwhile copiedcomponent:TimestampFR10timestamp-copy{copied: boolean}, true while the copied state showscopy;checkwhile copiedcomponent:TableFR5table-sort-indicator{direction: 'ascending' | 'descending' | 'none'}, withnonefor an unsorted columnarrowUp/arrowDown/arrowsUpDowncomponent:TableFR7table-row-expand{expanded: boolean}chevronRight. The control turns whatever glyph the slot resolves a quarter turn while expanded, and mirrors it in right-to-left layouts.For every slot, a request
sizechanges only the glyph, never the control or the row around it.Existing authority searched
architecture:icon-resolution-and-component-slots(current): defines the slot model, precedence, partial requests, malformed-request handling, and INV2 and INV4–INV8. It requires each slot to be recorded in its owning component's contract, with the slot name, fallback, state fields, and whethernullmay hide it. That makes the component contracts the canonical owners. This PR also replaces the record's "No Core slot has shipped" with a sentence that stays true as slots are added, and that also coverschat-send-button-send, whichspec:AST-032FR2 already specifies.spec:AST-087FR11–FR20: the system-level slot behavior. It names no component slot.component:CodeBlock(with docs(CodeBlock): the record states startLineNumber's file coordinates #9934's FR14 forstartLineNumber, so the copy slot is FR15),component:Timestamp(with feat(Timestamp, PowerSearch): write dates in the provider's calendar #9639's calendar text), andcomponent:Table(with spec(Table): define row-specific expansion control names #9859's expansion control names). None of these records a component icon slot today.code-block-copy), feat(cli): built themes keep componentIcons slot functions #9829 (built themes keep slot functions), feat(Timestamp): the hover card's copy button resolves its glyph through the timestamp-copy icon slot #9830 (timestamp-copy), feat(Table): the sort indicator resolves its glyph through the table-sort-indicator icon slot #9831 (table-sort-indicator), and feat(Table): the row-expansion toggle resolves its glyph through the table-row-expand icon slot #9834 (table-row-expand). Those PRs contain no record edits; they are specified by this PR.Decision
code-block-copywith{copied}. With no theme entry it iscopy, thencheckwhile copied.nullhides only the glyph. A requestsizechanges only the glyph.timestamp-copywith{copied}, with the same fallback,null, and size rules. FR8 now says the button switches to "the copied glyph (checkunless a theme mapstimestamp-copy, FR10)".table-sort-indicatorwith{direction}, and falls back by direction.nullhides only the glyph, which takes no space. A larger glyph never grows the Sort control or the header row.table-row-expandwith{expanded}, falling back tochevronRight. The turn and the right-to-left mirror stay component-owned, as INV8 requires.nullhides only the glyph.Rejected alternatives
Claim scope and non-goals
null, and size behavior.architecture:theme-authoring-contract,architecture:theme-compilation, andspec:AST-087.Evidence and implementation relationship
Implementation follows in #9828, #9829, #9830, #9831, and #9834, which merge after this PR. Their tests are the verification this PR names:
ComponentIconSlotMap, the render sites, and the consumer docs in agreement;New test files are named in each verification map but not added to
verified_byuntil they exist onmain.Writing rubric results
Records touched:
docs/architecture/icon-resolution-and-component-slots.md,docs/specs/components/CodeBlock/CodeBlock.spec.md,docs/specs/components/Timestamp/Timestamp.spec.md,docs/specs/components/Table/Table.spec.md.spec:AST-032FR2 forchat-send-button-send)." The new FR rows and compatibility lines state system behavior in the present tense. Readiness uses each record's existing "current and awaits implementation" status form.architecture:icon-resolution-and-component-slots/INV2,INV4–INV8), and verification cells name test suites and failure signals, not PRs.Scope
Validation
pnpm check:knowledge: "Knowledge templates and records are aligned."git diff --check: clean.