Skip to content

test(AvatarGroupOverflow): add component-scoped audit coverage - #6120

Merged
cixzhang merged 6 commits into
mainfrom
night-watch-component-audit/AvatarGroupOverflow/2026-09-07
Sep 7, 2026
Merged

cixzhang merged 6 commits into
mainfrom
night-watch-component-audit/AvatarGroupOverflow/2026-09-07

Conversation

@cixzhang

@cixzhang cixzhang commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

AvatarGroupOverflow Night Watch audit

Scope and heads

  • Package/component: core/AvatarGroupOverflow
  • Mode/rubric: Night Watch N / 1.16
  • Repository head audited: 97765a7aa6a30c6ebdbd49b77749f800953e2398
  • Component contract head: observational draft packages/core/src/AvatarGroup/AvatarGroupOverflow.spec.md at 97765a7aa6a30c6ebdbd49b77749f800953e2398; exact-head owner approval is required.
  • Applicable current authority: architecture:knowledge-contracts, spec:AST-002, spec:AST-029, plus objective standards and rubric procedure.

Score

Score Grade Open BLOCKs
Before 88.8 C 2
After 96.4 A 0

Closed public-surface inventory

Public surface/state Source Tests Consumer docs/story Browser evidence Authority/result
count: number AvatarGroupOverflow.tsx count clamp + ICU label zero, negative, large, grouped-number tests prop docs; Default/LargeCount/ZeroCount light/dark frames settled objective behavior; covered
children?: ReactNode custom count content custom content = children ?? +N custom-content test prop docs; CustomContent light/dark frames observable public surface; covered
onClick?: () => void native button type=button; shared overlay/focus styles button/click callback tests prop docs; Clickable rest/hover/focus-visible/pressed light+dark observable public surface; covered
ref forwarded to span or button both element paths prop docs/argTypes DOM sensor receipt covered
BaseProps (xstyle, className, style, rest) merged on primary rendered element className test; lint/theme guards canonical xstyle wording; argTypes rendered element receipts covered
Group context: size/shape/overlap useAvatarGroup, fallback md/circle/0 size/shape/default tests AllSizes/AllShapes/Standalone light/dark/RTL/320px covered as observation; no new behavior introduced
Static span no onClick branch default + standalone tests Default/Standalone light/dark covered
Clickable button onClick branch role/click/ref tests Clickable interaction-state set covered
i18n and large numbers useTranslator + ICU {count, number} provider-locale and 4,912 tests count docs accessible-name receipts covered
RTL logical overlap/order logical marginInlineStart source + browser harness RightToLeft D2 curated pass measured, no coverage gap
Narrow and long content pill min-width + inline padding large-count tests LargeCount/NarrowContainer 320px frames covered

Observational component contract

  • Added packages/core/src/AvatarGroup/AvatarGroupOverflow.spec.md from the current schema v3/template v4.
  • It records only verified shipped behavior, public concepts and states, ownership boundaries, verification, and applicable current relationships.
  • It introduces no API meaning, behavior, default, compatibility promise, ownership ruling, or design decision. It remains authority: draft pending exact-head owner approval.

Fixed objective defects

  • V1/V10/X9: the public component had no dedicated test or story file, so component-scoped accessibility and RTL jobs audited zero stories. Added a colocated 17-test contract suite and ten dedicated Storybook stories.
  • I17: after the stories existed, RTL still reported an unexplained all-N/A coverage gap. Added a D2 order-flip target proving the Avatar-to-overflow relation mirrors in RTL.
  • X3/X18: consumer docs had only one do-not rule and non-canonical xstyle wording. Added the second concrete do-not rule and canonical wording.

No runtime behavior or public API changed. No behavior test remediation was needed, so the pinned TDD flow was not invoked beyond confirming the established public seam.

Evidence-integrity correction

The initial story metadata used Storybook action injection for onClick, which made args-based stories interactive even when they were intended to prove the static span branch. The corrected exact head sets the shared default to onClick: undefined, removes automatic action injection, and assigns a mock callback only to Clickable.

The regenerated receipts now assert the rendered root tag before every capture: Default, CustomContent, AllSizes, AllShapes, LargeCount, ZeroCount, Standalone, RightToLeft, and NarrowContainer render SPAN; only Clickable renders BUTTON. All 26 light/dark captures pass these assertions with no page errors. Every receipt carries resolvable full commit c898931c77c44099d99e5cd047b88528d2d40a30. The only change from that visual-evidence head to the current PR head is observational draft text in AvatarGroupOverflow.spec.md, so no rendered path changed.

Unresolved evidence

Visual evidence

Each of 26 captures records the exact build, story, theme/mode, direction, viewport, semantic state, visible geometry/computed styles, font readiness, and page errors. Every receipt settled with zero page or console errors.

Validation

  • Focused component/theme tests: 545 assertions pass.
  • Component-scoped a11y: 10 stories, 0 violations, 0 baseline additions.
  • Component-scoped RTL: D2 pass; 1 measured, 0 gaps.
  • pnpm lint:strict: 0 errors (89 pre-existing warnings).
  • Storybook build and CI build, test, lint, docsite-test, pr-a11y, pr-rtl, and stable visual regression: green on exact head.
  • Local full pnpm test has unrelated managed-Mac/environment failures (virtual-store copy/hardlink assumptions and CLI case-sensitivity/search output); CI full test is green.
  • Local full pnpm build reached theme-neutral then failed on a missing generated relative module; CI full build is green.

Exact-head eligibility report

{
  "schemaVersion": 1,
  "component": "AvatarGroupOverflow",
  "package": "core",
  "auditMode": "N",
  "rubricVersion": "1.16",
  "heads": {
    "repository": "97765a7aa6a30c6ebdbd49b77749f800953e2398",
    "componentContract": "97765a7aa6a30c6ebdbd49b77749f800953e2398"
  },
  "inventory": {
    "closed": true,
    "gaps": []
  },
  "unresolvedGaps": {
    "objective": [],
    "manual": []
  },
  "remediations": [
    {
      "ruleId": "V1/V10/X9",
      "beforeEvidence": ["No dedicated test/story file; a11y audited 0 components"],
      "afterEvidence": ["17 dedicated tests; 10 dedicated stories; static story roots assert SPAN, Clickable asserts BUTTON; a11y audited all 10 with 0 violations"]
    },
    {
      "ruleId": "I17",
      "beforeEvidence": ["RTL: 0 measured, 1 coverage gap"],
      "afterEvidence": ["RTL D2 pass: 1 measured, 0 coverage gaps"]
    },
    {
      "ruleId": "X3/X18",
      "beforeEvidence": ["One do-not rule; non-canonical xstyle wording"],
      "afterEvidence": ["Two do-not rules; canonical stylex.create wording"]
    }
  ],
  "approvals": [
    {"name": "human review", "state": "required"},
    {"name": "component contract owner exact-head approval", "state": "required"}
  ],
  "checks": [
    {"name": "lint", "state": "success"},
    {"name": "test", "state": "success"},
    {"name": "build", "state": "success"},
    {"name": "pr-a11y", "state": "success"},
    {"name": "pr-rtl", "state": "success"},
    {"name": "Stable visual regression", "state": "success"},
    {"name": "audit-eligibility", "state": "missing"}
  ],
  "eligibility": {
    "eligible": false,
    "reasons": [
      "spec:AST-029 is phase accepted, not shipped",
      "trusted exact-head audit-eligibility check is not active"
    ]
  }
}

Auto-merge was not enabled. The PR remains open for human review.

@vercel

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

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 7, 2026
github-actions Bot added a commit that referenced this pull request Sep 7, 2026
@cixzhang
cixzhang marked this pull request as ready for review September 7, 2026 16:13
@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

AvatarGroup (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 269 -
Complexity N/A High (19) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

Status: No visual change across 2 compared shot(s).


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Semantic verdict: request changes

Builders and the audit currently see buttons in Default, Standalone, CustomContent, LargeCount, ZeroCount, RTL, and NarrowContainer. argTypes.onClick.action injects a callback into every args-based story, so those stories do not cover the static-span states they claim. Please keep only Clickable interactive and regenerate exact-head accessibility and visual evidence.

[Reviewed by Robohands]

@cixzhang

cixzhang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the evidence-integrity finding on exact head f657d1d90ee2028ce187a1cc2fa06b9b8a8ec678: shared story args now explicitly set onClick: undefined; automatic action injection is removed; only Clickable supplies fn(). Regenerated receipts assert SPAN for all nine static stories and BUTTON only for Clickable in light and dark. Component-scoped a11y remains 0 violations and RTL D2 passes. Ready for independent re-review.

github-actions Bot added a commit that referenced this pull request Sep 7, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Semantic verdict: request changes

The regenerated frames look right, but every sensor receipt names build f657d1d90ee2c7635c8ce506b7af19a889cc9387, which is neither this head nor a repository commit. That leaves the new story-state evidence unbound. Please regenerate the receipts from this exact head with its resolvable full SHA.

[Reviewed by Robohands]

@cixzhang

cixzhang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the receipt-integrity finding on real exact head c898931c77c44099d99e5cd047b88528d2d40a30. All 26 regenerated receipts now carry that full SHA; git cat-file -e c898931c77c44099d99e5cd047b88528d2d40a30^{commit} succeeds, the remote PR head matches it, nine static stories assert SPAN, and only Clickable asserts BUTTON. Component-scoped a11y remains 0 violations and RTL D2 passes. Ready for independent re-review.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Semantic verdict: request changes

The draft still promises a static overflow is non-focusable, but builders can pass tabIndex={0} through BaseProps and the span forwards it to the root. That makes the observational contract internally inconsistent: it records DOM passthrough as supported while ruling out a supported state. Please describe the default branch as a static span outside AvatarGroup’s roving-focus set, without claiming it cannot be focused.

[Reviewed by Robohands]

@cixzhang

cixzhang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Corrected the observational draft at exact head 97765a7aa6a30c6ebdbd49b77749f800953e2398. The static branch is now described precisely: it is a span, non-interactive by default, outside AvatarGroup’s roving-focus marker set, while supported caller DOM props such as tabIndex still reach the root and may make it programmatically or sequentially focusable. Nearby FR6, representative-state, AR2/AR3, ownership, and verification wording now agrees with BaseProps passthrough. The only diff from visual-evidence head c898931c77c44099d99e5cd047b88528d2d40a30 is this spec text. Knowledge validation passes. Ready for independent re-review.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Semantic verdict: approve

This now matches shipped behavior: static spans stay outside roving focus, while caller tabIndex remains supported. Exact-head evidence and CI are green.

[Reviewed by Robohands]

@cixzhang
cixzhang merged commit 3d0bea6 into main Sep 7, 2026
30 checks passed
cixzhang added a commit that referenced this pull request Sep 7, 2026
Two commits, no conflicts, no file overlap with this branch's 22.

- #6120 gives AvatarGroupOverflow its own audit coverage and story;
- #6097 simplifies Stepper's collapse and context APIs.

Stepper renders an IconButton, which this branch binds to the button pattern, so
that coupling was checked rather than assumed: the incoming diff does not touch
the IconButton call, and nothing here changes component behaviour. Neither
commit touches internal/a11y-spec, the a11y stories, the workflows, or the
Playwright config.
@github-actions
github-actions Bot deleted the night-watch-component-audit/AvatarGroupOverflow/2026-09-07 branch September 8, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 97765a7a Deployed Sep 7, 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