Skip to content

spec: record component icon slots in CodeBlock, Timestamp, and Table - #10045

Merged
imdreamrunner merged 5 commits into
mainfrom
spec/ast087-first-component-icon-slots
Nov 5, 2026
Merged

imdreamrunner merged 5 commits into
mainfrom
spec/ast087-first-component-icon-slots

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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 returns null, or a request with icon: 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:

Slot With null Allowed Forbidden
code-block-copy The icon-only copy button shows no glyph at rest or while copied. Its name ("Copy code" / "Copied"), tooltip, and polite announcement remain. Hiding the glyph Removing the button, its name, or its copy action
timestamp-copy Each copyable hover-card row's button shows no glyph. Its "Copy {value}" name, tooltip, and copy action remain. Hiding the glyph Removing the button, its name, or its copy action
table-sort-indicator A sorted column shows no visible sort cue. aria-sort, the column label, and click and keyboard sorting remain, and the hidden glyph takes no space. Hiding the glyph Removing the Sort control, its sorting, or aria-sort
table-row-expand The expansion toggle shows no glyph. Its "Expand row" / "Collapse row" name, aria-expanded, and toggling remain. Hiding the glyph Removing the toggle, its name, or its toggling

The alternative is to forbid null for 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 allows null for any slot and leaves this to each component contract, which is why the choice is recorded here.

Recorded per slot:

Record Slot State a slot function receives Fallback with no theme entry
component:CodeBlock FR15 code-block-copy {copied: boolean}, true while the copied feedback shows copy; check while copied
component:Timestamp FR10 timestamp-copy {copied: boolean}, true while the copied state shows copy; check while copied
component:Table FR5 table-sort-indicator {direction: 'ascending' | 'descending' | 'none'}, with none for an unsorted column arrowUp / arrowDown / arrowsUpDown
component:Table FR7 table-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 size changes only the glyph, never the control or the row around it.

Existing authority searched

Decision

  • CodeBlock FR15: the copy control's glyph resolves through code-block-copy with {copied}. With no theme entry it is copy, then check while copied. null hides only the glyph. A request size changes only the glyph.
  • Timestamp FR10: the hover-card copy button's glyph resolves through timestamp-copy with {copied}, with the same fallback, null, and size rules. FR8 now says the button switches to "the copied glyph (check unless a theme maps timestamp-copy, FR10)".
  • Table FR5: the Sort indicator glyph resolves through table-sort-indicator with {direction}, and falls back by direction. null hides only the glyph, which takes no space. A larger glyph never grows the Sort control or the header row.
  • Table FR7: the Expansion glyph resolves through table-row-expand with {expanded}, falling back to chevronRight. The turn and the right-to-left mirror stay component-owned, as INV8 requires. null hides only the glyph.
  • Each record's compatibility notes call the slot additive: with no theme entry, output is unchanged. Each readiness note says the slot is current and awaits implementation.

Rejected alternatives

  • One shared copy slot for CodeBlock and Timestamp. Rejected because a slot names one component's role (the architecture record's naming rule); a theme that wants them alike maps both.
  • Three slots for the sort indicator, one per direction. Rejected because one slot with a direction state keeps the indicator in one theme entry, and a static value still applies to every direction.
  • Dropping the expansion turn when a theme maps the slot. Rejected because a static mapped name would then lose the open-state cue; INV8 keeps transforms with the component.

Claim scope and non-goals

  • Covered: the four slots above, their state, fallbacks, null, and size behavior.
  • Not covered: namespaced extension keys (NumberInput, RichText, Comments); status-icon maps (Banner, FieldStatus, Selector, MultiSelector, Table row status); Stepper; selected-item checks (indicators, INV12); Collapsible; tree and grouped-row chevrons; context-menu item icons; raw-SVG icons; static dismiss, chevron, and navigation icons.
  • Theme authoring, normalization, and theme-build parity stay with architecture:theme-authoring-contract, architecture:theme-compilation, and spec: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:

  • each component's slot suite;
  • a slot inventory test that keeps ComponentIconSlotMap, the render sites, and the consumer docs in agreement;
  • a built-vs-runtime theme parity test;
  • a real-browser check that a larger sort glyph keeps the Sort control and header height, and that a hidden glyph leaves no gap.

New test files are named in each verification map but not added to verified_by until they exist on main.

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.

  • R1 narration: the architecture record's "No Core slot has shipped" described project state and would go stale with the first slot. It is replaced by "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)." 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.
  • R2 research in the record: none.
  • R3 evidence naming a change: none. Bases are "proposal" with the architecture clauses (architecture:icon-resolution-and-component-slots/INV2,INV4–INV8), and verification cells name test suites and failure signals, not PRs.
  • R4 rejected alternatives over one line or outside a decision: none added to the records. The three above live in this description only.
  • R5 pull request or issue references remaining: none in the records.
  • R6 ruled open questions still listing options: none. Each record's Open questions section is unchanged.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: "Knowledge templates and records are aligned."
  • Prettier (repo-pinned 3.9.4): clean.
  • git diff --check: clean.

…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.
@vercel

vercel Bot commented Nov 5, 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 5, 2026 6:58am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 5, 2026
@astracat-bot

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 5, 2026, 7:09 AM UTC

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 1161351

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 9 rows, core 4 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@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.

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:278 still 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's null rule; amend them, and the glyph rows at :349 and :357, to allow a null theme 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-indicator and table-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 |

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.

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.
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

Addressed in 4411549:

  • null versus the glyph invariants: AV3 now says the Sort indicator glyph and the Expansion glyph are absent when the theme maps their slot to null (FR5, FR7). The sortable-column and expandable-row representative states, and both glyph anatomy rows, now say the same.
  • Table compatibility notes: the Compatibility and migration section gains an "Additive theme surface (FR5, FR7)" line. The Compatibility/readiness row says both slots are additive, current, and await implementation, and that output is unchanged with no theme entry. This matches the description.
  • test-ui (3/4): as noted, CheckboxList.test.tsx also fails on current main. See "Known base-red check" in the description.

@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.

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:283 and :285, AV3 (:266-268) and the glyph rows (:354, :362) allow a missing glyph only when a theme maps the slot to a static null, but AST-087 FR13 also hides the icon for a slot function's null result or icon: 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. |

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.

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.
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

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 null, a slot function that returns null, or a request with icon: null), only the glyph is hidden". Table's AV3, the sortable-column and expandable-row representative states, and both glyph anatomy rows now use "unless the slot resolves to no icon". FR5's no-space rule applies to any hidden sort glyph. The description's Choice line matches.

@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.

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:82 now says "Each Core slot is recorded in its owning component's contract", but the chat-send-button-send slot that spec:AST-032 FR2 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

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.

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.
@imdreamrunner imdreamrunner changed the title spec: record the first component icon slots in CodeBlock, Timestamp, and Table spec: record component icon slots in CodeBlock, Timestamp, and Table Nov 5, 2026
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

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 (spec:AST-032 FR2 for chat-send-button-send)". "First" is dropped from the title, the summary line, and the rubric's R1 entry.

@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.

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]

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 1161351

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 5, 2026
@imdreamrunner
imdreamrunner merged commit 3b8d81f into main Nov 5, 2026
61 checks passed
@github-actions
github-actions Bot deleted the spec/ast087-first-component-icon-slots branch November 6, 2026 06:04

This branch was successfully deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant