Skip to content

spec(AST-089): require outermost DOM styling target with exemptions - #6066

Closed
imdreamrunner wants to merge 1 commit into
mainfrom
spec/outermost-dom-style-props
Closed

imdreamrunner wants to merge 1 commit into
mainfrom
spec/outermost-dom-style-props

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Should accepted style, className, and xstyle target 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-089 record, not a stack or two policies to merge together.

Existing authority searched

  • architecture:public-component-api INV5/INV6 preserve accepted styling on the documented contract element and composition; INV8 preserves the public ref target. Neither establishes a uniform outermost target.
  • component:Popover assigns consumer styling to the painted surface, not the positioning layer.
  • family:input-fields FR10/DEC-7 forbids general root styling on Field-composed components and owns the named container* / control* targets. That current exclusion and its required migrations remain intact.
  • family:layout-primitives owns polymorphic member behavior; spec:AST-071 owns complete named styling sets; spec:AST-017 owns compatibility and release handling.
  • Overlapping open work inspected: this proposal; feat(TextInput): add controlRef, a ref to the bordered control box #7690 (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's AST-032 identifier now belongs to the current upload/send icon specification, so it is preserved and this decision uses unoccupied AST-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

  • Blanket component-selected targets as the default: keep explicit established exceptions, but do not require new consumers to inspect arbitrary anatomy.
  • Immediate wrapper insertion, target migration, or prop removal for every existing divergence: incompatible consumer changes remain separately owned work.
  • Ref-first is a separate candidate, not a decision rejected by this draft; see PR #7931.

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

  • R1 narration: replaced proposal/history language with present-tense target, exception, and compatibility requirements; the before/after explanation stays here.
  • R2 research in the record: the comparison and source audit stay outside the record; its table specifies only retained compatibility targets and their scope.
  • R3 evidence naming a change: verification names element identity, public types, owning contracts, and compatibility evidence rather than a PR or commit.
  • R4 rejected alternatives over one line or outside a decision: two one-line guardrails, each inside its decision.
  • R5 pull request or issue references remaining: none in the record.
  • R6 ruled open questions still listing options: the completed inventory question is removed; the genuinely open default-selection decision remains.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Verification states evidence layers and failure signals without CI topology.
  • It records one target decision, including its inseparable compatibility boundary.
  • Canonical ownership, affected current claims, and overlapping work are named.
  • Adjacent API, visual, accessibility, and implementation behavior stays outside scope.
  • Public text contains no private operational context.

Validation

  • pnpm check:knowledge — passed.
  • Prettier and git diff --check — passed.
  • pnpm lint:strict — passed on this proposal.
  • Focused knowledge and record-lookup tests — 153 passed.
  • Independent semantic/spec-writing review; initial and final table corrections incorporated, including empty-render semantics, directly-DOM-valued-ref boundaries, and Table's retained semantic-table identity.
  • Refreshed-base checks at 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.
  • Unmodified source baseline: full pnpm build and strict lint passed. Full pnpm test recorded 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.

@vercel

vercel Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 22, 2026 5:37pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 5, 2026
@imdreamrunner
imdreamrunner force-pushed the spec/outermost-dom-style-props branch from d1559ed to 29975e7 Compare September 5, 2026 04:11
@imdreamrunner
imdreamrunner force-pushed the spec/outermost-dom-style-props branch 3 times, most recently from f603c06 to dc40780 Compare September 5, 2026 04:17
@imdreamrunner
imdreamrunner force-pushed the spec/outermost-dom-style-props branch from dc40780 to a11489d Compare September 8, 2026 04:12
@imdreamrunner
imdreamrunner marked this pull request as ready for review September 8, 2026 04:12
@github-actions github-actions Bot added the spec-auto-merge Auto-merge was enabled by the spec owner gate label Sep 8, 2026

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

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]

@astracat-bot

astracat-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 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]

@imdreamrunner
imdreamrunner force-pushed the spec/outermost-dom-style-props branch from 3f16f3e to a0de08e Compare October 22, 2026 17:27
@imdreamrunner imdreamrunner changed the title docs(spec): require outermost DOM styling target spec(AST-089): require outermost DOM styling target with exemptions Oct 22, 2026
@github-actions

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.

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]

Comment on lines +110 to +111
not necessarily the outermost element. These current claims remain authoritative
while this record is draft.

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.

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

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.

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

@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

(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!

@cixzhang cixzhang closed this Nov 6, 2026
@github-actions
github-actions Bot deleted the spec/outermost-dom-style-props branch November 7, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — a0de08e3 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants