Skip to content

Block overloaded public inputs in AST-002 - #5824

Merged
cixzhang merged 1 commit into
mainfrom
docs/ast002-overloaded-inputs
Sep 1, 2026
Merged

Block overloaded public inputs in AST-002#5824
cixzhang merged 1 commit into
mainfrom
docs/ast002-overloaded-inputs

Conversation

@cixzhang

@cixzhang cixzhang commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

A public input can appear to expose one axis while controlling additional axes for selected values, forcing consumers to know implementation branches and conditional override rules.

Semantic before → after

Before: AST-002 rejected derivable or unclear public choices but did not explicitly prohibit one input from changing which axes it controls across values or shapes. After: every public input has one stable caller-owned meaning; a cohesive semantic status or variant may still derive multiple visual details, while independently owned axes and any override precedence must be explicit and conflict-safe.

Example

TableRowStatus.color currently controls tone alone for palette/raw values, but controls tone plus a default themed icon for success | warning | error; optional icon then conditionally overrides representation. The amendment rejects that shape pending a canonical component:Table contract without prescribing its replacement.

Risk

Documentation and review policy only. Existing released APIs are evaluated when touched, not automatically broken. The staged exception for missing current authority remains unchanged.

Testing

  • pnpm exec prettier --check docs/specs/AST-002/spec.md docs/contributing/api-conventions.md
  • pnpm check:knowledge -- --base origin/main
  • pnpm exec vitest run scripts/check-knowledge.test.mjs (60 passed)
  • pnpm check:repo
  • public-hygiene scan of the changed documentation

No Changeset: no published package behavior changes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 1, 2026
@vercel

vercel Bot commented Sep 1, 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 Sep 1, 2026 2:52pm UTC

Request Review

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 1, 2026
@cixzhang

cixzhang commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 77f4e79

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Sep 1, 2026
github-actions Bot added a commit that referenced this pull request Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox were not published for this CI run.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | View full report

@cixzhang
cixzhang marked this pull request as ready for review September 1, 2026 16:36
@cixzhang

cixzhang commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 77f4e79

@cixzhang
cixzhang merged commit 40e0c6f into main Sep 1, 2026
28 checks passed
@github-actions
github-actions Bot deleted the docs/ast002-overloaded-inputs branch September 2, 2026 06:27
freddymeta added a commit that referenced this pull request Sep 2, 2026
… connector short of the indicator (#5495)

* feat(Stepper): --step-connector-gap, so a theme can stop the connector short of the indicator

Squashed to one commit: the branch had eleven, five of them merges from
main, and the net change is five files.

The on-track layouts draw the connector as one segment either side of the
node. A theme wanting a hole around the indicator had to reach the two
segments separately, and they differ only by sibling position — which
changes with indicator="none". One public var does it instead.

Addressing the review:

ROOT-OWNED. The default is declared once on the Stepper root, not on each
connector. Per-connector, every connector re-declared 0px on itself, and
a declared value beats an inherited one — so the generated `stepper`
override compiled cleanly and changed nothing. Verified through the
built-theme path: an override on `.astryx-stepper` in @layer astryx-theme
now moves the paint.

ONE DECLARATION FOR BOTH LAYERS. The gap has to reach the track (the
segment's own background) and the fill (an absolutely placed ::before).
Padding on each meant two declarations on two boxes, so a percentage
resolved against a different containing block for each and stopped them
~1.2px apart. A single clip-path: inset() on the segment clips element
and pseudo-element together against one reference box.

That also answers #5824, which landed after the review: a public input
must hold one stable meaning across its FULL value domain and every
accepted input shape. "Documented as a length, percentage bounded but
imprecise" does not meet that bar. Clipping does — every value behaves
the same way on both layers.

SAFE BOUNDS. Measured by reading painted pixels down a 12px segment:

  6px    -> 6px clipped        1rem  -> capped 8px
  -4px   -> 0 (invalid inset)  999px -> capped 8px
  10%    -> 1px               50%   -> capped 6px

Stepper height unchanged in every case; clipping cannot affect layout, so
the node the segment positions cannot move.

NO INDICATOR, NO GAP. indicator="none" renders no node, so a gap there
punches a hole in a track meant to be continuous.

8600 core tests, check:repo green, lint and tsc clean.

* fix(Stepper): mirror the connector clip under RTL, and add the record that owns the gap

Rebased onto the clip-path revision. Two things it still needed.

**RTL.** `clip-path: inset()` is physical — top/right/bottom/left, no logical
form — but the horizontal row reverses under `dir="rtl"`. Unflipped, the
leading segment sits to the RIGHT of the node in RTL and still clipped its
right edge, so the hole opened at the join between steps instead of at the
indicator. Measured before: `con0 x=622` against `indicator x=606`, clipping
its right edge. After: clips its left edge, LTR unchanged. The block axis
needs no handling; `dir` does not reverse it.

**The owning record.** `spec:AST-002` FR12 rejects a public-API addition whose
canonical owning record is missing, and component-local semantics belong in
the component spec. Stepper had none. `Stepper.spec.md` (draft) now carries
DEC-1 with the admission argument INV10/INV11 require, measured rather than
asserted: a theme target reaches the element and never its `::before`, so
`paddingBlock: 6px` on `step-connector` produces no hole at all and only grows
the Stepper 108px -> 120px. Plus the value contract and the anatomy map.

`Stepper.doc.mjs` gains the anatomy entries `stepper`, `step` and
`step-connector` never had, so every current target is anchored to a described
part (INV2). Connector is one part with one target; the pieces the on-track
layout draws it from stay implementation.

Also corrects the clamp rationale, which measurement contradicted: a negative
`inset()` is ACCEPTED by Chromium — `inset(0 0 -4px 0)` computes as written —
which is the opposite of padding, where CSS clamps it for you. The floor is
therefore load-bearing here, but not because the declaration would be dropped.

* test(Stepper): prove connector gap theme path

* docs(Stepper): ratify connector gap contract

---------

Co-authored-by: freddytan <freddytan@41831.od.fbinfra.net>
Co-authored-by: freddymeta <freddymeta@users.noreply.github.com>
Co-authored-by: freddymeta <170298698+freddymeta@users.noreply.github.com>
Co-authored-by: Cindy Zhang <cindyxz@meta.com>
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.

1 participant