Repository navigation
spec(AST-089): require outermost DOM styling target with exemptions - #6066
imdreamrunner wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
d1559ed to
29975e7
Compare
f603c06 to
dc40780
Compare
dc40780 to
a11489d
Compare
cixzhang
left a comment
There was a problem hiding this comment.
Builders of compound and portal-backed components would lose stable styling APIs because of hidden DOM plumbing. The existing contract puts accepted styling props on the documented contract element; Popover specifically owns them on its painted surface, while its trigger and positioned layer are separate. The proposed rule instead requires the outermost node or removal, so an inert measurement peer in OverflowList and Field wrappers in TextInput/MultiSelector become breaking API decisions. Please keep the guarantee on each documented contract element and preserve the current overlay/non-DOM exceptions rather than binding API to incidental DOM ancestry.
[Reviewed by Robohands]
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This proposal is well structured and honestly scoped as a draft, and its structural checks pass — but approval needs a maintainer decision first.
Waiting on a maintainer spec decision: the draft proposes that accepted style, className, and xstyle must target the outermost DOM element or be removed. Current authority instead puts those props on each component's documented contract element, and Popover's current contract specifically places them on its painted surface. A maintainer needs to provide or identify the governing spec decision that settles which rule wins — the outermost-element rule superseding the contract-element authority (with the affected current records updated and migrations chosen), or the contract-element guarantee preserved.
Three text fixes are also needed in the draft itself:
- Platform support excludes hooks, but the conflict inventory lists Popover /
usePopover— please settle whether a hook's surface is in scope. - The outermost root is defined as caller-facing in one requirement, while any peer root (including a hidden measurement element) disqualifies in another — please state whether non-caller-facing implementation roots count, and align the OverflowList row.
- The rationale says current rules do not require styling to reach a particular element; current authority does name a particular contract element per component — it just is not uniformly the outermost one.
No runtime behavior changes in this PR, so nothing here is urgent; the decision matters because promotion would drive breaking styling-target migrations across several stable components.
[Automated review]
a11489d to
3f16f3e
Compare
3f16f3e to
a0de08e
Compare
PR Analysis Report
|
There was a problem hiding this comment.
This draft is clearly scoped and passes the knowledge checks, but approval needs a maintainer decision first. spec:AST-089 makes the outermost owned element the default target for style, className and xstyle, which would replace the current architecture:public-component-api INV5 rule that sends them to each component's documented contract element. A maintainer needs to choose between this outermost-first default, with its E1–E22 and L1–L7 exemptions, and the ref-first alternative in #7931, and record that choice in the governing spec. Separately, please delete the two sentences that describe the draft's own status (lines 110–111 and 187 of the record), because they become false once the record is promoted.
[Automated review]
| not necessarily the outermost element. These current claims remain authoritative | ||
| while this record is draft. |
There was a problem hiding this comment.
"These current claims remain authoritative while this record is draft" describes this draft's status rather than the system, and it becomes false once the record is promoted. authority: draft in the frontmatter already says the record does not govern, so please delete the sentence (knowledge-contracts: "Describe the system in the present tense, not the project that produced it").
| `family:layout-primitives` owns its polymorphic member contracts; | ||
| `family:input-fields` owns its root-styling exclusion and part targets. Each | ||
| exempted component's owning contract and consumer docs state the retained target | ||
| and applicable paths. Current records are not rewritten by this draft. |
There was a problem hiding this comment.
"Current records are not rewritten by this draft" narrates this pull request rather than stating a fact about the system. Please delete it, as with lines 110–111.
|
(Posted by Cindy's agent.) Superseded by #7931, which records the styling target (the public ref element, else the outermost root) with the current exceptions. Thanks! |
Exact decision needed
Should accepted
style,className, andxstyletarget the component's unique outermost owned DOM element, with explicit compatibility exemptions for existing divergent targets?This is the outermost-first alternative. The separate ref-first alternative is PR #7931. Choose one; they are independent branches containing alternative versions of the same
spec:AST-089record, not a stack or two policies to merge together.Existing authority searched
architecture:public-component-apiINV5/INV6 preserve accepted styling on the documented contract element and composition; INV8 preserves the public ref target. Neither establishes a uniform outermost target.component:Popoverassigns consumer styling to the painted surface, not the positioning layer.family:input-fieldsFR10/DEC-7 forbids general root styling on Field-composed components and owns the namedcontainer*/control*targets. That current exclusion and its required migrations remain intact.family:layout-primitivesowns polymorphic member behavior;spec:AST-071owns complete named styling sets;spec:AST-017owns compatibility and release handling.TextInput.controlRef); fix(core): enforce VisuallyHidden's styling-free contract at runtime #7826 (VisuallyHidden's styling-free runtime). Neither is adopted or changed here.The canonical owner remains
architecture:public-component-api. This cross-component draft records the candidate target decision for that owner; it does not create parallel current authority. The original proposal'sAST-032identifier now belongs to the current upload/send icon specification, so it is preserved and this decision uses unoccupiedAST-089.Decision
Draft, pending explicit owner approval: every accepted general styling prop targets the same unique outermost component-owned DOM element. Owned hidden measurement peers, composed wrappers, and detached surfaces count; caller content and external portal hosts do not themselves count. Hooks are outside the standalone scope, but hook-backed components remain in scope.
Existing divergences are explicit component/path/target exemptions, not a forced migration prerequisite. They preserve only the stated target divergence, not unrelated dropped props, ref failures, or violations of existing current authority. New divergence paths cannot inherit an exemption by analogy. A component without a guaranteed target cannot introduce a new general styling API.
Semantic props and public refs keep their existing contract elements. Named part styling and the input family's root-styling exclusion are not rerouted or reversed.
Rejected alternatives
Claim scope and non-goals
Specification only. No runtime code, public types, ref targets, themes, component rendering, or Changeset changes. No component migration, new styling part, registry algorithm, or CI topology is prescribed.
authority: draft,phase: proposed, and approval fields remain unset; current records continue to govern.Evidence and implementation relationship
The two independent export walks agree on 615 runtime name/source identities. The source audit covers 205 exported component/provider names, 477 source-path records, and 555 pinned files byte-verified at the reviewed main baseline
0c1a6e860cb0b11d03767ee302c6d22ef0350e94, including 32 names absent from the CLI roster. The record includes scoped target-preservation exemptions and separate legacy accepted-styling-target enforcement exemptions. Fully empty renders are not exemptions by themselves; actual corrective portals are distinguished from contained/native top-layer surfaces. InputGroup's current FR10 scope tension is explicitly left for its owners.The branches are refreshed onto main
13df1cecf72ae1e4ed3787d7af59541d57532474. The three intervening palette-generation, Carousel-focus, and trigger-menu-announcement changes were inspected; they do not change the exported component inventory or styling/ref/root targets, so the exemption list remains current through that base.The exemption table is a compatibility contract, not an assertion that every current implementation conforms to every existing owner. Detailed discussion and audit evidence remain outside the standing record. A future promotion projects the selected default and exemption boundary into affected current architecture, family, component, contributing, and consumer surfaces together.
The refreshed text fixes the old review's three independent ambiguities: the current before-state names a documented contract element; hook scope is explicit; hidden/peer-root treatment is consistent.
Writing rubric results
Scope
Validation
pnpm check:knowledge— passed.git diff --check— passed.pnpm lint:strict— passed on this proposal.13df1cecf72ae1e4ed3787d7af59541d57532474: strict lint and full package build passed; 153 focused knowledge/lookup tests and 131 Carousel/ChatComposerInput tests passed. The newly landed changes do not alter the exemption inventory.pnpm buildand strict lint passed. Fullpnpm testrecorded 26,195 passing / 549 failing tests across 141 failed files, predominantly timeout/CLI-runner failures, before any proposal file was added. Representative isolated rerun: 65/65 passed. These are baseline evidence, not a claim that the full suite is green.No Changeset: specification only. No browser screenshots are required because nothing rendered or interactive changes; any future target migration owes its own relevant runtime and browser evidence.