Repository navigation
architecture(public-component-api): four API-shape principles (INV18–INV21) - #8459
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression55 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 35 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
|
Posted by Cindy's agent on her behalf. Cindy's decision (2026-10-25): approve. Public APIs compose along the anatomy (INV18), weigh resource cost against the feature (INV19), prefer variants over visual-only booleans (INV20), and add no second API for a job one already does unless the existing one is being deprecated (INV21). |
|
/approve-spec ce5e324 |
There was a problem hiding this comment.
Changes requested: the four principles are owner-approved for this head, but two fixes are needed before merge.
- INV18's "slots must have components" and its verification row conflict with the AST-058 spec's option
actionnode, which has no component of its own, and with the AST-057 spec's declaredswipeActionsdata, so please state how INV18 relates to those specs or amend them in this PR. - INV19 still says "Proposed; pending owner decision." and the four new verification rows still say "(proposed)", so please remove those markers and update the PR title and description to match the approval.
A new commit resets the spec-owner approval, so an engineering owner (the author included) then re-approves by commenting /approve-spec <full head SHA>.
[Automated review]
| to compose or render a slot not described in the anatomy; and slots must have | ||
| components. This extends INV3's rule that a parent does not duplicate a |
There was a problem hiding this comment.
"slots must have components" fails shapes that current specs require, and so does this invariant's verification row ("a slot without its own component", "A prop that selects or configures a subcomponent's prop or label"):
- AST-058 FR1 gives an option its control as
action?: ReactNodeand says "No host-owned type or component for an action exists". - AST-057 FR1 declares
Item.swipeActionsentries withlabel,iconandvariant, and says "An entry MUST NOT carry a node the component renders as the control".
Please state how INV18 relates to these records, or amend them in this PR. One option is AST-058 DEC-1's principle: an object where the component renders the thing, a node where it only places it.
| - **INV19 — Resource cost is weighed against the feature.** **Proposed; | ||
| pending owner decision.** Balance resource load against feature |
There was a problem hiding this comment.
INV19 still carries the pending marker, although the owner decision approves INV18–INV21; the approval commit removed it from the other three only. Please delete "Proposed; pending owner decision." here.
| | INV18 (proposed) | Public-API review against the component's anatomy table | A prop that selects or configures a subcomponent's prop or label, a composition that renders a slot the anatomy does not describe, or a slot without its own component | | ||
| | INV19 (proposed) | Public-API review with a bundle and runtime cost note for a costly feature | A feature with a large resource cost that every caller pays with no plug-in path or named feature prop | | ||
| | INV20 (proposed) | Public-API review of new boolean props | A boolean whose only effect is a visual swap where a variant fits | | ||
| | INV21 (proposed) | Public-API review against existing props, components, hooks, and factories | A new API that shares a job with an existing one that is not being deprecated in its favor | |
There was a problem hiding this comment.
These four rows still say (proposed). Please drop the labels, together with the INV19 marker.
ce5e324 to
6f1c557
Compare
There was a problem hiding this comment.
Recommending approval: INV18–INV21 are owner-approved for this head, and both points from the earlier automated review are fixed (the leftover proposed markers are gone, and INV18 now leaves the released swipeActions data and option action node to INV9). Three optional follow-ups: add INV18–INV21 to the record's public-api review-applicability list so the review-baseline helper returns them, say in INV18 whether a slot's own component must be an Astryx component (AST-056's emptySearchText: ReactNode depends on that reading), and note under Known verification gaps that most components do not document an anatomy yet.
[Automated review]
| platform (`spec:AST-012` FR9). It keeps no compact numbers of its own, as | ||
| INV14 keeps no parallel breakpoint table. A layout width the caller picks, | ||
| such as AppShell's `mobileNav.breakpoint`, follows INV14 instead. | ||
| - **INV18 — Compose along the anatomy.** Avoid props that reach deep into a component's anatomy (e.g. |
There was a problem hiding this comment.
Optional: INV18–INV21 aren't in this record's review-applicability:v1 block, which still routes only INV1–INV9, INV12 and INV16 under public-api, so scripts/review-global-baselines.mjs --triggers public-api won't return them. They still reach reviews through applies_to and component links. Adding the four ids to the list, as was done for INV16, would make the helper surface them too.
| - **INV18 — Compose along the anatomy.** Avoid props that reach deep into a component's anatomy (e.g. | ||
| picking a specific prop or label of a subcomponent). Build compositions | ||
| instead. Compositions must follow the component's anatomy; never expose a way | ||
| to compose or render a slot not described in the anatomy; and slots must have |
There was a problem hiding this comment.
Optional: could INV18 say whether a slot's component must be a dedicated Astryx component or can be any component the caller passes in? Under the first reading, AST-056 FR1's emptySearchText ("accepting ReactNode") would fail the INV18 row on any component that adopts it from now on, and the released-API clause wouldn't cover that.
| | INV15 | Public-API review of the generated declaration inventory | A part or StyleX-typed styling prop ships without class-name and inline-style counterparts on the same element | | ||
| | INV16 | Public-API review of touch presentations plus coarse- and fine-pointer runtime tests | A stable component that presents a different surface or switches an open surface's input mode under a coarse pointer and has no `presentation` value that keeps its fine-pointer surface and mode; such a touch mode callers cannot reach; a default that overrides an explicit caller choice | | ||
| | INV17 | Resolver tests at the compact edges plus public-API review | A component that chooses a presentation by screen size with its own numbers, or disagrees with the theme compact definition at width 768 or height 500 | | ||
| | INV18 | Public-API review against the component's anatomy table | A prop that selects or configures a subcomponent's prop or label, a composition that renders a slot the anatomy does not describe, or a slot without its own component | |
There was a problem hiding this comment.
Optional: usage.anatomy is optional in the component doc type and most core component docs don't have one yet, so this row's evidence often won't exist until the proposal adds it. That may deserve a line under Known verification gaps, which says gaps are named "rather than treating partial checks as complete proof".
|
Posted by Cindy's agent on her behalf. Cindy's decision on INV18 (compose along the anatomy): config objects are fine. Plain data that describes actions or options, such as This sentence replaces the earlier one saying released APIs that predate INV18 keep their shape. AST-058's option |
6f1c557 to
ab50951
Compare
There was a problem hiding this comment.
This waits on an owner decision: INV18–INV21 are new requirements in architecture:public-component-api, and no engineering owner has approved them at the current head, because the recorded /approve-spec names an earlier commit and spec-owner-approval is pending. Once the wording is final, an engineering owner records the decision by commenting /approve-spec <full head SHA>, and the author may do this as an engineering owner. Before that, please align INV18's verification row and its review smell with the clarified INV18 text: "a slot without its own component" and "a slot has no component of its own" still fail the picker option's action node, which the AST-058 spec gives no component of its own, although INV18 now says the caller fills a rendered content slot with a component.
[Automated review]
| | INV15 | Public-API review of the generated declaration inventory | A part or StyleX-typed styling prop ships without class-name and inline-style counterparts on the same element | | ||
| | INV16 | Public-API review of touch presentations plus coarse- and fine-pointer runtime tests | A stable component that presents a different surface or switches an open surface's input mode under a coarse pointer and has no `presentation` value that keeps its fine-pointer surface and mode; such a touch mode callers cannot reach; a default that overrides an explicit caller choice | | ||
| | INV17 | Resolver tests at the compact edges plus public-API review | A component that chooses a presentation by screen size with its own numbers, or disagrees with the theme compact definition at width 768 or height 500 | | ||
| | INV18 | Public-API review against the component's anatomy table | A prop that selects or configures a subcomponent's prop or label, a composition that renders a slot the anatomy does not describe, or a slot without its own component | |
There was a problem hiding this comment.
This row's last clause, "a slot without its own component", keeps the wording INV18's text replaced: INV18 now says the caller fills a rendered content slot with a component. Read as written, it fails the picker option's action node, which the AST-058 spec gives no component of its own ("No host-owned type or component for an action exists"). Could the clause read "or a rendered content slot that is not a part named in the anatomy", or go, since the second clause already covers a slot the anatomy does not describe?
| clobbered by spread order. | ||
| - A parent wraps slot content or mirrors props that belong to the slotted child. | ||
| - A prop reaches into a subcomponent's anatomy, a composition renders a slot | ||
| the anatomy does not describe, or a slot has no component of its own |
There was a problem hiding this comment.
Same wording as INV18's verification row: "a slot has no component of its own" fails the AST-058 option action node that INV18's text now accepts. Worth changing together with the row.
|
/approve-spec 92a05dc |
There was a problem hiding this comment.
Changes requested: INV18–INV21 are owner-approved for this head, but INV18 now applies to shipped components and the record doesn't say which ones don't meet it yet. PowerSearch (startIcon, endContent), SideNav (topContent, footer, footerIcons) and the picker option action render content slots their anatomy doesn't name, so please add a Known verification gaps entry for them (they conform by naming the part, with no API change), and consider saying that INV18's anatomy is the component's usage.anatomy[]. A new commit resets the spec-owner approval, so an engineering owner, the author included, then re-approves by commenting /approve-spec <full head SHA>.
[Automated review]
| | INV15 | Public-API review of the generated declaration inventory | A part or StyleX-typed styling prop ships without class-name and inline-style counterparts on the same element | | ||
| | INV16 | Public-API review of touch presentations plus coarse- and fine-pointer runtime tests | A stable component that presents a different surface or switches an open surface's input mode under a coarse pointer and has no `presentation` value that keeps its fine-pointer surface and mode; such a touch mode callers cannot reach; a default that overrides an explicit caller choice | | ||
| | INV17 | Resolver tests at the compact edges plus public-API review | A component that chooses a presentation by screen size with its own numbers, or disagrees with the theme compact definition at width 768 or height 500 | | ||
| | INV18 | Public-API review against the component's anatomy table | A prop that selects or configures a subcomponent's prop or label, a composition that renders a slot the anatomy does not describe, or a rendered content slot that is not a part named in the anatomy | |
There was a problem hiding this comment.
INV18 has no clause for released slot shapes, so this row already fails shipped components: PowerSearch's startIcon and endContent (PowerSearch documents no usage.anatomy at all) and SideNav's topContent, footer and footerIcons (its anatomy names only three other parts), besides the picker option action that #8477 covers. Could Known verification gaps below list them, the way it lists the passthrough lint's known violations, and say they conform by naming the part, with no API change? Naming usage.anatomy[] as the anatomy this row reads would also settle Spinner, IconButton and SideNavItem, whose slots appear only in their contracts' design tables.
92a05dc to
097eff4
Compare
|
/approve-spec 097eff4 |
There was a problem hiding this comment.
Changes requested: INV18–INV21 are owner-approved for this head, but the new INV18 Known verification gaps entry names only PowerSearch, SideNav and the picker option, while other shipped content slots miss INV18 the same way. Please word the entry as examples of a general gap (for instance "shipped Core components still render content slots their anatomy does not name, such as …") or extend the list. A new commit resets the spec-owner approval, so an engineering owner, the author included, then re-approves by commenting /approve-spec <full head SHA>.
- Tokenizer's
startIcon, the slot PowerSearch forwards its ownstartIconto, is named in neither Tokenizer'susage.anatomynor its contract. - DropdownMenu's
headerandfooterare not among its 17 anatomy parts. - Step's
endContent, Tab'sicon,selectedIconandendContent, and theheaderEndContentof SideNavHeading and TopNavHeading are unnamed as well.
[Automated review]
| - INV18: PowerSearch's `startIcon` and `endContent`, SideNav's `topContent`, | ||
| `footer`, and `footerIcons`, and the picker option's `action` render content | ||
| slots their anatomy does not name yet; each conforms by naming the part, | ||
| with no API change. |
There was a problem hiding this comment.
This reads as INV18's full list of shipped gaps, but other shipped content slots miss INV18 the same way: Tokenizer's startIcon (packages/core/src/Tokenizer/Tokenizer.tsx:149), which PowerSearch's listed startIcon is forwarded to, is named in neither Tokenizer's usage.anatomy nor its contract; DropdownMenu's header and footer (DropdownMenu.tsx:451, :456) are not among its 17 anatomy parts; Step's endContent, Tab's icon, selectedIcon and endContent, and the headerEndContent of SideNavHeading and TopNavHeading are unnamed as well. Could this say "shipped Core components still render content slots their anatomy does not name, such as …", or list them all?
097eff4 to
3f6b916
Compare
|
/approve-spec 3f6b916 |
There was a problem hiding this comment.
Changes requested: INV18–INV21 are owner-approved for this head, but INV18's prop clause and its verification row fail props that current component records specify, such as TopNavMegaMenuFeaturedCard's linkLabel and linkHref (FR3) and TopNavHeading's logoLabel (ORD1), while the Known verification gaps entry covers content slots only. Please either scope the prop clause and its row to new props, as INV20's row and INV21 already do, or add a Known verification gaps line for shipped props that configure a subcomponent's label or props, noting that they conform only through replacement under INV9. A new commit resets the spec-owner approval, so an engineering owner, the author included, then re-approves by commenting /approve-spec <full head SHA>.
[Automated review]
| | INV15 | Public-API review of the generated declaration inventory | A part or StyleX-typed styling prop ships without class-name and inline-style counterparts on the same element | | ||
| | INV16 | Public-API review of touch presentations plus coarse- and fine-pointer runtime tests | A stable component that presents a different surface or switches an open surface's input mode under a coarse pointer and has no `presentation` value that keeps its fine-pointer surface and mode; such a touch mode callers cannot reach; a default that overrides an explicit caller choice | | ||
| | INV17 | Resolver tests at the compact edges plus public-API review | A component that chooses a presentation by screen size with its own numbers, or disagrees with the theme compact definition at width 768 or height 500 | | ||
| | INV18 | Public-API review against the component's anatomy table | A prop that selects or configures a subcomponent's prop or label, a composition that renders a slot the anatomy does not describe, or a rendered content slot that is not a part named in the anatomy | |
There was a problem hiding this comment.
This row fails props that current component records specify: TopNavMegaMenuFeaturedCard FR3 (linkLabel and linkHref on the LinkProvider link) and TopNavHeading ORD1 (logoLabel, the logo link's name). INV18 has no clause for released shapes, and the gaps entry below covers content slots only, so a review that touches those props meets two current records that disagree. Could the prop clause and this row say "a new prop that selects or configures…", as INV20's row and INV21 do, or could Known verification gaps name the shipped props and their path through INV9?
…my, weigh resource cost, variants over visual booleans, one API per job (INV18–INV21)
…NV18 leaves released slot shapes to INV9
… rendered content slots
…h the clarified slot rule
… not yet in their anatomy
…downMenu slots and say no full inventory exists
…ent-configuring props
3f6b916 to
d1e5f6a
Compare
|
/approve-spec d1e5f6a |
There was a problem hiding this comment.
Recommending approval: INV18–INV21 are owner-approved for this head, and the new Known verification gaps line naming linkLabel, linkHref and logoLabel settles the earlier request. Two optional follow-ups: say in INV18 what separates a node field inside plain data, such as a swipe action's icon, from a rendered content slot, such as the picker option's action, and describe swipeActions as an object of two arrays rather than an array.
[Automated review]
| picking a specific prop or label of a subcomponent). Build compositions | ||
| instead. Compositions must follow the component's anatomy; never expose a way | ||
| to compose or render a slot not described in the anatomy; and slots must have | ||
| components. Config objects are fine: plain data that describes actions or options (for example `swipeActions`' array of `{label, icon, onActivate}`) is not a slot. 'Slots must have components' applies to rendered content slots, places that accept arbitrary nodes; such a slot must be a part named in the component's anatomy, and the caller fills it with a component. This extends INV3's rule that a parent does not duplicate a |
There was a problem hiding this comment.
Optional: this example's icon is a ReactNode inside plain data, while the gaps below list the picker option's action?: ReactNode, also a node inside option data, as a rendered content slot. One sentence on what separates them, for example the AST-058 principle that the component declares data for a control it renders and takes a node for one it only places, would let a reviewer classify the next node field without guessing. swipeActions is also {leading?, trailing?}, two arrays of these entries, not one array.
Decided (Cindy, 2026-10-25 15:59: "8459 approve"). Four API-shape principles in her wording.
Exact decision needed
Should
architecture:public-component-apiadd these four principles as INV18–INV21?Existing authority searched
architecture:public-component-apiINV2 (names), INV3 (one prop, one concept; no duplicated child state), INV4 (caller-owned intent), INV9 (deliberate change), INV15 (part styling), INV16 (onepresentationprop).architecture:component-theming-surface(slot styling);docs/contributing/api-conventions.md(Slots and composition; Open visual vocabularies; Common review smells).Decision
architecture:public-component-api, wording as given:collapsible).api-conventions.md's Common review smells gains one entry per principle.These are API-shape rules, so they belong in this architecture record.
Rejected alternatives
Writing rubric results
Scope
Validation
pnpm check:knowledge(CI lint)git diff --check