Skip to content

feat(core): add typed direct-icon library adapters - #7222

Closed
rubyycheung wants to merge 3 commits into
agent/ast054-core-capability-enginefrom
agent/ast054-direct-icon-adapter
Closed

rubyycheung wants to merge 3 commits into
agent/ast054-core-capability-enginefrom
agent/ast054-direct-icon-adapter

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

AST-054 B — typed direct-icon library adapter

Draft only. Exact implementation head: e3d22318b6a09eb6ccc07f83e15768ce1b7bf4ed; B aggregate range: f07f13744f42a139f1a78c75b5cfc6c91af12ca6..e3d22318b6a09eb6ccc07f83e15768ce1b7bf4ed (three B commits). The structural dependency is published A #7214 at that exact base. Canonical main snapshot and review authority: b3d9a89e578121493a60c276645d384acbf3bb41. The earlier WIP was checkpointed with known inference failures; this repaired stack is rebased onto the required code-only A head. No landing is performed here.

User need

Library authors need a supplied direct icon to follow theme appearance or weight without replacing its SVG defaults, accessibility or native props. Ordinary SVG components intentionally remain fixed; application-specific wrappers otherwise repeat theme selection at every integration and can accidentally mix presentation with DOM ownership. One opt-in adapter maps a local supported request to declared primitive library props while preserving the supplied component when no supported intent exists.

Problem and solution fit

  • Core adds the typed curried factory, opaque private metadata and direct-component dispatch over A's local capability engine. Ordinary components and released node-valued registry APIs retain their behavior.
  • The importable library owns its component, mapper, contract and adapted export. The CLI's existing production lowering remains unchanged; a new native source/built/extending-built bridge proves the adapter/library path, including operation after source-theme deletion. Functions remain importable references, not generated function text.
  • Isolated source/declaration/runtime fixtures, focused UI tests, an Icon-page decision guide, a shipped library-author guide and Core/CLI patch changesets support this one capability. No role/state, slot, Button or inventory capability is included.

Current specification

Existing Icon/public API, theme compilation and size-cascade ownership remain the compatibility floor. The matched current global claims are retained in the canonical receipt below; routing does not grant authority beyond each listed claim.

Approval dependencies are #6891 and #7116, not structural bases. This code-only B delta edits no specification, architecture, family, design or other authority record. AST-054/public factory naming and shape, including the optional propNames candidate, remain subject to final owner/API/authority approval (OQ1). Local implementation direction, tests, publication of A and earlier reference code do not settle that approval. No on-tree current AST-054 record or normative promotion is claimed.

Public delta and caller burden

The new operation is only createIconAdapter, plus its necessary adapter types: IconAdapterProps<P>, IconAdapterRequest<C> and IconAdapterOptions<C, MapperProps, PropNames>. The curried factory binds a capability contract and mapper before wrapping the supplied component. Optional propNames declares the mapper's output-key allowlist; its default is ['appearance', 'weight']. A caller choosing other primitive library fields names them explicitly and must provide a component whose props accept those mapped keys and values plus the original SVG props, without required extra or mapped props that the no-intent default cannot supply.

Discoverability is part of this PR. The Icon page now distinguishes semantic/registered artwork, fixed direct icons and direct icons that need theme presentation. The shipped icons guide adds a decision table, a one-time library-boundary integration example, unsupported-property fallback, duotone/color ownership, and explicit-versus-theme diagnostic behavior. An explicit appearance or weight on an ordinary direct icon warns once in development with createIconAdapter() guidance; theme-only fallback stays quiet.

Before, <Icon icon={ProductIconImpl} /> is an ordinary fixed direct SVG. After, a library can opt in once:

const ProductIcon = createIconAdapter({
  capabilities,
  resolveProps: ({appearance, weight}) => ({appearance, weight}),
})(ProductIconImpl);

<Icon icon={ProductIcon} />;

Here ProductIconImpl supports optional primitive appearance/weight library props alongside SVG props. Other library spellings use explicit propNames; the two-module shipped guide shows that path and compiled .js imports. Existing direct components need no migration.

  • IconType remains exactly ComponentType<SVGProps<SVGSVGElement>>. Wrapper identity is stable. No supported intent—including an implicit standalone/context size alone—skips the mapper and renders the wrapped supplied default. An admitted locally supported explicit size or resolved appearance/weight may activate mapping; every mapped axis is narrowed to the adapter's local contract.
  • Explicit unsupported appearance/weight has deduplicated development diagnostics; unsupported theme presentation is private inspection only. Production console remains quiet. Missing size support/artwork is silent normal fallback, never an unsupported-size warning. Fractional supported weights remain unchanged.
  • Only known declared primitive library props may be returned. Unknown, semantic/source/global/form/a11y/event/ref/style/children mappings, nonprimitive/nonfinite values, inherited/accessor/malformed output and throwing mappers are rejected safely and atomically. No getters, custom iterators or opaque lazy components are executed to validate metadata. Invalid mapping renders the wrapped default without unsafe props or a render-time throw.
  • Native role/ARIA, events, refs, styles, children and consumer precedence remain caller/component-owned. An explicitly declared primitive library size field is not a new geometric size axis. A's existing sizing/rem compatibility is unchanged.
  • No metadata lookup, resolver, inspection, normalization, merge, prepare or validation operation is added to the public barrels. The factory remains server-safe; existing client leaves and root export semantics are unchanged.

Released signatures remain:

registerIcons(icons: Partial<Record<ExtendedIconName, ReactNode>>): void
getIcon(name, source?)
getExtendedIcon(name, fallback?, source?)
useIcon(name)

renderIconSlot remains size/color-only; control-size unions and existing fixed artwork remain unchanged. No new provider, request transport or package subpath is introduced.

Design and alternatives

Opt-in immutable local metadata is used instead of recognizing arbitrary components or installing capabilities globally. Declared output keys plus component typing are used instead of deriving erased prop types at runtime, invoking the mapper on empty intent or allowing arbitrary DOM props. Mapping retains exact primitive requests instead of synthesizing artwork or interpreting CSS font weight. These are draft implementation choices, not new authority decisions.

Evidence

  • Fresh final-head Core output: 697 Babel modules and declarations, CSS generation, no-development-JSX and fully-specified-import checks pass. Core TypeScript and docs TypeScript pass; all four CLI type projects pass. The missing ignored Neutral built prerequisite was built normally; no tracked build/dependency changes were made.
  • Core UI: 308/308 across seven focused files, including all 65 adapter cases. Defaults/no intent, local-size admission, malformed/getter-safe atomic fallback, caller DOM ownership, ordinary-direct guidance, diagnostics and production quietness pass.
  • Public consumers: B source 2/2 and emitted 3/3; inherited A source 5/5 and emitted 6/6. All 17 B factory/component negatives remain active. Plain method, block-arrow and expression-arrow inference passes without caller casts, explicit generic workarounds or unreachable public overloads. Independent strict/no-emit review passes 13 further negative cases; the emitted declaration exposes one public factory signature.
  • Native CLI: 454/454 across 23 files: focused 135 plus remaining 319, including the exact 124-case doc-loader suite and packed old-Core coverage. The new two-case bridge proves source → built → extending-built defaults, mapped/fractional requests, contract identity and wrapper reuse, and fresh-process rendering after both source theme files are deleted. Invalid supported policy preserves all build/check sentinels; no CLI production lowering or function serialization was added.
  • Shipped examples: both guide code blocks pass actual public-source checking through three virtual modules, with zero diagnostics and no emit/source aliases.
  • Repository/source checks: normal repair hooks and all 17 repository guards pass. Knowledge, changesets (55), boundaries, exports, client directives (295), scoped ESLint across eight Core/CLI source, test and doc files (zero configured errors/warnings), formatting across all 12 changed paths, syntax and whitespace checks pass. Consumer scripts/fixtures are intentionally ESLint-excluded; no lint coverage is claimed for them.

Configured changed-source lint is reported separately from environment/runtime advisories. Known Node module-type/Vite placeholder-URL advisories, expected negative-test diagnostics, catalog fallback/CLDR notices and Neutral font/setup notes remain separate from configured source-lint findings. No warning-free execution, browser pixels, Node 24 confirmation or full CI is inferred from these focused checks. Source/program fixtures use fresh compiler hosts within package scope without source-path aliases; emitted checks use this B's fresh output, not A or integrated reference output.

Scope

  • One capability: typed direct-icon library adaptation over A.
  • No role/state participation, byState, roleSizeOverrides, new slot API, Button change, component enrollment, inventory/conformance or mixed later-slice tutorials.
  • No CLI production lowering change; only the native bridge and expanded shipped adapter guide.
  • No specification/architecture/authority record changes.
  • Focused consumer docs, type/runtime fixtures and patch changesets accompany the factory.
  • No tracked dependency, lockfile, build output or temporary configuration changes.
  • Public source/body contains no private operational context.

Testing

From the repository root, with repository-pinned pnpm 11 and the installed workspace dependencies:

pnpm -F @astryxdesign/core build
pnpm -F @astryxdesign/theme-neutral build
for config in \
  packages/core/tsconfig.json \
  packages/core/tsconfig.docs.json \
  packages/cli/tsconfig.strict.json \
  packages/cli/tsconfig.authoring-contract.json \
  packages/cli/tsconfig.template-docs.json \
  packages/cli/tsconfig.json-api.json; do
  node node_modules/typescript/bin/tsc --project "$config" --noEmit || exit "$?"
done
node scripts/icon-adapter-consumer-contract.test.mjs --source-only
node scripts/icon-adapter-consumer-contract.test.mjs --emitted-only
node scripts/icon-consumer-contract.test.mjs --source-only
node scripts/icon-consumer-contract.test.mjs --emitted-only
pnpm check:repo
node scripts/sync-exports.js --check
git diff --check

Scoped Core UI, using the actual branch UI configuration without its root build setup:

node --experimental-strip-types --input-type=module <<'JS'
import {pathToFileURL} from 'node:url';
import {startVitest} from 'vitest/node';
const root = process.cwd();
globalThis.__dirname = root;
const branch = (await import(pathToFileURL(`${root}/vitest.config.ts`).href)).default;
const ui = branch.test.projects.find(project => project.test.name === 'ui');
const test = {...branch.test, ...ui.test, globalSetup: []};
delete test.projects;
const files = [
  'packages/core/src/Icon/Icon.test.tsx',
  'packages/core/src/Icon/globalIconRegistry.test.tsx',
  'packages/core/src/Icon/iconCapabilities.test.tsx',
  'packages/core/src/Icon/iconAdapters.test.tsx',
  'packages/core/src/theme/defineTheme.test.ts',
  'packages/core/src/theme/Theme.test.tsx',
  'packages/core/src/theme/iconPolicy.test.tsx',
];
const ctx = await startVitest('test', files,
  {config: false, watch: false, maxWorkers: 2},
  {configFile: false, root, plugins: branch.plugins, resolve: branch.resolve, test});
await ctx.close();
JS

Native CLI reproduction below uses the already-built Core output. The recorded two processes ran in parallel; this loop runs the same configurations sequentially. No root config, user plugin/alias, setup file or build is requested. Existing fixture ensureCoreBuilt guards found fresh output and did not rebuild in the recorded run.

for group in focus rest; do
  TEST_GROUP="$group" node --input-type=module <<'JS'
import {startVitest} from 'vitest/node';
const groups = {
  focus: [
    'packages/cli/api/theme/build/build.icon-adapter-parity.test.mjs',
    'packages/cli/api/theme/build/build.test.mjs',
    'packages/cli/api/theme/build/build.family.test.mjs',
    'packages/cli/api/theme/build/build.icon-capabilities.test.mjs',
    'packages/cli/api/theme/build/build.icon-core-compat.test.mjs',
    'packages/cli/api/theme/build/build.icon-theme-protocol-compat.test.mjs',
    'packages/cli/api/theme/build/icon-serialization.test.mjs',
    'packages/cli/api/theme/build/icon-emission.test.mjs',
    'packages/cli/api/theme/build/icon-imports.test.mjs',
  ],
  rest: [
    'packages/cli/api/theme/build/build.adaptation-core-compat.test.mjs',
    'packages/cli/api/theme/build/build.adaptation-enrollment.test.mjs',
    'packages/cli/api/theme/build/build.font-warning.test.mjs',
    'packages/cli/api/theme/build/build.heading-core-compat.test.mjs',
    'packages/cli/api/theme/build/build.icon-lineage.test.mjs',
    'packages/cli/api/theme/build/build.icon-preservation.test.mjs',
    'packages/cli/api/theme/build/build.icons-specifier.test.mjs',
    'packages/cli/api/theme/build/build.packed-old-core.test.mjs',
    'packages/cli/api/theme/build/build.project-core.test.mjs',
    'packages/cli/api/theme/build/build.public-component-vars.test.mjs',
    'packages/cli/api/theme/build/build.receipt-doc.test.mjs',
    'packages/cli/api/theme/build/build.rollback.test.mjs',
    'packages/cli/api/theme/build/font-warning.test.mjs',
    'packages/cli/foundation/doc-compiler/doc-loads.test.mjs',
  ],
};
const files = groups[process.env.TEST_GROUP];
const ctx = await startVitest('test', files, {
  config: false, root: process.cwd(), watch: false,
  environment: 'node', maxWorkers: 1,
}, {
  test: {include: files, globalSetup: [], setupFiles: [],
    testTimeout: 30000, hookTimeout: 30000},
});
await ctx.close();
JS
  status=$?
  if [ "$status" -ne 0 ]; then exit "$status"; fi
done

The focused Core UI lane uses config:false with flattened actual branch plugins, aliases, environment and setup; no root globalSetup, nested inherited projects or temporary config. The native CLI fixture uses actual package imports from the completed owner-built B output and preserves build/check sentinels on rejection. Source-deletion proof retains the importable library while removing both original theme files; it is not an old integrated-suite substitute.

All B source bytes were banked before the f07 restack and compared afterward: all 12 paths are unchanged. Final-head Core build, source/emitted consumers, UI, CLI native suites, docs and type checks use the repaired stack, not the earlier WIP output. The complete two-commit B aggregate is limited to those 12 paths; no authority record, manifest, lockfile or tracked build output changed. Normal hooks ran on the green repair before the byte-identical restack; final checks were repeated afterward.

Pending, not claimed complete: real-browser execution/rendered bounds/theme-switch/root-font matrix; Node 24 confirmation; broader cross-package/full CI and unrun expanded performance/parity coverage; final owner/API/authority approval and OQ1; later C–E work and OQ2. This is a coherent local draft boundary, not green-to-land authorization.

Writing rubric results

Not applicable to record edits: B changes no specification, architecture, family, design or other authority record. R1–R6 standing-record content is untouched; proposals, implementation choices and check receipts stay in this description rather than being written into current authority.

Canonical review receipt

The authority is the specified canonical main snapshot b3d9a89e578121493a60c276645d384acbf3bb41, verified as the published code-only A dependency's canonical main merge-base and the final B main merge-base—not B's implementation parent or an integrated reference. Semantic triggers are accessibility, behavior, compatibility, component-slots, layout, public-api, testing and theming. Every matched record/claim/trigger/reason is retained below with canonical raw digest validation and lossless reconstruction; the direct owner still settles the exact public delta.

Complete lossless receipt: 242 matches across 21 records

Exact receipt metadata:

{"schemaVersion": 1, "authorityCommit": "b3d9a89e578121493a60c276645d384acbf3bb41", "reviewHead": "fe71bc6c53ee35df5835423ec0bfa7c2d71b96ea", "requestedTriggers": ["accessibility", "behavior", "compatibility", "component-slots", "layout", "public-api", "testing", "theming"]}

Each trigger@ordinal cell is one match; ordinals restore original order. Authority commit is shared above, path/digest once per record. Claim strings are JSON-quoted without content changes.

The exact match reason for every cell is:

Requested trigger "{trigger}" matched review-applicability:v1 claim "{recordId}/{claimId}".

Substitute that cell’s trigger and record/claim IDs. All original matches and reasons reconstruct exactly; all canonical record digests verify.

architecture:component-size-cascade

Path: docs/architecture/component-size-cascade.md; digest: a66fae4c1dd966500a2a2c3c1f345de7afe19c142a744e9eb32449ac8c451410.

  • INV1 [layout@1]: "The standard axis is shared."
  • INV2 [layout@2]: "Participation is explicit."
  • INV3 [layout@3]: "Explicit intent wins."
  • INV4 [layout@4]: "The nearest provider wins."
  • INV5 [layout@5]: "Local default is final."
  • INV9 [layout@6]: "Public, rendered, and visual size agree."

architecture:component-test-sufficiency

Path: docs/architecture/component-test-sufficiency.md; digest: 2312a6256ab09360e04167e14f562aa6cebc34fbd7e6eba7c68cdf773679de66.

  • INV1 [testing@7]: "Authority and evidence are distinct."
  • INV10 [testing@8]: "Gaps and hardening are distinct."
  • INV11 [testing@9]: "New tests require a new proof obligation."
  • INV2 [testing@10]: "Critical promises have regression evidence."
  • INV3 [testing@11]: "Previously fixed behavior defects remain protected."
  • INV4 [testing@12]: "Partitions follow behavior and risk."
  • INV5 [testing@13]: "Assertions observe the contract."
  • INV6 [testing@14]: "Evidence is mutation-sensitive."
  • INV7 [testing@15]: "Coverage remains bounded and intentional."

architecture:component-theming-surface

Path: docs/architecture/component-theming-surface.md; digest: 78928cd4356402a212c2c8d4d76a9a67bd0831e873e7e7cd0dbe777e12ec8597.

  • INV10 [theming@16]: "Public semantic variables are admitted, not inferred."
  • INV12 [theming@17]: "Aliases are compatibility, not anatomy."
  • INV14 [theming@18]: "Extensible axes need a theme-independent fallback."
  • INV15 [theming@19]: "Conditional styling does not create conditional API."
  • INV3 [theming@20]: "Anatomy does not imply target proliferation."
  • INV4 [theming@21]: "Targets paint."
  • INV5 [theming@22]: "Composition preserves ownership."
  • INV6 [theming@23]: "State stays on the owning target."
  • INV7 [theming@24]: "Guarantees use one catalog and exact target declarations."
  • INV8 [theming@25]: "Names imply nothing beyond themselves."
  • INV9 [theming@26]: "Generic styling is best effort."

architecture:container-padding

Path: docs/architecture/container-padding.md; digest: 3e277a151e5184eebc1115cd0eda4212817e6c328495e34629aa967efb6360f5.

  • INV1 [layout@27]: "Internal geometry is not theme API."
  • INV10 [layout@28, public-api@34]: "The public vocabulary names intent."
  • INV11 [layout@29, public-api@35]: "Participation and host eligibility are explicit."
  • INV3 [layout@30, public-api@36]: "Bleed is opt-in and edge-specific."
  • INV6 [layout@31]: "Overlay boundaries terminate stale geometry."
  • INV8 [layout@32]: "Participation is explicit."
  • INV9 [layout@33, public-api@38]: "Edge compensation has two geometry owners, not shared tokens."
  • INV7 [public-api@37]: "Composition keeps component ownership."

architecture:icon-resolution-and-component-slots

Path: docs/architecture/icon-resolution-and-component-slots.md; digest: fb4160089d30a46465c988c357f0aa3cc02cfda92b47bc51b950151da595b81c.

  • INV1 [component-slots@39]: "Shared names and component roles are separate."
  • INV10 [component-slots@40]: "Existing keys coexist."
  • INV2 [component-slots@41]: "Slots are typed and owner-declared."
  • INV3 [component-slots@42]: "Slots map to shared meanings."
  • INV6 [component-slots@43]: "Resolution order is stable."
  • INV7 [component-slots@44]: "Component slots do not grow the shared name set."

architecture:layer-runtime

Path: docs/architecture/layer-runtime.md; digest: f1330dd884a04ecd0505934f4ab9812ede8602baf35036876d6a149cebde6aca.

  • INV11 [layout@45]: "One viewport gutter."
  • INV12 [layout@46]: "The first frame is the settled frame."
  • INV3 [layout@47]: "Positioning modes do not leak."

architecture:public-component-api

Path: docs/architecture/public-component-api.md; digest: 1cd2cc5d705ba8f94886794ae844dd5be86262261db276fad539074f3775f33c.

  • INV1 [public-api@48]: "Public exports are reachable."
  • INV12 [public-api@49]: "Reachability outranks internal labels."
  • INV2 [public-api@50]: "Names carry the same meaning."
  • INV3 [public-api@51]: "One prop controls one independent concept."
  • INV4 [public-api@52]: "New props express caller-owned intent."
  • INV5 [public-api@53]: "Accepted consumer props are preserved."
  • INV6 [public-api@54]: "Styling inputs combine."
  • INV7 [public-api@55]: "Event handlers compose deliberately."
  • INV8 [public-api@56]: "Refs follow React 19."
  • INV9 [public-api@57]: "Released APIs change deliberately."

architecture:theme-application

Path: docs/architecture/theme-application.md; digest: 77631b8bd5cf5aa74f6ea402a403d5e49dcd3f454cd418c61b0aabbdcf0cc3e2.

  • INV1 [theming@58]: "The nearest provider wins."
  • INV2 [theming@59]: "Only the root provider changes <html>."
  • INV3 [theming@60]: "Detached consumers share one root-theme store."
  • INV7 [theming@61]: "System mode follows the platform."
  • INV8 [theming@62]: "Media surfaces do not replace the theme."
  • INV9 [theming@63]: "Application does not change compiled rules."

architecture:theme-authoring-contract

Path: docs/architecture/theme-authoring-contract.md; digest: 09b609519bc2acb4a22a0f0cbcf43da7e8ba6e67c7327f5381797bfe2e29710b.

  • INV1 [theming@64]: "One input produces one normalized theme."
  • INV11 [theming@65]: "defineTheme validates only what it constructs."
  • INV12 [theming@66]: "Theme define* helpers construct theme values."
  • INV3 [theming@67]: "Extension is semantically flattened."
  • INV8 [theming@68]: "Local-token enrollment is explicit and owner-tracked."
  • INV9 [theming@69]: "Authoring and output are separate systems."

architecture:theme-compilation

Path: docs/architecture/theme-compilation.md; digest: 623dcf810adda23681bcff3c2cfd39a25d2bce8e8301ddb7436d11372ad57b2f.

  • INV10 [theming@70]: "Shared intent keeps the same meaning."
  • INV2 [theming@71]: "Web has one compiler."
  • INV3 [theming@72]: "Mounting and saving do not change the rules."
  • INV4 [theming@73]: "Web uses one cascade contract."
  • INV6 [theming@74]: "Private variables stay private."
  • INV9 [theming@75]: "Platform details stay out of shared authoring."

spec:AST-002

Path: docs/specs/AST-002/spec.md; digest: cf7c14cf5f607a2a224044ffa835fd207dd4d5ebe00a8958581e4b9d41d7243c.

  • DEC-1 [public-api@76]: "Public props require a non-derivable caller distinction"
  • DEC-2 [public-api@77]: "Caller need does not admit an unclear or unenforceable API"
  • DEC-3 [public-api@78]: "One semantic action uses one canonical operation name"
  • DEC-6 [public-api@79]: "Public inputs keep one semantic responsibility"
  • DEC-7 [public-api@80]: "Public module and utility verbs disclose atomic roles"
  • DEC-8 [public-api@81]: "Public primitives are intentional semantic contracts"
  • FR15 [public-api@82]: "Invalid states are prevented where practical."
  • FR4 [public-api@83]: "Existing composition and styling seams come first."

spec:AST-009

Path: docs/specs/AST-009/spec.md; digest: d779066d710ce499c8c124bfdc734b4b38e8cc207cfe75bf5a31cb3bba349a2f.

  • FR1 [accessibility@84]: "The gate follows the claimed user outcome. Real AT/browser evidence is required only when the intended outcome depends on AT-specific behavior: how AT exposes or announces focus, AT-specific focus order, spoken/braille output, browse or virtual-cursor behavior, mode changes, or a known AT/browser divergence. A semantic code change or focus-only browser behavior is not the trigger; the trigger is an AT-dependent claim that cannot be proved below the real-AT layer."
  • FR10 [accessibility@85]: "The tested state is the claimed state. Evidence exercises the transition or state that carries the user outcome, such as opening the surface, moving focus, producing the status update, dismissing and restoring focus, or entering with the virtual cursor. A static baseline that merely contains the component is insufficient."
  • FR11 [accessibility@86]: "Real means the shipping pairing. A real-AT check runs the named assistive technology against the named shipping browser on its supported operating system. A virtual machine, remote machine, or simulator is acceptable only when it runs that actual pairing and preserves the input/mode under test. A DOM emulator, accessibility snapshot, synthetic speech stub, or browser engine standing in for a branded browser is not real-AT evidence."
  • FR12 [accessibility@87]: "Desktop-neutral AT-specific focus exposure/order or announcement claims use two independent stacks: at least NVDA + Chrome on Windows and VoiceOver + Safari on macOS. A platform-specific claim uses its matching pairing only unless FR14 expands it."
  • FR13 [accessibility@88]: "Mobile claims use a matching mobile stack. A mobile or touch/virtual-cursor outcome uses at least one matching mobile pairing. Both iOS and Android are required only when the claim covers both and platform-specific code, behavior, or recorded evidence gives reason to expect different outcomes."
  • FR14 [accessibility@89]: "Divergence expands rather than replaces. Every side named in a known divergence is included even when that adds a pairing beyond FR12 or FR13."
  • FR15 [accessibility@90]: "Versions and modes are part of the matrix. The receipt names OS, AT, browser, input mode, and material settings or verbosity that affect the result. “Screen reader checked” or a browser name without its AT is not a matrix."
  • FR16 [accessibility@91]: "Representative does not mean exhaustive. Passing the selected matrix supports only the recorded outcome and pairings. It does not claim every AT, browser, verbosity setting, locale, or input method behaves identically."
  • FR2 [accessibility@92]: "Focus changes trigger only for AT-specific outcomes. Real AT/browser verification is required when the claim depends on how AT exposes, announces, or orders programmatic, initial, restored, composite, or after-dismissal focus. Focus destination, order, return, keyboard operation, focus-ring styling, a refactor preserving the same browser focus target, or a static tabIndex correction does not trigger by itself. The owning component and interaction-modality record define those browser and visual behaviors."
  • FR3 [accessibility@93]: "Role, name, and description changes trigger when announcement or mode is the outcome. A computed role, accessible name, or description may be proved by accessibility-tree evidence when the claim ends at browser exposure. Real AT/browser verification is additionally required when the change relies on that semantic being announced during entry or a state transition, changing interaction/browse mode, or resolving a known AT/browser divergence."
  • FR4 [accessibility@94]: "Announcement content and timing trigger directly. A live region, status message, alert, validation announcement, loading/completion transition, or other spoken/braille update requires real AT/browser evidence when success depends on what is announced, its order, when it occurs, whether it repeats, or whether it is skipped."
  • FR5 [accessibility@95]: "Virtual-cursor entry triggers directly. Opening, navigation, or focus behavior requires real AT/browser evidence when success depends on where screen-reader browse or virtual cursor enters, whether content is discoverable from that entry point, or whether the user can move between browse and interaction modes. Ordinary keyboard Tab order with no browse-mode claim does not trigger this requirement."
  • FR6 [accessibility@96]: "Known divergence keeps the gate active. A changed pattern with a recorded AT/browser divergence requires checks for every named side of that divergence until an owner records that the divergence no longer applies. A passing result from one side does not stand in for another known to differ."
  • FR7 [accessibility@97]: "Untriggered changes use proportionate evidence. Static semantics, keyboard behavior, color/contrast, target size, source order, and similar accessibility changes use the least expensive evidence layer that directly proves the claim. They do not acquire a real-AT gate merely because they are accessibility work."
  • FR9 [accessibility@98]: "Evidence composes by claim. A triggered change normally keeps its lower-layer evidence and adds real AT/browser checks only for claims those checks can prove. Real AT observation MUST NOT replace deterministic regression coverage for behavior the lower layers own."

spec:AST-012

Path: docs/specs/AST-012/spec.md; digest: f06af20e9991a664c47c81e62d38965ac15ce9cf08e77b2db1c9c5c268e373ce.

  • FR4 [theming@99]: "Rules use the theme value contract."
  • FR5 [theming@100]: "Media surfaces remain more specific."
  • FR6 [theming@101]: "Rule order determines precedence."
  • FR7 [theming@102]: "Theme extension preserves cascade order."

spec:AST-017

Path: docs/specs/AST-017/spec.md; digest: 1cc3879298f7a9db0dec9ab7af88aadd9bc2c922a5628bdc3e3d5f13ddadb32b.

  • DEC-1 [compatibility@103]: "Breaking means a released consumer must change"
  • DEC-10 [compatibility@104]: "Replacement-first records own deprecation and cleanup"
  • DEC-11 [compatibility@105]: "Behavior-correcting incompatibility is not an ordinary fix"
  • DEC-12 [compatibility@106]: "The paired minor admits only three delta classes"
  • DEC-13 [compatibility@107]: "Cadence guides planning; readiness and authority gate the cut"
  • DEC-14 [compatibility@108]: "Documentation catalog display names and routes are mutable data"
  • DEC-15 [compatibility@109]: "A minor is scheduled before its breaking work lands"
  • DEC-16 [compatibility@110]: "Deprecation acts at authoring surfaces, not production runtime"
  • DEC-5 [compatibility@111]: "Supported CLI behavior is never hidden"
  • DEC-6 [compatibility@112]: "Global CLI controls prove global value"
  • DEC-7 [compatibility@113]: "Cross-cutting controls are complete, observable, and per invocation"
  • DEC-8 [compatibility@114]: "Configuration is a last resort, and contributions compose"
  • DEC-9 [compatibility@115]: "Existing stable components incubate APIs behind one explicit boundary"
  • FR12 [compatibility@116]: "Supported inter-package ranges are contracts."
  • FR14 [compatibility@117]: "No supported CLI behavior is hidden."
  • FR15 [compatibility@118]: "Global controls require CLI-wide value and semantics."
  • FR16 [compatibility@119]: "Cross-cutting guarantees define and close their boundary."
  • FR17 [compatibility@120]: "Suppressed work is observable."
  • FR18 [compatibility@121]: "Programmatic controls are explicit and invocation-scoped."
  • FR19 [compatibility@122]: "Configuration is admitted only on evidence."
  • FR20 [compatibility@123]: "Integration contributions compose predictably and visibly."
  • FR21 [compatibility@124]: "Experimental APIs are explicit and opt-in before publication."
  • FR22 [compatibility@125]: "Experimental changes are patch-level and stay confined."
  • FR23 [compatibility@126]: "Promotion creates a stable contract deliberately."
  • FR24 [compatibility@127]: "Experimental status is verified per public surface."
  • FR25 [compatibility@128]: "Stable Core and every published stable package default to compatibility."
  • FR26 [compatibility@129]: "Public lifecycle state is explicit."
  • FR27 [compatibility@130]: "Experimental isolation covers every surface kind."
  • FR28 [compatibility@131]: "Deprecation is replacement-first, actionable, and machine-readable."
  • FR29 [compatibility@132]: "Deprecation adds no production-runtime behavior."
  • FR29a [compatibility@133]: "Warnings live at the earliest accurate authoring surface."
  • FR29b [compatibility@134]: "Guidance teaches one modern path."
  • FR29c [compatibility@135]: "Modernization is safe and verifiable."
  • FR29d [compatibility@136]: "Each public surface projects the lifecycle without inventing another one."
  • FR3 [compatibility@137]: "Released contracts include behavior, not only types."
  • FR30 [compatibility@138]: "Deprecation minima come only from direct authority."
  • FR31 [compatibility@139]: "Cleanup is one-to-one with approved ids and proven modernization."
  • FR32 [compatibility@140]: "Behavior-correcting incompatibility is a distinct classification."
  • FR33 [compatibility@141]: "Incompatible-fix evidence and approval are complete."
  • FR34 [compatibility@142]: "Incompatible fixes use a corrective lifecycle."
  • FR35 [compatibility@143]: "Emergency correction is narrow and never relabeled as a patch."
  • FR36 [compatibility@144]: "Minor frequency is planning guidance, not eligibility."
  • FR37 [compatibility@145]: "Every minor has an owner-approved public plan and freeze."
  • FR38 [compatibility@146]: "The final patch is the paired minor's locked baseline."
  • FR39 [compatibility@147]: "Every final-patch-to-minor delta has exactly one class."
  • FR4 [compatibility@148]: "Preserved old usage is nonbreaking."
  • FR40 [compatibility@149]: "Compatible fixes may be disclosed separately in the minor."
  • FR41 [compatibility@150]: "Records use closed schemas."
  • FR42 [compatibility@151]: "Contributors declare compatibility intent once."
  • FR43 [compatibility@152]: "CI validates semantics, not labels."
  • FR44 [compatibility@153]: "Exact-main release gates and rollback preserve one identity."
  • FR45 [compatibility@154]: "Documentation catalog display names and routes are mutable data."
  • FR46 [compatibility@155]: "Main targets a patch by default."
  • FR47 [compatibility@156]: "A minor is scheduled explicitly, by an owner, before its work lands."
  • FR48 [compatibility@157]: "While main targets a patch, incompatible work is refused."
  • FR49 [compatibility@158]: "The schedule fails closed."
  • FR5 [compatibility@159]: "Additive and victim-free contract restorations are nonbreaking."
  • FR50 [compatibility@160]: "Returning to a patch target is ordinary cleanup."

spec:AST-020

Path: docs/specs/AST-020/spec.md; digest: 07e607f636b6243057d510d11bef4385e77e9644e16a1f61ad9a1b5af8489dba.

  • FR1 [accessibility@161]: "WCAG 2.2 A and AA are the conformance baseline."
  • FR2 [accessibility@162]: "APG defines an adopted widget pattern, not universal conformance."
  • FR6 [accessibility@163]: "Evidence layers keep distinct proof boundaries."

spec:AST-030

Path: docs/specs/AST-030/spec.md; digest: 1fc6ffc51f3d19e7877d6d88157d717dcf157ffc64e77b58781f94605cf12925.

  • FR11 [testing@164]: "Each surface owns one test and applicable build lane."
  • FR7 [testing@165]: "Required check names remain stable."

spec:AST-055

Path: docs/specs/AST-055-caller-rendered-trigger/spec.md; digest: e40db994f7de57d27adf6a148460a169625bc605b437570c2af957808713acc9.

  • AR1 [accessibility@166]: "The caller's control carries the disclosure."
  • AR2 [accessibility@167]: "One interactive element, one focus ring."
  • AR3 [accessibility@168]: "Focus returns to the control."
  • AR4 [accessibility@169]: "Every supported configuration keeps a complete keyboard path."
  • DEC-1 [public-api@170]: "A caller-supplied overlay control is a render prop"
  • DEC-4 [public-api@171]: "Hook trigger props are a different convention"
  • FR1 [public-api@172]: "A component that lets a caller supply the control which opens its overlay MUST take that control as a render prop named renderTrigger (DEC-5): a function the component calls with one props object, whose returned element the component renders as given. The component MUST NOT wrap the returned element in an element of its own, and MUST NOT require a particular tag or a particular Astryx component."
  • FR2 [public-api@173]: "Spreading the handed-back props onto one element MUST be the whole integration. The object MUST carry the ref or anchor the overlay positions against, the id AR1 needs, every handler that opens, toggles, and closes the overlay from that control on the component's supported input paths, and the disclosure attributes of AR1. The object's type MUST be exported from the component's public entry point."
  • FR3 [public-api@174]: "A caller-supplied control MUST NOT be taken as a ReactNode slot that the component renders inside an interactive element of its own. Callers routinely pass an interactive component, and that shape nests one interactive element inside another (AR2). A content slot rendered inside a component-owned control remains valid for non-interactive content and is unchanged."
  • FR7 [public-api@175]: "Where a component offers both a built-in control and this prop, exactly one control MUST render. The caller's control MUST win, identically in every presentation the component supports, and a development warning MUST fire; the component's own chrome for the replaced control MUST NOT render. Silently ignoring a supplied prop, or rendering both, is rejected."
  • FR8 [public-api@176]: "A hook that returns props for a trigger — triggerProps and getTriggerProps on useLightbox, usePopover, useMenuHover, and useHoverCard — follows hook conventions and is unchanged by this record. Those return-value names are NOT precedent for a component prop's name or shape. This record does not require a hook to grow a render prop, nor a component to republish its trigger props as a hook return."

spec:AST-056

Path: docs/specs/AST-056-search-prop-shape/spec.md; digest: d308f4bde211ce082c0eccd1fdc2c4d85a3a40fecb78db893a8d1dc7fb579b1f.

  • AR1 [accessibility@177]: "The empty-result message reaches assistive technology as written."
  • AR2 [accessibility@178]: "The query input has an accessible name that is not its placeholder."
  • FR7 [compatibility@179, public-api@190]: "Every prop this record renames is a released public surface with a victim, so it MUST follow spec:AST-017 FR28–FR31: the replacement ships first, old usage stays equivalent through the overlap, each old prop gets a DEP-* id and a distinct CLN-* id, and removal happens only in a minor whose frozen manifest carries both. While both exist, a component given both MUST resolve to the new prop and MUST fire a development warning."
  • DEC-1 [public-api@180]: "One name and one type for "the query matched nothing""
  • DEC-2 [public-api@181]: "No search configuration object"
  • DEC-3 [public-api@182]: "A query-only capability is enabled by a boolean and reported through the existing change callback"
  • DEC-4 [public-api@183]: "The vocabulary is fixed; new capabilities join it"
  • FR1 [public-api@184]: "One observable state has one prop name and one type across every component with a typed query. "The query matched nothing" is emptySearchText, accepting ReactNode. emptySearchResultsText resolves to it and its string typing is widened, so a caller may pass an element. No component may name or type this state differently."
  • FR2 [public-api@185]: ""The query matched nothing" and "the component was given no choices at all" are different states and MUST stay separately expressible under distinct names: emptySearchText and emptyText. Selector and MultiSelector already declare both, so neither name may absorb the other, and a component offering only one MUST still use the name that matches the state it means."
  • FR3 [public-api@186]: "Whatever a caller supplies for an empty state MUST reach the person operating the component, visually and non-visually alike. A component that announces this state MUST announce what it rendered. Announcing a built-in default while rendering the caller's element is a defect, not a fallback."
  • FR4 [public-api@187]: "Who resolves the query is settled by who owns the choices, and is not restated per component. A component that holds its own choice set resolves the query itself, matching case-insensitively on each choice's displayed label at minimum, and exposes a boolean to turn the query input on. A component whose presented choices ARE the query's result takes a required searchSource. Both kinds reach the same observable states: a narrowed list, an empty result, and emptyText."
  • FR5 [public-api@188]: "A capability that cannot function without a typed query MUST have exactly one switch, and MUST report through the component's primary change callback with a descriptor naming the kind of change, rather than through a handler prop of its own. A caller MUST NOT be able to express a configuration that renders nothing and reports nothing, which hasCreate && hasSearch && onCreate != null permits whenever any one piece is missing. Enabling it on a component with no query input MUST warn in development rather than fail silently."
  • FR6 [public-api@189]: "A new search-related capability is admitted under spec:AST-002 against this record, or not at all. A new top-level prop whose name carries the word search MUST name the state or capability it governs in the vocabulary this record fixes, and MUST NOT introduce a second name for a state one of these props already expresses."

spec:AST-057

Path: docs/specs/AST-057-row-actions/spec.md; digest: 1e1dff68e3a59c8c6ada5f8348e36647a4aa3c497f3baf645746047a5a5d0be0.

  • AR1 [accessibility@191]: "The panel is real while resting and absent while closed."
  • AR2 [accessibility@192]: "The gesture touches nothing on a pointer that can hover."
  • AR3 [accessibility@193]: "The row's primary stays one tab stop."
  • DEC-2 [behavior@194]: "Rest is the default; commit is a caller choice for one verb"
  • DEC-5 [behavior@195]: "The root translates and the panels counter-translate; no element is added"
  • FR4 [behavior@196]: "A sideways drag on a coarse pointer MUST move the row and uncover the side's panel, showing each entry's label and icon as a filled surface in its variant's colour; the panel MUST NOT be visible at rest, by any pixel."
  • FR5 [behavior@197]: "Under reveal, a release past the panel's width MUST leave the row resting open with every entry tappable, and a drag past the commit point or a fling MUST fire the outermost entry and no other. Under commit, a release past the commit point or a fling MUST slide the row out and fire the outermost entry; nothing MUST rest. After any entry fires, under either model, the row MUST spring back unless the entry has hasRemoval, in which case it MUST hold out at the edge it travelled toward. That bit is the only thing an entry declares about the row; the component MUST NOT wait on, observe, or act on what the caller does next, and MUST NOT warn if a held-out row is never removed. A release short of the threshold MUST spring back under both models. onActivate MUST fire at activation and may return a Promise."
  • FR6 [behavior@198]: "The drag MUST decide its axis once, early, and a mostly vertical drag MUST stay the scroller's. A mouse MUST NOT start the drag. The click the browser synthesizes after a drag MUST NOT fire the row's primary action."
  • FR7 [behavior@199]: "A resting row MUST close on a pointer landing anywhere outside it, on Escape with focus inside it, on firing an entry, and on unmount. Because a drag on a neighbour is a pointer outside it, at most one row rests open at a time without any shared state."
  • FR8 [behavior@200]: "Directions MUST be logical: trailing is uncovered by a drag toward the inline start and sits at the inline end; leading the reverse; so the finger, the uncovered edge, and the panel agree under RTL."
  • DEC-1 [public-api@201]: "Swipe actions are declared as data"
  • DEC-3 [public-api@202]: "The capability is Item's; where it is available follows the row's role"
  • DEC-4 [public-api@203]: "No hover reveal"
  • DEC-6 [public-api@204]: "The verb variant set is neutral | accent | destructive, minted knowingly"
  • FR1 [public-api@205]: "Item MUST take its swipe actions as swipeActions: {leading?: ItemSwipeAction[]; trailing?: ItemSwipeAction[]}, where ItemSwipeAction is `{id?, label: string, icon?: ReactNode, onActivate, isDisabled?, variant?: 'neutral' \"
  • FR2 [public-api@206]: "Item MUST render each side's panel from its entries into an out-of-flow position on its existing root and MUST add no element to the row for it. The gesture MUST drive the row's travel by writing a custom property on the root; the root's transform MUST read it and each panel's transform its negation."
  • FR3 [public-api@207]: "swipeBehavior MUST be one enum with the closed values reveal and commit, default reveal. commit with more than one entry on a side MUST warn in development, because the other entries have no touch path."
  • FR9 [public-api@208]: "The element containing swipe-capable rows MUST clip in the inline axis with overflow-inline: clip, never hidden. List MUST set it; Item's consumer documentation MUST state the obligation for any other host."

spec:AST-058

Path: docs/specs/AST-058-option-actions/spec.md; digest: c6b62f16eff00ba153ab0d7c2861d8f4b82766fc2c436e7f8ff9c72c24e8ef0c.

  • AR1 [accessibility@209]: "The tree is valid in both modes."
  • AR2 [accessibility@210]: "Names stay separate."
  • AR3 [accessibility@211]: "Every modality reaches the action."
  • AR4 [accessibility@212]: "Selection semantics are unchanged."
  • DEC-2 [accessibility@213]: "The host is a grid once an option carries an action"
  • DEC-3 [accessibility@214]: "Two fixed cells per row"
  • FR3 [behavior@215]: "In a grid, each option is one role=\"row\" carrying the option's id, aria-selected, and aria-disabled, with exactly two gridcell children for every row: the first holds everything the option renders today — selection mark or checkbox, icon, label, description, renderOption output — and the second holds its action node, empty when it declares none. Rows the component mints (select-all, a create row) are rows of the same shape with an empty action cell. No row has one cell or three."
  • FR4 [behavior@216]: "Activating an action runs the caller's own handler and nothing else: the selection does not change, the highlighted row does not change on its account, and the panel neither closes nor re-filters. Pressing the option cell selects or toggles exactly as it does today. An option's disabled governs its selection only; whether an action is disabled is the caller's control's own state, and the host does not read it."
  • FR5 [behavior@217]: "Up and Down move the highlight between rows as today, landing on the option cell; the inline-end arrow moves it from the option cell to the row's action cell, and the inline-start arrow moves it back, so the keys follow visual direction under RTL. Enter or Space on the option cell selects as today; Enter or Space on the action cell activates the control there. Typing to jump, Home, End, PageUp, PageDown, Escape and Tab keep their current meanings. No action control is in the sequential tab order."
  • FR6 [behavior@218]: "aria-activedescendant on the element that holds focus — the trigger, the search input, or the bottom-sheet panel — references the row while the highlight is on the option cell, and the action's control while it is on the action cell. It never references an element the person cannot act on."
  • FR7 [behavior@219]: "In a grid, a section is a rowgroup named by its title, with its heading hidden as today. Dividers and the "nothing matched" message stay out of the accessibility tree, as Selector and MultiSelector already keep them; BaseTypeahead's message, an option today, becomes presentational in every mode and is announced as spec:AST-056 AR1 requires. The popover and the bottom sheet render the same tree."
  • FR8 [behavior@220]: "An action is visible at rest on every input and every pointer type. The host places the caller's control in the action cell with the cell's size and alignment and paints nothing of its own over it. Nothing is revealed on hover, focus, or swipe."
  • DEC-1 [public-api@221]: "The action is one node on the option, because the host only places it"
  • DEC-4 [public-api@222]: "One key, one type, both option vocabularies; the typeahead family adopts through its one panel"
  • DEC-5 [public-api@223]: "The grid is conditional: detection reads the declared options and latches"
  • FR1 [public-api@224]: "An option carries its secondary control as action?: ReactNode, one node. The key has the same name and the same type on SelectorOptionData and on SearchableItem. The caller renders the control and owns its name, its handler, its disabled state, and its appearance; a caller with several verbs renders one menu trigger whose popup owns the rest. The host renders the node where FR3 says and MUST NOT inspect, clone, or wrap it to decide anything; checking that it is present (FR2) is not inspection. No host-owned type or component for an action exists."
  • FR2 [public-api@225]: "A popup is a listbox until a render in which any declared option — at any depth of sections, before any query filters it — carries an action that is not null or undefined; from that render it is a grid and stays a grid while the component is mounted. The control that owns the popup advertises the role in force through aria-haspopup (grid; the bottom sheet keeps dialog). A popup whose role followed the filtered view, or switched back, is a defect."
  • FR9 [public-api@226]: "Selector, MultiSelector, Typeahead, and Tokenizer adopt this contract; the last two through the one panel BaseTypeahead renders. A host that renders either option vocabulary in a listbox it owns and has not adopted MUST NOT render the action inside the option; until it adopts, it renders the option without the action and warns in development when an item carries one."

spec:AST-059

Path: docs/specs/AST-059-layer-viewport-inset/spec.md; digest: f638794dcd66ae5bd6dd206540a5efaf84dcf805e5ccc4e99b3375aa2f8e7b35.

  • FR2 [behavior@227, layout@234]: "The cap is the viewport, never the span."
  • FR4 [behavior@228, layout@236]: "One fallback order."
  • FR5 [behavior@229, layout@237]: "An off-screen anchor holds."
  • FR7 [behavior@230]: "Consumers inherit; a consumer's own size rule cannot defeat the cap."
  • FR8 [behavior@231, layout@239]: "The first frame is the settled frame."
  • DEC-2 [layout@232]: "A content-sized layer wraps if it can and moves if it cannot"
  • FR1 [layout@233]: "One gutter."
  • FR3 [layout@235]: "Placement-axis cap."
  • FR6 [layout@238, public-api@242]: "The app declares a floating bar once, on LayerProvider."
  • DEC-4 [public-api@240]: "An app's floating bar is app state, not a theme value"
  • DEC-5 [public-api@241]: "One declaration serves toasts and anchored layers; zero is the default"

@vercel

vercel Bot commented Oct 9, 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 16, 2026 5:08pm UTC

Request Review

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

astracat-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@rubyycheung
rubyycheung force-pushed the agent/ast054-direct-icon-adapter branch from a49f229 to fe71bc6 Compare October 9, 2026 02:59
@rubyycheung rubyycheung changed the title [WIP] feat(core): add typed direct-icon library adapters feat(core): add typed direct-icon library adapters Oct 9, 2026
@rubyycheung
rubyycheung marked this pull request as ready for review October 9, 2026 02:59
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

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

Thanks for the careful, well-documented draft — the opt-in design, atomic fallback to the supplied default, and preservation of ordinary direct icons and caller-owned props all read clearly.

Approval needs a maintainer spec decision first. Current Icon authority covers glyph source, size, color and accessibility, but does not yet establish a direct-icon adapter factory, its name/shape (including the optional output-key list), or its release lifecycle. Please have a maintainer provide or identify the governing spec for this addition and confirm how it should land with its stacked dependencies before this can be approved. No rewrite is being requested for that reason alone.

One additional item to address in parallel: the change is large for a single review (over two thousand authored lines, mostly tests and fixtures). Once the direction is settled, please either split independently reviewable parts or add a short justification showing why the production code, consumer harness and CLI bridge must land together.

No concrete break to ordinary icons, accessibility semantics or caller prop ownership was found in static review. The included tests were not rerun in this automated pass, so please rely on CI and owner verification for runtime confirmation.

[Automated review]

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

Approval is on hold for a maintainer decision: createIconAdapter and its types are a new public Icon API that no current spec admits yet, so a maintainer needs to provide or identify the governing spec, settling whether the factory is adopted, its name and curried shape, the propNames default and which output keys a mapper may return, its stable or experimental lifecycle, and the landing order with the stacked capability-engine work. Independently of that decision, two items need changes:

  • The shipped icons guide says a mapper cannot change color, accessibility or styles, but declared SVG attributes such as fill, visibility or display pass the allowlist and reach the rendered <svg>, so either describe the enforced boundary or reject those keys.
  • At 2,172 authored lines the change is over the 2,000-line review threshold, so once direction is settled please split independently reviewable parts (for example the CLI bridge or the consumer harness) or explain why they must land together.

[Automated review]

},
{
type: 'prose',
text: 'ProductIconImpl must support optional primitive glyphStyle and thickness props as well as SVGProps. The .js imports refer to the compiled modules. An adapter translates supported theme intent; it does not restructure the component or edit its SVG. For example, an Astryx duotone appearance maps only when the library exposes an equivalent variant such as weight="duotone"; the library still owns how the two tones are colored. If the library instead requires primaryColor and secondaryColor props, this adapter receives no theme color axis and must not invent those values. A mapper cannot change source selection, color, accessibility, events, refs, styles or children. Unsupported explicit appearance or weight warns once in development and points to createIconAdapter guidance; unsupported theme choices silently use the library default. Invalid mapping results safely render that default. Missing size support is normal fallback, not a warning. Consumer SVG, ref, event and styling props retain their normal precedence.',

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 promises more than the adapter enforces: declared SVG attributes such as fill, stroke, opacity, visibility or display pass the propNames allowlist and reach the rendered <svg>, so a mapper can repaint the glyph or hide a labelled icon. Either describe the enforced boundary here (Icon- and caller-owned props are rejected; declared drawing attributes pass through as declared) or reject those keys in the allowlist.

'appearance',
'weight',
]);
function isAllowedPropName(name: string): boolean {

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.

isAllowedPropName, like the public IconAdapterProps filter, rejects Icon- and caller-owned names but admits SVG presentation attributes (fill, stroke, opacity, visibility, display, transform, pointerEvents). If the guide's guarantee is intended, deny the paint, visibility and display keys here (keeping weight-style keys such as strokeWidth if libraries need them) and add a regression case; otherwise align the docs with this boundary.

@cixzhang cixzhang closed this Oct 22, 2026
@github-actions
github-actions Bot deleted the agent/ast054-direct-icon-adapter branch October 23, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — e3d22318 Deployed Oct 16, 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