Skip to content

spec(AST-087): icon variants, theme sizes, and componentIcons state resolvers - #7847

Merged
imdreamrunner merged 9 commits into
mainfrom
spec/ast-087-icon-variants
Oct 23, 2026
Merged

imdreamrunner merged 9 commits into
mainfrom
spec/ast-087-icon-variants

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Whether Astryx themes icons through:

  • one optional variant request on Icon, with each theme listing its variant names once (iconVariants);
  • theme icon entries that are a node or a pure function of the final size and a listed variant;
  • theme-set dimensions for the existing four sizes, through the Icon stylesheet target;
  • componentIcons slots that accept a name, null, a static partial request, or a pure resolver of typed component state,

instead of appearance and weight axes, per-library capability declarations, added size names, or an icon-role concept.

Record: spec:AST-087 (authority: current on owner approval), plus the owning records it changes, amended in this PR.

Existing authority searched

Decision

  • Variants (FR1–FR8, DEC-1, DEC-2, DEC-6, DEC-9): one optional variant; a theme lists its names once; the list types the theme's entries and resolvers and, through IconVariantMap augmentation written by theme build, product callsites; an unlisted variant reaches the entry as undefined and renders the normal icon; Astryx never derives one type from several themes (TypeScript may merge the augmentations of several loaded themes; FR4 covers the rest). variant selects artwork only and is not a styling selector. Build tooling can enumerate every request (key × four sizes × no variant or a listed variant). Direct icon components never receive variant.
  • Sizes (FR9–FR10, DEC-3): names stay xsm | sm | md | lg; a theme sets their dimensions through components.icon['size:*'].
  • Component icons (FR11–FR16, DEC-4, DEC-5): slot values are an IconName, null, a static {icon?, variant?, size?}, or a pure resolver of the slot's typed state. Fallback is field by field: a missing variant keeps the variant the component would otherwise request. A slot size changes only the Icon size.
  • Reads, built themes, server (FR17–FR20, DEC-7, DEC-8, DEC-10): only shared slot resolution calls slot functions; DefinedTheme['icons'] stays node-valued, DefinedTheme['componentIcons'] is a static view; runtime, built, extended, and server-rendered themes agree; malformed resolver fields degrade to missing with a development-only warning.

Rejected alternatives

  • Appearance and weight props typed from per-library capability declarations; per-icon version trees.
  • An open string variant; variant types derived by combining themes.
  • Theme-added size names; a separate size setting beside the stylesheet target.
  • An icon-role concept, a second component icon map, nested per-state maps, compound state keys.
  • Public lookups that take size or variant.

Claim scope and non-goals

Out of scope: owned icon box sizing and default glyph routing (#7913); adapters for imported icon libraries; migrating the NumberInput namespaced key; removing released per-state icon props; replacing indicators.

Evidence and implementation relationship

Record originally authored by @imdreamrunner; this head keeps those commits and adds the owner-record amendments and the owner's edits (variant list, static slot requests, field-by-field variant fallback, static public view of slot data, indicator boundary).

Reusable groundwork from the superseded AST-054 implementation PRs by @rubyycheung: #7214 (theme build carrying icon functions, core-compatibility build tests) and #7221 (Button icon geometry fixtures) are the starting points for implementing FR19 and #7913. No implementation PR exists yet for this record.

Writing rubric results

Run over every record this PR touches (AST-087 and the six amended owners):

  • R1 narration: none found; scanned added lines for "proposes", "we decided", "previously", "a port of", "now", "will", "until".
  • R2 research in the record: none; DEC-1 and DEC-9 keep one-sentence conclusions.
  • R3 evidence naming a change: none; verification cells name test states, and new Icon rows say "pending".
  • R4 rejected alternatives over one line or outside a decision: none; each Rejected: line sits inside DEC-1, DEC-2, DEC-3, DEC-4, or DEC-9.
  • R5 pull request or issue references remaining: none in any record (searched added lines for # followed by digits, /pull/, /issues/).
  • R6 ruled open questions still listing options: none; the former OQ1 (variant typing) and OQ3 (slot state and public data) are decided as DEC-9 and DEC-10, and the size-relationship question moved to spec(AST-088): component icon boxes follow the theme icon size #7913.

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

  • node scripts/check-knowledge.mjs: "Knowledge templates and records are aligned."
  • Prettier 3 --check on all seven records: passes.
  • git diff --check: clean.

@vercel

vercel Bot commented Oct 21, 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 Oct 22, 2026 4:04pm UTC

Request Review

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

astracat-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 22, 2026, 4:29 PM UTC

…esolvers

Draft record: Icon takes one optional variant; theme icon entries are fixed nodes or pure functions of {size, variant}; the four size names stay closed and a theme sets their dimensions through the Icon stylesheet target; componentIcons is the only component icon map and a slot may resolve from typed component state.

Co-authored-by: rubyycheung <[email protected]>
@imdreamrunner
imdreamrunner force-pushed the spec/ast-087-icon-variants branch from 50aa1ad to f07b799 Compare October 21, 2026 23:40
@imdreamrunner
imdreamrunner marked this pull request as ready for review October 22, 2026 05:01
@github-actions github-actions Bot added the spec-auto-merge Auto-merge was enabled by the spec owner gate label Oct 22, 2026
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Icon (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 618 -
Complexity N/A High (30) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

46 of 486 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 26 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | 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.

This spec is on hold for an engineering owner: spec:AST-087 adds new icon-theming requirements but has no owner approval on the current head (the spec-owner-approval status is still pending). Its FR11, FR13 and FR14 also intentionally change architecture:icon-resolution-and-component-slots INV3 (a componentIcons value is only an IconName or null) and INV8 (slot size and state stay with the component). Approval needs an owner to approve the record on this exact head and to update INV3 and INV8 to match; architecture:knowledge-contracts asks for the owning record to change in the same pull request. Three record fixes are also needed:

  • Say how state-resolver slots (FR14, DEC-5) relate to the existing defineTheme({indicators}) registry, which already themes marks such as Selector's selected-option check.
  • Narrow the non-goal "Theme styling for icon components passed directly to Icon" so it no longer contradicts FR7 and FR8; directly passed glyphs carry the icon target too.
  • Use a shared or namespaced key in FR1's example, because star is not an IconName.

[Automated review]

- Appearance or weight axes, or variant names defined by Astryx.
- New Icon size names.
- Additional component icon maps or an icon-role concept.
- Theme styling for icon components passed directly to `Icon`.

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 non-goal reads as excluding theme styling of directly passed icon components, but those glyphs carry the icon theming target too (component:Icon FR2, DEC-1). FR7 guarantees width/height on that target, and FR8 sizes a component's icon box "so the glyph and its box match", for example a Button whose icon is <Icon icon={PhotoIcon} />. Consider narrowing it to "Theme artwork or variant selection for icon components passed directly to Icon".

/>
);

defineTheme({name: 'brand', icons: {star}});

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.

star is not a shared IconName and has no namespace, so this example does not type-check against ThemeIconOverrides (Partial<Record<IconName | NamespacedIconName, ReactNode>>), and FR1 itself limits entries to a semantic or namespaced key. A shared name such as check, or a key such as 'app:star', keeps the example copyable.

Comment on lines +157 to +160
- **FR14 — Themes set state-dependent icons through slots.** A component that
shows a state-dependent icon exposes that state through its slot so the theme
can resolve it. Per-state icon props passed by a caller, such as `pressedIcon`
or `selectedIcon`, act as caller-supplied icon content.

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.

State-dependent marks are already themeable through defineTheme({indicators}), which replaces the check, checkbox and radio indicators with typed checked | unchecked | indeterminate state; Selector draws its selected-option check with useIndicator('check'). As written, FR14 and DEC-5 also cover those marks, and nothing says which wins when a theme sets both an indicator and a slot resolver. Could the record scope FR14 to glyphs no indicator draws, or state how the two compose?

…slot requests

- Amend architecture:icon-resolution-and-component-slots (INV3, INV8, final
  function results, indicator boundary, slot state docs), theme-authoring-contract,
  theme-compilation, theme-application, component-theming-surface INV14, and
  component:Icon in the same change.
- A theme lists its variant names once (iconVariants); the list types entries
  and requests, bounds build enumeration, and an unlisted variant renders the
  normal icon.
- A missing request variant keeps the variant the component would request.
- componentIcons also accepts a static partial request.
- Slot functions are called only by slot resolution; public theme data shows a
  static view.
- Indicators stay separate from componentIcons slots.
- Owned icon boxes and default glyphs move to a separate record.

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

This spec is on hold for an engineering owner. spec:AST-087 and its amendments to six current records, including architecture:icon-resolution-and-component-slots INV3 and INV8, need an owner's approval on this exact head, and spec-owner-approval is still pending. Five record fixes also remain:

  • FR3 says no variant type combines themes, but the per-theme theme build augmentations of IconVariantMap merge when an app loads two built themes.
  • Say whether the icon target reflects variant: component-theming-surface INV14 now calls it an extensible axis, while component:Icon FR6 forbids forwarding it to the DOM.
  • Square theme-authoring INV13 (“Astryx resolution is their only caller”) with FR8, which lets build tooling call entries.
  • Replace “runs once” (FR6, INV11) with “final for its resolution”, since server rendering and hydration both resolve the request.
  • Name the withdrawn selector-selected-option slot in Current-state impact.

[Automated review]

`IconVariant`, the names in the public, augmentable `IconVariantMap`. `theme
build` writes the augmentation for the theme it builds, the same way it
augments custom component values, and an application may augment the map
itself. No variant type is derived by combining themes.

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 two built themes in one app, each theme build writes its own .variants.d.ts augmentation of IconVariantMap, and TypeScript merges them, so IconVariant becomes the union of both lists. Consider stating that merge, with FR4 covering a name the active theme does not list, and narrowing this sentence to the per-theme typing inside defineTheme.

`Heading.type` qualifies because required `Heading.level` provides that
baseline. `Icon.size` does not: no missing custom size can be inferred without
silently changing geometry, alignment, or composition. Behavioral, structural,
baseline. `Icon.variant` qualifies because an unlisted variant renders the

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.

Calling Icon.variant an extensible axis brings the wiring extensibleAxes.test.ts guards: a *VariantMap, themeProps() reflection and visualProps. But component:Icon FR6 forbids forwarding variant to the DOM. Could the record say whether the icon target reflects variant, or that this axis is an artwork request outside INV14's styling wiring?

derive, or normalize input into a durable typed theme value used by a current
supported consumer; validating and returning the exact input unchanged is
insufficient.
- **INV13 — Theme functions stay behind resolution.** Function icon entries and

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.

AST-087 FR8 and theme-compilation INV15 let build tooling call each entry, so “Astryx resolution is their only caller” needs to include that tooling, or FR8 needs to be scoped to Astryx's own build.

Comment on lines +281 to +282
- **INV11 — A selected function answers the request.** A function entry or slot
function runs once for its request, and its result is final. Public theme

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.

Server rendering and hydration each resolve the same request (theme-application INV11), so an entry runs on both sides. “Final for its resolution” says what this rule needs, and the verification row's “a function runs twice” would fail a correct implementation.

export interface ComponentIconSlotMap {
'selector-selected-option': true;
}
export interface ComponentIconSlotMap {}

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.

Emptying the map withdraws the approved selector-selected-option slot. It matches Selector's AV1 check-indicator replacement, but AST-087's Current-state impact should name the withdrawal.

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

This spec is on hold for an engineering owner: spec:AST-087 and its amendments to six current records, including architecture:icon-resolution-and-component-slots INV3 and INV8, need an owner's approval on this exact head, and spec-owner-approval is still pending. The five record fixes from the previous review are resolved, and two remain:

  • architecture:component-theming-surface INV6, its Change coupling bullet and its INV14 verification row still require themeProps() reflection and a visualProps entry for an extensible axis, which Icon.variant deliberately lacks, so record how extensibleAxes.test.ts exempts it.
  • Say what an inherited function entry receives when a child theme replaces iconVariants, since it can otherwise be called with a name its own theme never listed, and a lookup-style entry would then render nothing under FR6.

[Automated review]

Comment on lines +218 to +219
artwork request, not a styling selector: the `icon` target does not reflect
it, so it has no `themeProps()` reflection, `visualProps` entry, or

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 exempts Icon.variant from themeProps() reflection and visualProps, but INV6 ("Variant, size, selection, disabled, and interaction state are reflected as target capabilities through themeProps"), the Change coupling bullet and the INV14 verification row in this record still require that wiring, and extensibleAxes.test.ts fails any map-backed prop without it. Could the record amend those three places and say how the guard recognizes an artwork axis such as IconVariantMap?

Comment on lines +123 to +124
entry for the same key whole. An explicit `iconVariants` list replaces the
inherited list; an omitted list is inherited.

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 a replaced list, inherited function entries stay (only a same-key entry replaces them) and Icon passes them the child's listed names, which their own theme never listed and their variant type excludes. A lookup-style entry then returns undefined, which FR6 makes final, so the icon disappears. Could this say what an inherited entry receives, for example a variant only when its defining theme also lists it?

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

This spec is on hold for an engineering owner: spec:AST-087 and its amendments to six current records, including architecture:icon-resolution-and-component-slots INV3 and INV8 and architecture:component-theming-surface INV6, need an owner's approval on this exact head, and spec-owner-approval is still pending. Both record fixes from the previous review are resolved, and one alignment remains:

  • component:Icon FR6, its Owns line, its "Listed variant" row and its FR6 verification row still say an entry receives every variant the active theme lists, while AST-087 FR4 and the theme-authoring normalization now withhold a variant from an inherited entry whose defining theme does not list it.

[Automated review]

Comment thread packages/core/src/Icon/Icon.spec.md Outdated
| FR3 | Icon MUST apply the resolved size as width and height for every glyph, plus font size where needed for 1em-based icon sources. This sizing contract MUST NOT promise an HTML or SVG element type. | Human decision, current source, and tests. | Settled intent. |
| FR4 | Supported SVG and styling escape hatches MUST retain their established merge and override behavior. | Current source and regression tests. | Current compatibility behavior; verify before changing. |
| FR5 | An explicit Icon `size` MUST win. Without one, Icon MUST use the nearest default supplied by an owning Astryx component for its documented icon slot; without such a default, Icon MUST use `md`. | Component-size precedence and Button sizing decision. | Settled intent. |
| FR6 | In registry mode, Icon MUST pass `{size, variant}` to the selected entry, where `size` is the size resolved by ORD1 and `variant` is the requested variant when the active theme lists it, otherwise `undefined`. A supplied icon component MUST NOT receive `variant`, Icon MUST NOT forward `variant` to the DOM, and the `icon` target MUST NOT reflect it. | `spec:AST-087` FR1–FR5 and FR9. | Settled intent. |

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.

FR6 passes the requested variant whenever the active theme lists it, but AST-087 FR4 and the theme-authoring normalization now add a second condition: for a theme-supplied entry, the theme that defined it must list the name too, so an inherited entry under a child with a replaced list receives undefined. As written, this row would hand a parent's lookup-style entry a name it never listed, and FR6 of AST-087 makes its undefined result final. Adding "and, for a theme-supplied entry, the theme that defined it lists it too" here, in the Owns line (line 56) and in the "Listed variant" row (line 125), plus an inherited-entry state in the FR6 verification row (line 198), would keep the two records in agreement.

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

This spec is on hold for an engineering owner: spec:AST-087 and its amendments to six current records, including architecture:icon-resolution-and-component-slots INV3 and INV8 and architecture:component-theming-surface INV6, need an owner's approval on this exact head, and spec-owner-approval is still pending. The component:Icon FR6 alignment from the previous review is resolved, and one alignment remains:

  • architecture:theme-compilation INV15 and its verification row, and AST-087's FR8 verification row, still say build tooling enumerates every listed variant, while FR8 now limits it to the variants an entry can receive under FR4, which leaves out a name only a child theme lists for an entry it inherits.

[Automated review]

Comment thread docs/architecture/theme-compilation.md Outdated
icon request and slot request to the same node as its runtime theme, and its
public icon and slot exports are the same node-valued and static views. Build
tooling that generates or subsets icon artwork enumerates a theme's requests as
every key with each of the four sizes and either no variant or one listed

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.

AST-087 FR8 now bounds this set by what an entry can receive under FR4 ("either no variant or one variant the entry can receive under FR4"), so an entry a child theme inherits never receives a name only the child lists. "One listed variant" here still includes that name; consider "one variant that entry can receive under spec:AST-087 FR4", plus an inherited-entry state in this record's INV15 verification row.

| --------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| FR1–FR7 | Registry type, resolver, and Icon render tests | node; function; null; omitted, listed, and unlisted variant; no active list; inherited entry under a replaced list; theme, global, default; direct | sources mix, an unlisted variant reaches an entry, `variant` reaches a component or the DOM |
| FR2–FR3 | Type tests and theme-build augmentation fixtures | listed names in entries and resolvers; child replaces list; built augmentation; unknown name | an entry sees an unlisted name type, a child merges lists, or Astryx derives one type from two themes' lists |
| FR8 | Build enumeration test against runtime resolution | every key × four sizes × no variant and each listed variant | an enumerated request differs from runtime output, or an unlisted variant is enumerated |

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.

FR8's own text now limits the set to variants the entry can receive under FR4; this row still enumerates "each listed variant" and has no inherited-entry state. Adding "inherited entry under a replaced list" keeps the row in step with FR8.

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

This spec is on hold for an engineering owner: spec:AST-087 and its amendments to six current records, including the intentional changes to architecture:icon-resolution-and-component-slots INV3 and INV8 and architecture:component-theming-surface INV6, need an owner's approval on the final head, and spec-owner-approval is still pending. The architecture:theme-compilation INV15 alignment from the previous review is resolved, and two record fixes remain:

  • FR15 says every component that shows a state-dependent icon through Icon exposes that state through its slot, which reaches shipped glyphs such as CodeBlock's copy feedback and Table's expansion chevron; scope it to slots, or amend those component contracts in this pull request.
  • FR3 and architecture:theme-authoring-contract say slot functions receive variant, but FR12 gives a slot function only the slot's state; say which type a slot request's returned variant has inside defineTheme.

[Automated review]

placement, color, interaction, and accessibility remain set by the component,
including any outer dimensions a family contract fixes across states.
- **FR15 — Themes set state-dependent icons through slots.** A component that
shows a state-dependent icon through `Icon` exposes that state through its slot

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.

As written this reaches shipped components that pick a state-dependent shared name with no slot: CodeBlock and the Timestamp hover card swap copy for check, and Table row expansion swaps chevronRight for chevronDown, the "Expansion glyph" component:Table describes. Current-state impact does not list those owners. Could FR15 be scoped to components that expose the icon as a componentIcons slot (with components that pick a shared name today keeping that until their own contract adds a slot), or could their contracts change here?

A child theme that sets `iconVariants` replaces the inherited list; one that
omits it inherits the list.
- **FR3 — The list types the theme and the request.** Inside `defineTheme`, entry
functions and slot resolvers receive `variant` typed as the theme's listed

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.

A slot resolver receives only the slot's state (FR12: (state: Readonly<State>) => ComponentIconRequest | null | undefined), so it has no variant input, and the next sentence types a slot request's variant as IconVariant. Perhaps "entry functions receive variant, and slot values return it, typed as the theme's listed names", or keep IconVariant for slot requests and drop slot resolvers from this sentence.

`{size: 'md'}`; `DefinedTheme['componentIcons']` is a static view of names,
`null`, and static requests, with resolver slots omitted; and
`DefinedTheme['iconVariants']` is the theme's list. Inside `defineTheme`, entry
functions and slot functions receive `variant` typed as that theme's listed

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.

Same wording as AST-087 FR3: slot functions take the slot's state, not variant (icon-resolution-and-component-slots.md types them as (state) => ComponentIconRequest | null | undefined). Whichever typing FR3 settles on, this sentence should match it.

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

This spec is on hold for an engineering owner: spec:AST-087 and its amendments to six current records, including the intentional changes to architecture:icon-resolution-and-component-slots INV3 and INV8 and architecture:component-theming-surface INV6, need an owner's approval on the final head, and spec-owner-approval is still pending. Both record fixes from the previous review are resolved, and two small ones remain before that approval:

  • DEC-5 still says every state-dependent icon is a theme decision made through a slot resolver, while FR15 now limits that to icons a component exposes as a slot; scope DEC-5's first sentence the same way.
  • architecture:component-theming-surface exempts IconVariantMap from extensibleAxes.test.ts wholesale, but FR3's theme build augmentation relies on the guard's check that the map is declared in the component's public index.ts; limit the exemption to the themeProps() reflection and visualProps checks.

[Automated review]

Comment on lines +344 to +346
A state-dependent icon is a theme decision made through a slot resolver, so every
instance follows one rule. Indicators keep stateful control marks, because they
draw a family's state rather than choose an icon.

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 still reads as covering every state-dependent icon, but FR15 now limits the rule to icons a component exposes as a slot (a component that picks a shared name from its own state keeps doing so, as CodeBlock's copy feedback does). Since icon-resolution's deciding_specs cite DEC-5, could the first sentence be scoped the same way, for example "A state-dependent icon that a component exposes as a slot is a theme decision made through its resolver"?

Comment on lines +369 to +371
and consumer metadata. An artwork axis has none of that styling wiring: the
guard exempts it by an explicit list of artwork-request maps, currently
`IconVariantMap`, and its focused fallback test renders an unlisted name.

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.

Icon.variant keeps the first piece of this wiring: FR3 makes IconVariantMap the public augmentable map, and the guard's first check (the map is declared in the component's index.ts, where theme build looks for it before it emits <theme>.variants.d.ts) is what keeps that augmentation working. Could the exemption cover only the themeProps() reflection and visualProps checks?

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

This spec is on hold for an engineering owner: spec:AST-087 and its amendments to six current records, including the intentional changes to architecture:icon-resolution-and-component-slots INV3 and INV8 and architecture:component-theming-surface INV6 and INV14, need an owner's approval on this exact head, and spec-owner-approval is still pending. Both record fixes from the previous review are resolved, and no other record defect remains, so approval of this head is the only open step. The failing pr-a11y check runs a test that exists on main but not on this branch, so it says nothing about these records.

[Automated review]

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 0613ee9

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 23, 2026
@imdreamrunner
imdreamrunner merged commit ad26461 into main Oct 23, 2026
67 of 68 checks passed
@github-actions
github-actions Bot deleted the spec/ast-087-icon-variants branch October 24, 2026 06:20

This branch was successfully deployed

1 active deployment
Preview — 0613ee9b Deployed Oct 22, 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.

2 participants