Skip to content

Card: incorporate adoption feedback - #8592

Merged
liuliu-dev merged 7 commits into
mainfrom
improve/card-adoption-feedback
Nov 6, 2026
Merged

liuliu-dev merged 7 commits into
mainfrom
improve/card-adoption-feedback

Conversation

@liuliu-dev

@liuliu-dev liuliu-dev commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Related to github/primer#6672.

Address Card adoption feedback. Card remains draft; alpha promotion is out of scope.

Changelog

New

  • shadow={false} for shadowless cards.
  • Card.Link and Card.Button for whole-card interaction, with hover/focus indicators and independent secondary controls.
  • padding="regular" for 16px padding in either layout.

Changed

  • Improve shrinking, equal-height layouts, bottom-aligned footers, and edge-to-edge images.
  • Update docs, stories, tests, and the export snapshot.

Removed

None.

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

Minor release. Existing default/normal padding stays 24px in the default layout and 16px in compact layout. The new 16px option is opt-in; no padding migration is needed.

Testing & Reviewing

  • npm run build — passed locally.
  • npm test -- --run packages/react/src/__tests__/exports.test.ts packages/react/src/Card/Card.test.tsx — 64 passed locally.
  • npx playwright test e2e/components/Card.test.ts --grep 'Whole-card interactions' --workers=2 — 11 passed locally, including accessibility checks.
  • npm run format:diff — passed locally.
  • Latest PR CI: unit tests and type-checks for React 18/19, lint, build, accessibility, and VRT all passed.
  • Integration: github/github-ui#39248. Reported integration checks on this PR are green, but the integration PR has a failed VRT Merge Reports check that still needs investigation.

Review padding/shadow in Playground and keyboard/pointer behavior in With Link, With Button, and Custom Content.

@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 237c463

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

liuliu-dev and others added 4 commits November 6, 2026 08:34
Add optional shadows and whole-card heading actions, standardize padding, and improve custom card layouts. Record the default padding change as breaking; migration planning remains follow-up work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add opt-in regular padding for 16px in either layout and replace the breaking padding changeset with a minor release note.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@liuliu-dev
liuliu-dev force-pushed the improve/card-adoption-feedback branch from 8303bc0 to 7c70f4b Compare November 6, 2026 16:43
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8592 November 6, 2026 16:56 Inactive
@github-actions github-actions Bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Nov 6, 2026
@liuliu-dev
liuliu-dev marked this pull request as ready for review November 6, 2026 17:23
@liuliu-dev
liuliu-dev requested a review from a team as a code owner November 6, 2026 17:23
@liuliu-dev
liuliu-dev requested review from TylerJDev and a balanced review from Copilot November 6, 2026 17:23
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

Copilot AI commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Setup Playwright

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

Copilot AI 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.

🟡 Changes recommended

Story playback can overlap the Card test interactions and assertions, creating race conditions and extra clicks unless tests wait for playback completion or use playback-free stories.

1 open issue
What changed in this PR

This PR incorporates adoption feedback into the draft Card component, adding whole-card interactions and layout options without changing default padding or promoting Card to alpha.

Changes:

  • Add Card.Link, Card.Button, optional shadows, and opt-in 16px padding.
  • Improve shrinking, equal-height layouts, footer alignment, and edge-to-edge images.
  • Expand documentation, stories, interaction tests, and public export coverage.
File Description
packages/​react/​src/​experimental/​index.ts Export new interaction prop types.
packages/​react/​src/​Card/​index.ts Expose Card.Link and Card.Button.
packages/​react/​src/​Card/​Card.tsx Implement interaction components and layout options.
packages/​react/​src/​Card/​Card.test.tsx Cover layout, padding, shadows, and native interactions.
packages/​react/​src/​Card/​Card.stories.tsx Add padding and shadow controls.
packages/​react/​src/​Card/​Card.stories.module.css Style equal-height custom compositions.
packages/​react/​src/​Card/​Card.module.css Add interaction indicators and improve layout behavior.
packages/​react/​src/​Card/​Card.features.stories.tsx Demonstrate whole-card and independent secondary actions.
packages/​react/​src/​Card/​Card.docs.json Document new APIs and composition constraints.
packages/​react/​src/​__tests__/​__snapshots__/​exports.test.ts.snap Record new public prop types.
e2e/​components/​Card.test.ts Test whole-card interactions, layout, and accessibility.
.changeset/​card-flexible-layout.md Describe layout fixes in a patch changeset.
.changeset/​card-adoption-feedback.md Describe new Card APIs in a minor changeset.

Review effort: Balanced

Comment on lines +136 to +138
await visit(page, {id: 'experimental-components-card-features--with-button'})
const details = page.getByRole('region', {name: 'Repository details'})
await expect(details).toHaveCount(0)
Keep heading actions local by default and opt in with fullCardHitArea. Add 24px spacious padding in both layouts while preserving normal padding and defaults.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@primer-integration

primer-integration Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed  Changes   Passed
Passed  CI   Passed
Running  VRT   Running
Passed  Projects   Passed

@liuliu-dev

Copy link
Copy Markdown
Contributor Author

the CodeViewEmptyLayout Card visual diff in integration tests is intentional: content stays grouped at the top and footer actions align at the bottom in equal-height cards.

cc @francinelucca

Merged via the queue into main with commit 0ae18d3 Nov 6, 2026
56 checks passed
@liuliu-dev
liuliu-dev deleted the improve/card-adoption-feedback branch November 6, 2026 23:57
@primer primer Bot mentioned this pull request Nov 6, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
storybook-preview-8592 — 237c463d Deployed Nov 6, 2026 by github-actions[bot]
github-pages — 237c463d Deployed Nov 6, 2026 by liuliu-dev via deploy-preview #34171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants