Skip to content

[Component Audit] Divider: keep numeric labels visible and named - #7572

Merged
cixzhang merged 1 commit into
mainfrom
night-watch-component-audit/Divider/2026-10-15
Oct 15, 2026
Merged

cixzhang merged 1 commit into
mainfrom
night-watch-component-audit/Divider/2026-10-15

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

User impact

People who use a numeric label such as 0 now get one visible label and the separator is named 0; previously the value escaped both label branches as two anonymous text nodes. Boolean or empty-string labels now leave one continuous unnamed rule instead of empty label spacing.

Audit scope

  • Package/component: core/Divider
  • Mode: Night Watch whole-component audit
  • Rubric: 1.16.6
  • Audit base: 9025ab3434c5489570d0a355d04bc1be6026406d
  • Frozen repository and draft component-contract head: eac8e2516cd4747a08405a368fc66affb8908a46
  • Public API: unchanged

Authority

  • architecture:public-component-api/INV5–INV9 — accepted ReactNode content and root inputs remain observable and compatible.
  • architecture:component-theming-surface/INV4,INV6,INV14 — an open visual axis requires a visible deterministic fallback, but the current target/inner-rule ownership does not settle how to add it safely.
  • architecture:container-padding/INV1,INV3,INV7–INV10 — full bleed consumes only inherited logical inset.
  • WCAG 2.2 SC 1.3.1 and 4.1.2 through spec:AST-020/FR1 — rendered separator orientation and name remain programmatically available.
  • spec:AST-029/FR3–FR10 — observational contract backfill, closed evidence inventory, objective remediation, and exact-head eligibility report.

Before and after score

Section Weight Before After Evidence
§1 Accessibility 16 4.0 4.5 Numeric zero was not inside the naming wrapper; focused DOM tests now prove one visible/naming label. Held at 4.5 because no real-AT pass was run.
§2 Theming 14 3.0 3.0 Retained BLOCK: the open custom variant path has no deterministic inner-rule fallback. A naive subtle fallback hides existing root theme paint, so OQ2 remains an owner decision.
§3 Public API 14 3.0 5.0 BLOCK fixed: the released ReactNode label surface mishandled numeric zero and true; root ref and BaseProps composition remain unchanged.
§4 Behavior 12 4.0 5.0 Label presence now follows the shared renderable-value predicate.
§5a Objective design 6 5.0 5.0 Logical geometry and semantic tokens remain unchanged.
§5b Rendered judgment 4 not measured 4.5 Exact-head Linux CI verified the existing built-in states plus the bounded numeric-label story across both axes.
§6 Testing 8 4.0 4.5 Red-before/green-after component and downstream tests cover skipped scalars, zero, and accessible naming; exact-head browser evidence passed.
§7 Code health 8 5.0 5.0 Derived values only; no Effects, listeners, observers, state, or resource lifecycle.
§8 Docs/Storybook 8 4.0 5.0 Consumer docs, JSDoc, Storybook, and the schema-v7 draft contract agree.
§9 i18n/RTL 5 5.0 5.0 Symmetric rules, logical full-bleed properties, and the existing verified-N/A boundary remain intact.
§10 Responsive/touch 5 5.0 5.0 No interaction or touch target; horizontal and vertical stories remain bounded.
Total 100 79.2 / C 91.6 / C Before: 2 BLOCKs and §5b unmeasured (76.0 / 96 measured). After: 1 retained BLOCK.

Sensitivity: resolving the retained theming BLOCK with no other score change projects 97.2 / A.

Objective remediation

  1. Replace label truthiness with the shared renderable-value predicate. Numeric zero stays inside one wrapper; null, booleans, and empty strings create no wrapper.
  2. Add mutation-sensitive component and downstream tests plus one reusable numeric-label story for horizontal and vertical separators; align ChatSystemMessage's draft observation with the corrected delegated output.
  3. Complete the draft observational component contract against template v7 while recording, not guessing, the unresolved custom-variant fallback and target ownership.

No variant paint, theme target, public prop, export, default, or full-bleed behavior changes in this pull request.

FR5 closed evidence inventory

Surface / state Source and tests Consumer/rendered evidence Authority Result
Public export, props, ref, root inputs index.ts, Divider.tsx, focused ref/prop tests component docs and autodocs public-component-api pass
Horizontal and vertical separator semantics source and focused role/orientation tests horizontal/vertical stories WCAG 1.3.1, 4.1.2 pass
Label omitted, skipped scalar, text, ReactNode, numeric zero, explicit ARIA name source and focused partition tests WithLabel and NumericLabel stories public-component-api; WCAG fixed: zero/true truthiness defect
Built-in subtle/strong and theme-added variant source and global structural axis guard Variants story theming-surface INV4/INV6/INV14 retained BLOCK: no safe custom-value line fallback
Full bleed with logical container inset source and current container protocol horizontal and vertical full-bleed stories container-padding pass; no dedicated asymmetric browser probe
Aggregate divider target and reflected axes themeProps, target inventory, docs/spec map exact-head CI target/visual jobs theming-surface pass; Rule/Label target exposure remains OQ1

Inventory closure: every public export, prop, ReactNode partition, orientation, built-in/open variant path, root seam, target axis, and full-bleed branch is represented.

Needs Review

Should Divider's open variant axis close, or which painting part should own a deterministic custom-value fallback?

The root target can carry theme paint while the inner rule carries built-in paint. Adding a subtle inner fallback can cover existing root background paint; keeping the current path can make an unmatched custom rule disappear. This is a pre-existing theming/API ownership decision, not safe objective remediation. It remains the one open BLOCK in the scorecard and does not prevent this audit PR from landing because the PR neither introduces nor worsens it.

OQ1 also remains recorded: whether Rule or Label should gain separate stable targets. This PR does not add, move, or remove a target.

Independent exact-head self-review

Private read-only review at eac8e2516cd4747a08405a368fc66affb8908a46: CLEAN. Earlier reviews found one theming regression and five evidence/documentation issues; all were corrected, and the final exact head has no actionable finding.

Validation

Passed locally on the frozen head:

  • 497 focused Divider, downstream ChatSystemMessage, theming-target, extensible-axis, and docs tests
  • Core source/docs typechecks and Storybook typecheck
  • strict focused ESLint
  • full repository build and production Storybook build
  • pnpm check:repo, including knowledge, changeset, sync, package-boundary, i18n, and fixture checks
  • global baseline routing from the audit base for accessibility, behavior, layout, public API, testing, and theming

Exact-head Linux CI supplied scoped axe, RTL readback, Stable visual regression, and rendered numeric-label evidence. Every required check is green; one unrelated flaky node watch-mode test passed on the owned rerun.

Writing rubric results

  • R1: present-tense system behavior; no project narration.
  • R2: no research content in the record.
  • R3: each invariant names current authority, objective standards, or observable shipped behavior.
  • R4: no rejected-alternative narrative.
  • R5: no pull request, issue, or commit references in the record.
  • R6: OQ1 and OQ2 are genuine public-theming decisions; neither leaks into settled behavior.

FR10 exact-head eligibility report

{
  "schemaVersion": 1,
  "component": "Divider",
  "package": "core",
  "mode": "nightly",
  "rubricVersion": "1.16.6",
  "repositoryHead": "eac8e2516cd4747a08405a368fc66affb8908a46",
  "componentContractHead": "eac8e2516cd4747a08405a368fc66affb8908a46",
  "inventory": {"closed": true, "rows": 6},
  "score": {"before": 79.2, "after": 91.6, "beforeBlocks": 2, "afterBlocks": 1, "status": "verified-exact-head"},
  "unresolvedObjectiveGaps": [],
  "unresolvedManualGaps": ["OQ1: separate Rule or Label public targets", "OQ2: close the open variant axis or choose its painting owner and fallback"],
  "remediations": [
    {"id": "react-node-label", "state": "verified-locally", "evidence": "red-before/green-after scalar and numeric label tests"},
    {"id": "V10", "state": "verified-exact-head-ci", "evidence": "owned NumericLabel story plus existing state stories"}
  ],
  "approvals": {"privateExactHeadSelfReview": "clean", "specOwner": "passed-draft-n/a", "reviewSignal": "success-app-15368"},
  "checks": {"local": "green except unsupported local browser launch", "exactHeadCI": "green-after-owned-flake-rerun"},
  "eligibility": {"eligible": true, "reasons": ["private exact-head review clean", "exact-head browser and required CI green", "owner-exempt Review signal success from GitHub Actions App 15368", "spec-owner gate passed as draft-only N/A", "one pre-existing theming BLOCK remains but is not introduced or worsened"]}
}

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

vercel Bot commented Oct 15, 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 15, 2026 10:59am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 15, 2026, 11:00 AM UTC

@github-actions

github-actions Bot commented Oct 15, 2026 •

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

@cixzhang
cixzhang force-pushed the night-watch-component-audit/Divider/2026-10-15 branch from b93ea4d to c39b3bf Compare October 15, 2026 10:50
@cixzhang
cixzhang force-pushed the night-watch-component-audit/Divider/2026-10-15 branch from c39b3bf to eac8e25 Compare October 15, 2026 10:52
@cixzhang
cixzhang merged commit c9dfc7a into main Oct 15, 2026
87 of 89 checks passed

This branch was successfully deployed

1 active deployment
Preview — eac8e251 Deployed Oct 15, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant