Repository navigation
spec(AST-089): style the public ref element, otherwise the outermost root - #7931
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
26f8494 to
472e177
Compare
There was a problem hiding this comment.
This draft lays out the ref-first styling default clearly, but approval waits on an engineering owner's decision: FR1–FR5, FR7, DEC-1 and DEC-2 add requirements no current record states, and an engineering owner records that decision by commenting /approve-spec 472e177f405a6ad98549f924da2f185e0b3d1023 on this pull request (the author may do so if they are an engineering owner). Whichever way that goes, the record needs a refresh against current main:
- E6 and E7 do not cover the sheet presentations that
component:PopoverDEC-8 andcomponent:PowerSearchDEC-3 now specify, so FR7 would leave both paths unexempted. - Current-state impact should name
architecture:public-component-apiINV15 andspec:AST-071FR1, which describe the unprefixed styling set as the root's. - L7 should say VisuallyHidden's
xstyleis ignored, ascomponent:VisuallyHiddenFR3 now records. - FR1 should state that components bound by
family:input-fieldsFR10 are outside the default, including root styling they still accept until FR10 lands.
[Automated review]
| - **FR1 — Public DOM ref first.** A stable Core web component that accepts any of | ||
| `style`, `className`, or `xstyle` and exposes an unprefixed DOM `ref` MUST apply | ||
| every accepted general styling prop to the element promised by that ref's | ||
| public contract on every supported render path, except for the explicit | ||
| compatibility exemptions below. The target MAY be an inner control or a sole | ||
| detached surface; DOM ancestry does not override a valid public ref target. |
There was a problem hiding this comment.
FR1's only carve-out is the exemption tables. Field-composed components that still accept root styling until family:input-fields FR10 lands split it from their ref (that record's prop-target table: Selector styles the control box with base props on the trigger button; Slider styles Field with ref on the track), and none is listed, so FR1 read literally asks for their root styling on the ref element. Saying here or in FR6 that FR10-bound components are outside the default would close that.
| The canonical shared API owner is `architecture:public-component-api`, whose | ||
| INV5 and INV6 preserve styling on the documented contract element and composition, | ||
| and whose INV8 preserves the documented ref target. They do not require styling | ||
| and ref targets to be the same element. These current claims remain authoritative | ||
| while this record is draft. |
There was a problem hiding this comment.
INV5, INV6 and INV8 are not the only current claims involved: architecture:public-component-api INV15 and spec:AST-071 FR1 describe part sets as styling for elements other than the root, and INV6 and family:input-fields FR10 call the unprefixed set root styling inputs. FR1's inner-control target needs those named here as claims promotion amends.
| | E3 | Horizontal Stepper, expanded or compact | Horizontal frame `div` / ordered-list `ol` | Preserve frame styling and list measurement/ref identity; `component:Stepper`. Vertical list-target styling needs no target exemption. | | ||
| | E4 | Timestamp and Timer, supported rendered temporal states | Outer Text `span` / inner `time` | Preserve the existing temporal wrapper rather than moving general styles to `time`. `component:Timer` FR5/ORD2 and temporal component/shared API owners describe the seam; Timer's broader current timer-system wording remains an unresolved authority tension in OQ3. | | ||
| | E5 | ContextMenu and MoreMenu pointer/sheet paths | Inner menu/content `div` / trigger wrapper or trigger button | Existing general styles describe the menu, not its trigger. Shared API and menu owners retain that target; existing sheet ref-forwarding debt is not waived. | | ||
| | E6 | DropdownMenu pointer/sheet; Popover automatic/custom/external-anchor; HoverCard text/element/fragment-trigger paths | DropdownMenu inner menu `div`, Popover inner painted `div`, or HoverCard floating `div` / no unprefixed component ref | There is no unique outermost fallback across trigger, persistent template, host, and surface trees. Named/payload refs are not a component `ref`. `component:Popover` owns painted-surface styling; respective menu/HoverCard and shared API owners retain the other targets. | |
There was a problem hiding this comment.
component:Popover on main now has a presentation option (DEC-6), and DEC-8 says the sheet's panel takes xstyle, className and style. This row lists only the automatic, custom and external-anchor paths, so under FR7 the sheet path is an unlisted divergence.
| | E4 | Timestamp and Timer, supported rendered temporal states | Outer Text `span` / inner `time` | Preserve the existing temporal wrapper rather than moving general styles to `time`. `component:Timer` FR5/ORD2 and temporal component/shared API owners describe the seam; Timer's broader current timer-system wording remains an unresolved authority tension in OQ3. | | ||
| | E5 | ContextMenu and MoreMenu pointer/sheet paths | Inner menu/content `div` / trigger wrapper or trigger button | Existing general styles describe the menu, not its trigger. Shared API and menu owners retain that target; existing sheet ref-forwarding debt is not waived. | | ||
| | E6 | DropdownMenu pointer/sheet; Popover automatic/custom/external-anchor; HoverCard text/element/fragment-trigger paths | DropdownMenu inner menu `div`, Popover inner painted `div`, or HoverCard floating `div` / no unprefixed component ref | There is no unique outermost fallback across trigger, persistent template, host, and surface trees. Named/payload refs are not a component `ref`. `component:Popover` owns painted-surface styling; respective menu/HoverCard and shared API owners retain the other targets. | | ||
| | E7 | PowerSearch when the nested Tokenizer Field box renders | Nested Field box through Tokenizer's `container*` inputs / outer PowerSearch wrapper | Preserve the higher-level composition's current styling projection. Where the Field box is absent, the part has no effect and warns, never reroutes. `component:PowerSearch`, `component:Tokenizer`, and the input-family part contract; no root styling is added to Tokenizer. | |
There was a problem hiding this comment.
component:PowerSearch DEC-3 on main specifies a sheet presentation where ref reaches the root and the styling set reaches the field container, and records that family:input-fields FR10 now binds PowerSearch. This row covers only the nested Tokenizer Field box.
| | L4 | SideNav content-bearing drawer-content paths | All accepted general styling inputs and the public ref are dropped | Shared API INV5/INV6/INV8; a conditional footer root does not repair the loss. | | ||
| | L5 | TypeaheadItem's nonempty caller `item.element` path | Accepted general styling and public ref are not applied to the returned caller node | Shared API INV5/INV6/INV8; arbitrary caller output is not a guaranteed forwarder. | | ||
| | L6 | SegmentedControlItem | Accepted `className` is overwritten; dynamic StyleX output can overwrite the entire accepted inline `style` | Shared API INV5/INV6; this is lost styling, not a permissible split or precedence decision. | | ||
| | L7 | VisuallyHidden's accepted inherited `xstyle`, intrinsic and custom paths | `xstyle` is leaked/uninterpreted rather than applied to its ref element; `className` and `style` are not accepted | Shared API/AST-071 obligations and the styling-free intention require reconciliation; the exemption does not create styling support. | |
There was a problem hiding this comment.
On main, VisuallyHidden strips xstyle before spreading its props, and component:VisuallyHidden FR3 records it as ignored rather than leaked.
…the bound TopNavMenu drawer-header ref, and words Icon's split BottomSheetSwitcher applies its dialog surface to every step's sheet dialog, so it joins the target-preservation exemptions. TopNavMenu and TopNavMegaMenu drawer headers bind their ref, so L10 keeps only SideNav. Icon styles its span and binds its ref to the svg.
|
/approve-spec 7c17861 |
There was a problem hiding this comment.
The ref-first direction is owner-approved for this head, but the record still misdescribes or omits several current specs, so it needs these corrections before it lands:
- E6 and E7 do not cover the sheet presentations that
component:PopoverDEC-8 andcomponent:PowerSearchDEC-3 specify, so under FR7 their styling targets become unexempted divergences. - Current-state impact should name
architecture:public-component-apiINV15 andspec:AST-071FR1, which treat styling for a non-root element as a part set and change under FR1. - L7 should say VisuallyHidden's
xstyleis ignored, ascomponent:VisuallyHiddenFR3 records, rather than leaked. - FR1 or FR6 should state that components bound by
family:input-fieldsFR10 are outside the default, including the root styling they still accept until FR10 lands. - L8 should say Icon's ref reaches the svg (
component:IconFR8) and its styled wrapper is unpromised implementation (AV2), rather than calling the split Icon's current contract.
With the owners' choice made, OQ1 can collapse into DEC-1 under the writing rubric's R6.
[Automated review]
| | L5 | TypeaheadItem's nonempty caller `item.element` path | Accepted general styling and public ref are not applied to the returned caller node | Shared API INV5/INV6/INV8; arbitrary caller output is not a guaranteed forwarder. | | ||
| | L6 | SegmentedControlItem | Accepted `className` is overwritten; dynamic StyleX output can overwrite the entire accepted inline `style` | Shared API INV5/INV6; this is lost styling, not a permissible split or precedence decision. | | ||
| | L7 | VisuallyHidden's accepted inherited `xstyle`, intrinsic and custom paths | `xstyle` is leaked/uninterpreted rather than applied to its ref element; `className` and `style` are not accepted | Shared API/AST-071 obligations and the styling-free intention require reconciliation; the exemption does not create styling support. | | ||
| | L8 | Icon's registry-rendered path; CheckIndicator's checked-glyph path | Icon: styling reaches the rendered span and the public ref binds its svg (styling on the span, ref on the svg); CheckIndicator: styling reaches the rendered span, but the accepted public ref is not forwarded there | Exclusion from the new style/ref-identity proof only. Icon's split is its current contract, not a new span-ref promise; CheckIndicator's unforwarded ref is no INV8 waiver. Replacement/custom paths are separately scoped. | |
There was a problem hiding this comment.
component:Icon promises only the svg ref (FR8); AV2 says its internal wrapper is not public anatomy, and its anatomy "intentionally does not promise a span". FR7 also calls listed splits "not valid replacement contracts". Saying Icon's ref target is FR8's svg and its styled wrapper is unpromised implementation would keep L8 consistent with both.
| | L4 | SideNav content-bearing drawer-content paths | All accepted general styling inputs and the public ref are dropped | Shared API INV5/INV6/INV8; a conditional footer root does not repair the loss. | | ||
| | L5 | TypeaheadItem's nonempty caller `item.element` path | Accepted general styling and public ref are not applied to the returned caller node | Shared API INV5/INV6/INV8; arbitrary caller output is not a guaranteed forwarder. | | ||
| | L6 | SegmentedControlItem | Accepted `className` is overwritten; dynamic StyleX output can overwrite the entire accepted inline `style` | Shared API INV5/INV6; this is lost styling, not a permissible split or precedence decision. | | ||
| | L7 | VisuallyHidden's accepted inherited `xstyle`, intrinsic and custom paths | `xstyle` is leaked/uninterpreted rather than applied to its ref element; `className` and `style` are not accepted | Shared API/AST-071 obligations and the styling-free intention require reconciliation; the exemption does not create styling support. | |
There was a problem hiding this comment.
On main, VisuallyHidden strips xstyle before spreading its props, and component:VisuallyHidden FR3 records it as ignored rather than leaked.
…tions, names the claims promotion amends, and collapses OQ1 E6 and E7 add the sheet paths of component:Popover DEC-8 and component:PowerSearch DEC-3. FR6 puts input-fields FR10 components outside the default. Current-state impact names public-component-api INV15 and AST-071 FR1. L7 says VisuallyHidden ignores xstyle; L8 says Icon's ref reaches the svg and its wrapper is unpromised. OQ1's choice moves into DEC-1.
|
/approve-spec 0b36a6b |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The ref-first default is owner-approved for this head, and every correction from the previous review is in: E6 and E7 cover the Popover and PowerSearch sheet presentations, Current-state impact names the claims promotion amends, FR6 puts FR10-bound components outside the default, and L7 and L8 now match the VisuallyHidden and Icon records.
- The description still says outermost-first is not rejected by this draft and reports R4 and R6 for the record before OQ1 was folded into DEC-1; updating those lines keeps the description in step with the record.
#6066 carries the outermost-first version of the same spec:AST-089 record, so it should not also land.
[Automated review]
Exact decision needed
Should accepted
style,className, andxstyletarget the component's public DOM ref element by default, using its unique outermost owned DOM element only when the public API exposes no unprefixed ref?This is the ref-first alternative to #6066. Both PRs are independent branches containing alternative versions of the same
spec:AST-089record. Choose one; do not merge both.Existing authority searched
architecture:public-component-apiINV5/INV6 preserve styling on the documented contract element and composition; INV8 preserves the public ref target. It does not require style/ref identity.component:Popoverowns the existing painted-surface styling contract.family:input-fieldsFR10/DEC-7 forbids root styling on Field-composed components and ownscontainer*/control*. A native input ref does not authorize root styling there.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). NamedcontrolRefdoes not select this proposal's default and those PRs are not adopted here.The canonical owner remains
architecture:public-component-api. This cross-component draft records a candidate decision for that owner, not parallel current authority.AST-032remains the existing upload/send icon specification; both styling alternatives useAST-089.Decision
Draft, pending explicit owner approval: every accepted general styling prop reaches the element promised by the unprefixed public DOM
ref. If and only if the API exposes no unprefixed ref, it reaches the unique outermost owned DOM root.“No ref” is an API condition, not a caller omitting
ref, passingnull, or observingref.current === null. Callback/object refs, mounting, and closed surfaces never move styling. Internal and named part refs do not choose the target. An imperative, ambiguous, or exposed-but-dropped ref is not an absent ref and cannot silently activate fallback.Existing divergences are explicit component/path/style-target/ref-target exemptions. They preserve only the stated default-target divergence, not unrelated forwarding defects or existing authority violations. New divergence paths do not inherit them. Named parts, semantic targets, and the current input-family root-styling prohibition stay intact.
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 style/ref target-preservation exemptions and separate legacy styling/ref-identity enforcement exemptions. Fully empty renders are not exemptions by themselves. InputGroup's current FR10 scope tension and Timer's conflicting current wrapper/root claims remain explicit owner questions.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 a waiver of implementation debt under an already-current owner. Detailed discussion and source audit remain outside the standing record. Ref API changes also need styling compatibility review when they would change the default target. Promotion projects the selected rule and exemption boundary into affected current owner surfaces together.
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.