Repository navigation
test(rtl): make fixture applicability order-independent - #7489
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Approval now waits on a maintainer to provide or identify the governing spec for the RTL-audit applicability policy this adds: the story-level rtlAudit.D1 opt-out (with its required reason) and its use to file the SVG icon registry fixture under Lab/SVGIcon. The deterministic D1 ordering keeps every existing component's representative story, and the registry fixture's exclusion works as described while D5 and D6 still scan it. Nothing else is required from you; dropping the formatting-only edits to untouched helpers in rtl-audit-coverage.mjs is optional.
[Automated review]
There was a problem hiding this comment.
Changes requested: the ordering, rtlAudit.D1 metadata, D1-only scope and identity handling match the RTL audit evidence record on main (docs/architecture/rtl-audit-evidence.md, INV12–INV15), but the branch does not yet meet INV16's disclosure rule. INV16 requires review-facing audit output to list every declared D1 exclusion with its component, story id, dimension and reason, including stories not selected as the representative; today autoD1ForComponent stops at lab-svgicon--default, so the registry fixture's exclusion appears in neither the audit report nor the scorecard summary. Please read and validate the resolved rtlAudit metadata for every in-scope story, report the declared exclusions, render them in rtl-scorecard-summary.mjs, and add a test; INV16 also asks a human reviewer to confirm the registry exclusion.
[Automated review]
| const card = await autoD1(page, port, candidate.id, component, { | ||
| ltrReady: true, | ||
| }); | ||
| card.skippedStories = skippedStories; | ||
| if (skippedStories.length > 0) { | ||
| card.notes.unshift( | ||
| `skipped ${skippedStories.length} fixture(s) explicitly not applicable to D1`, | ||
| ); | ||
| } | ||
| return card; |
There was a problem hiding this comment.
docs/architecture/rtl-audit-evidence.md INV16 requires review-facing audit output to list every declared D1 exclusion with its component, story id, dimension and reason, including stories not selected as the D1 representative. This loop returns at the first applicable candidate, so for lab/SVGIcon the registry story's rtlAudit.D1 exclusion is never read or reported (skippedStories: []), and rtl-scorecard-summary.mjs does not print skippedStories even in the all-excluded case. Reading and validating the resolved rtlAudit for every in-scope story (the D5/D6 pass already loads each one), emitting the declared exclusions in the report, and rendering them in the scorecard summary would satisfy INV16 and also validate metadata on non-representative stories.
Read and validate resolved rtlAudit metadata for every D1 candidate, then report each declared exclusion with its component, story id, dimension, and rationale. The scorecard renders the same list, including exclusions that were not selected as the D1 representative.
5e2f95f to
546dc51
Compare
|
INV16 human review: I reviewed the declared D1 exclusion for |
There was a problem hiding this comment.
Approval recommended: the D1 ordering, the typed rtlAudit.D1 opt-out, the D1-only scope, the stable identities and the declared-exclusion disclosure match the RTL audit evidence record on main (docs/architecture/rtl-audit-evidence.md, INV12–INV16), and the registry fixture's exclusion fits the raw-glyph reference case in docs/design/bidirectionality.md (DR5). With the registry story moved first in a built index, the audit on main reports a false D1 failure on its chevron samples, while this branch keeps measuring lab-svgicon--default and lists the exclusion in both the report and the scorecard. Nothing further is required from you.
[Automated review]
Maintainer impact
D1 previously chose a component's representative story from generated
index.jsonobject order. If the raw SVG icon registry fixture appeared before the normal SVGIcon stories, the audit treated its caller-supplied left and right samples as directional controls and reported a false failure.Intended invariant
Implements
docs/architecture/rtl-audit-evidence.mdINV12–INV16: D1 selection is deterministic; a reference fixture can be excluded only from D1 with a typed, colocated rationale; D5 and D6 still scan every story; and every declared D1 exclusion is visible in review-facing audit output.Change
rtlAudit.D1applicability metadata and validate the resolved Storybook parameters at runtime.declaredD1Exclusions(component, story id, dimension, rationale) in the audit JSON, including stories not selected as the representative, and render them in the scorecard summary.Lab/SVGIcon.Human review requested (INV16)
INV16 requires a human reviewer to confirm the explicit exclusion below. A nonempty reason proves only valid metadata.
Evidence
idx:0,idx:1).lab-svgicon--default, has zero D1 failures, and lists the registry exclusion in both the JSON report and the Markdown scorecard.Scope
Testing
Rebased on current
main.pnpm exec vitest run --project node .github/scripts/rtl-audit-coverage.test.mjs .github/scripts/rtl-scorecard-summary.test.mjs .github/scripts/rtl-audit-shards.test.mjs .github/scripts/rtl-join.test.mjs .github/scripts/rtl-report-completion.test.mjs— 81 passed.pnpm build,pnpm -F @astryxdesign/storybook typecheck,pnpm -F @astryxdesign/storybook build— passed.lab/DiffViewerD1, twocharttheming-rechartsD5 tooltip stories) reproduce identically withmain's audit code on the same build; onecore/DrawerHeaderD5 result (3px delta) did not reproduce on either rerun. The nonzero exit is from those pre-existing findings and the existing applicability backlog.node --check, andgit diff --check— passed.Supersedes #5858 and #5988.