Skip to content

chore(popover): add vrt support - #6623

Open
rise-erpelding wants to merge 4 commits into
mainfrom
rise-erpelding/swc-2402-popover-vrts
Open

chore(popover): add vrt support#6623
rise-erpelding wants to merge 4 commits into
mainfrom
rise-erpelding/swc-2402-popover-vrts

Conversation

@rise-erpelding

@rise-erpelding rise-erpelding commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds dedicated Chromatic VRT coverage for popover under test/vrt/, following the pattern established for button.

test/vrt/popover.vrt.ts

  • Permutations — light/LTR matrix: all 12 placements, size (default + s/m/l), hide-arrow, modal (top/bottom), and content overflow (scrollable slot).
  • Permutations (RTL) — dark/RTL smoke for start/end placement mirroring plus hide-arrow under dark theme. Split from Permutations because the overflow row’s tall top-layer surface covers a trailing dark block when both live on one page.
  • Forced Colors — representative subset (placements, hide-arrow, modal) under forced-colors: active.
  • Nested — outer + inner popovers open together via an ancestor chain (custom open sequence so the inner anchors after the outer).

test/vrt/popover-custom-properties.vrt.ts

Reference vs. override rows for the four documented --swc-popover-* custom properties, with coverage verification in play.

test/vrt/vrt-helpers.ts

Popover-specific VRT layout and capture helpers:

  • openManyPopoversForVrt — flips non-modal instances to popover="manual" and disables flip so a full matrix can render open in one snapshot (VRT-only; does not change real popover behavior).
  • stack, vrtPage, propertyCompareRow — row/page layout for top-layer surfaces.
  • popoverVrtParameters / popoverForcedColorsVrtParameters — canvas padding and min inline size so filter: drop-shadow halos are not clipped in Chromatic (including size l and side placements).

Also removes the ad hoc VRT-only stories/helpers that previously lived in popover.stories.ts (predating this pattern); that coverage now lives in the dedicated files above.

Related issue(s)

  • SWC-2402

Screenshots

N/A — see Chromatic build on this PR for the new snapshots.

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Popover VRT snapshots render correctly
    1. Open the Chromatic build linked on this PR
    2. Review Popover/Popover VRTPlacements, Placements (RTL), ForcedColors, Nested, CustomProperties
    3. Confirm every open popover is fully visible, correctly anchored, and legible against its background, with no unintended diffs against the existing docs stories

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Keyboard
    No new interactive surface: these are VRT-only stories tagged dev/!autodocs, not part of the docs page or sidebar. No keyboard regressions expected.

  • Screen reader
    No new interactive surface for the same reason as above.

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6476afd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rise-erpelding rise-erpelding added Status:WIP PR is a work in progress or draft Component:Popover labels Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6623

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/swc-2402-popover-vrts branch 4 times, most recently from d2fc8a1 to 144bff2 Compare August 17, 2026 17:58
@rise-erpelding rise-erpelding added the run_vrt Triggers the Chromatic VRT run for 2nd-gen label Aug 17, 2026
@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/swc-2402-popover-vrts branch from 0d97557 to b4a3f52 Compare August 17, 2026 19:29
@rise-erpelding rise-erpelding added Status:Ready for review PR ready for review or re-review. and removed Status:WIP PR is a work in progress or draft labels Aug 17, 2026
@rise-erpelding
rise-erpelding marked this pull request as ready for review August 17, 2026 20:57
@rise-erpelding
rise-erpelding requested a review from a team as a code owner August 17, 2026 20:57
'Content overflow'
);

const cjkLanguageRow = (prefix: string) =>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dropped because we don't appear to need it, we're not styling anything for CJK in popover.

// larger because open surfaces (especially size `l` and side placements) paint
// in the top layer and do not expand their ancestor's in-flow width.
export const SURFACE_SHADOW_BLEED = 24;
export const INLINE_SHADOW_BLEED = 48;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Made a number of adjustments here to get Chromatic to capture without cutting off popovers' drop shadows, open to other ideas if anyone has any!

@cdransf cdransf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great! ✨

@rubencarvalho

Copy link
Copy Markdown
Contributor

I know it's a bit of a nit 😛, but on the RTL story, could we also test the top/bottom combinations?

Rise Erpelding and others added 4 commits August 19, 2026 06:51
Adds dedicated Storybook VRT coverage under popover's own test/vrt/
folder, following the button VRT foundation: placement, size,
hide-arrow, modal, content overflow, forced-colors, and the public
custom-property contract. Since popover uses native popover="auto"
(only one open at a time on a real page), a small test-only helper
flips each instance to manual before opening so the whole matrix can
render open in a single snapshot.

Removes the ad hoc VRT-only stories/helpers that previously lived in
popover.stories.ts, which predated this pattern.
@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/swc-2402-popover-vrts branch from 6d43557 to 6476afd Compare August 19, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:Popover run_vrt Triggers the Chromatic VRT run for 2nd-gen Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants