Skip to content

feat(user-card): full s2 migration - #6742

Draft
aramos-adobe wants to merge 15 commits into
mainfrom
aziz/user-card-migration
Draft

aramos-adobe wants to merge 15 commits into
mainfrom
aziz/user-card-migration

Conversation

@aramos-adobe

@aramos-adobe aramos-adobe commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

This migration brings user-card into the Spectrum 2 component structure and updates it to match the newer card patterns and token system.

The work includes the new user-card component, updated exports and types, Spectrum 2 styling, storybook docs, and the test coverage needed to support the component in the SWC library.

I also added the changelog entry and migration docs so the component lands with the rest of the gen2 work.

Motivation and context

We’re moving the older first-generation components to the new Spectrum 2 architecture, and user-card is part of that effort.

This update keeps the component aligned with the newer API, design tokens, and documentation standards while making it ready for the same testing and accessibility expectations as the rest of the library.

Related issue(s)

  • fixes SWC-2371

Screenshots (if appropriate)

Screenshot 2026-10-05 at 10 46 38 PM

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed 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

  • Default render and layout

    1. Open the user-card Storybook story.
    2. Confirm the avatar, heading, metadata, and optional actions render in the expected layout.
    3. Check that the spacing and visual treatment match the Spectrum 2 card patterns.
  • Content and action states

    1. Review the story variants with different metadata and action combinations.
    2. Confirm content alignment and sizing hold up across the supported states.
    3. Verify focus and hover treatment looks correct and remains accessible.
  • Accessibility check

    1. Tab through the interactive elements in Storybook.
    2. Confirm focus order is logical and the visible focus indicator remains clear.
    3. Review the rendered semantics and names to ensure the content is announced clearly to assistive tech.

Device review

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

Accessibility testing checklist

Required: Complete each applicable item and document your testing steps (replace the placeholders with your component-specific instructions).

  • Keyboard (required — document steps below) — What to test for: Focus order is logical; Tab reaches the component and all interactive descendants; Enter/Space activate where appropriate; arrow keys work for tabs, menus, sliders, etc.; no focus traps; Escape dismisses when applicable; focus indicator is visible.

    1. Open the user-card Storybook stories and tab through each interactive control.
    2. Verify focus moves in a logical order and the focus ring stays visible.
    3. Confirm activation works as expected without trapping focus.
  • Screen reader (required — document steps below) — What to test for: Role and name are announced correctly; state changes (e.g. expanded, selected) are announced; labels and relationships are clear; no unnecessary or duplicate announcements.

    1. Inspect the rendered markup and accessibility attributes in Storybook or devtools.
    2. Check that labels, text content, and actions are announced clearly and without duplication.
    3. Confirm important state changes are exposed through the appropriate ARIA patterns.

aramos-adobe and others added 2 commits September 14, 2026 15:15
* feat(user-card): files, api, styling extend CardBase

* fix(user-card): updating xs avatar size to 100

* chore(user-card): keep it focused on files api and styling for now tests for next pr

* feat(user-card): update grid avatar layout and docs

* fix(usercard): fixing broken doc links

* Update 2nd-gen/packages/swc/components/user-card/user-card.css

Use border width token instead of hardcoded value

Co-authored-by: Stephanie Eckles <seckles@adobe.com>

---------

Co-authored-by: Stephanie Eckles <seckles@adobe.com>
@aramos-adobe aramos-adobe self-assigned this Sep 14, 2026
@aramos-adobe
aramos-adobe requested a review from a team as a code owner September 14, 2026 19:20
@aramos-adobe aramos-adobe added Status:WIP PR is a work in progress or draft Component:Card gen2 These issues or PRs map to our 2nd generation work to modernizing infrastructure. labels Sep 14, 2026
@changeset-bot

changeset-bot Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 67f496f

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.

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

@aramos-adobe
aramos-adobe marked this pull request as draft September 14, 2026 19:21
@aramos-adobe aramos-adobe changed the title Aziz/user card migration feat(user-card): full s2 migration Sep 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-6742

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.

@aramos-adobe
aramos-adobe added this pull request to stack #6744 September 14, 2026 20:14
@aramos-adobe
aramos-adobe marked this pull request as ready for review September 15, 2026 22:35
@aramos-adobe
aramos-adobe removed this pull request from stack #6744 September 15, 2026 22:37
* test(user-card): add vrt, tests and a11y specs

* fix(user-card): overlap test fix

* test(user-card): add action button in docs and vrt

* fix(user-card): update fire udpate

* fix(user-card): fix type error
* docs(user-card): update docs

* docs(user-card): updating docs to include asset

* docs(card): update migration plan docs

* feat(user-card): adding asset card to test with

* docs(user-card): removing default 3 1 line

* chore(user-card): bringing new changes to PR

* docs(user-card): update migration plans

* chore(user-card): addressing feedback

* docs(user-card): make decorative and alt consistent
@aramos-adobe aramos-adobe added Status:Ready for review PR ready for review or re-review. run_vrt Triggers the Chromatic VRT run for 2nd-gen High priority PR review PR is a high priority and should be reviewed ASAP and removed Status:WIP PR is a work in progress or draft labels Oct 6, 2026
aramos-adobe and others added 2 commits October 5, 2026 22:34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@5t3ph 5t3ph self-assigned this Oct 6, 2026

@5t3ph 5t3ph left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work on this! I just missed getting to it during the docs phase, so a bit of comments from that angle.

Comment thread gen2/packages/swc/components/user-card/stories/user-card.stories.ts
Comment thread gen2/packages/swc/components/user-card/user-card.mdx Outdated
Comment thread gen2/packages/swc/components/card/stories/card.stories.ts
Comment thread gen2/packages/swc/components/user-card/stories/user-card.stories.ts Outdated
Comment thread gen2/packages/swc/components/user-card/stories/user-card.stories.ts Outdated
Comment thread gen2/packages/swc/components/user-card/UserCard.ts Outdated
Comment thread gen2/packages/swc/components/card/card.mdx
Comment thread gen2/packages/swc/components/user-card/stories/user-card.stories.ts Outdated
Comment thread gen2/packages/swc/components/user-card/UserCard.ts
Comment thread gen2/packages/swc/components/user-card/user-card.css
Comment thread gen2/packages/swc/components/user-card/stories/user-card.stories.ts Outdated
<swc-avatar
slot="avatar"
src="./images/avatar-preview.png"
alt="Jane Doe"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change to swc-avatar was missed

COMBINED STATES
───────────────────────────────────────────────────────────────────────────── */

:host(:is([title-as-link], [selectable]):not([variant="tertiary"], [variant="quiet"]):is(:hover, :focus-visible)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To fix the Card VRT regression, restore this selector since it's a :not() condition, since it's already complex it will be easiest to keep here and won't harm the other card types as it will be ignored as not applicable.

@nikkimk nikkimk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have some a11y questions on this one that need to be resolved. I'd like to pause if we can.

@aramos-adobe
aramos-adobe marked this pull request as draft October 8, 2026 15:19
@aramos-adobe aramos-adobe added Status:Blocked PR is blocked for some reason and removed Status:Ready for review PR ready for review or re-review. labels Oct 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:Card gen2 These issues or PRs map to our 2nd generation work to modernizing infrastructure. High priority PR review PR is a high priority and should be reviewed ASAP run_vrt Triggers the Chromatic VRT run for 2nd-gen Status:Blocked PR is blocked for some reason

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants