Skip to content

Conversation

@francinelucca
Copy link
Member

@francinelucca francinelucca commented May 5, 2025

Re-adds #5869 with some fixes

Closes https://github.com/github/primer/issues/4830

Changelog

Changed

Changes the ActionList mode to full when groups are present so we don't have that extra padding

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

(with modern action list FF ONLY)

Before
Screenshot 2025-04-03 at 19 14 41

After
Screenshot 2025-04-03 at 21 20 09

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented May 5, 2025

🦋 Changeset detected

Latest commit: bc48c30

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 Patch

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 staff Author is a staff member label May 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@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 May 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 98.53 KB (-0.02% 🔽)
packages/react/dist/browser.umd.js 98.84 KB (+0.08% 🔺)

@francinelucca francinelucca added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label May 8, 2025
@francinelucca francinelucca requested a review from hectahertz May 8, 2025 15:53
…t-5869-hectahertz/fix-padding-selectpanel-groups
@francinelucca francinelucca marked this pull request as ready for review May 8, 2025 15:55
Copilot AI review requested due to automatic review settings May 8, 2025 15:55
@francinelucca francinelucca requested review from a team as code owners May 8, 2025 15:55
@francinelucca francinelucca requested a review from mperrotti May 8, 2025 15:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reintroduces a previous patch to adjust list padding when groups are present by adding a new horizontal-inset variant and updating styles, docs, and stories accordingly.

  • Introduce horizontal-inset to the variant union in both deprecated and current ActionList props
  • Apply horizontal-inset in SelectPanel when groups exist, and adjust padding/margin logic in ActionList components and CSS
  • Update stories, docs, and the changeset for the new variant

Reviewed Changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
deprecated/ActionList/List.tsx Extend variant type to include horizontal-inset
SelectPanel/SelectPanel.tsx Pass horizontal-inset when groupMetadata exists
ActionList/shared.ts Extend variant type to include horizontal-inset
ActionList/List.tsx Split paddingY into top/bottom and handle new variant
ActionList/Item.tsx Include horizontal-inset in marginX and width logic
ActionList/Heading.module.css Add horizontal-inset to heading margin rules
ActionList/ActionList.stories.tsx Add horizontal-inset to story controls
ActionList/ActionList.module.css Adjust wrapper padding/margin for horizontal-inset
ActionList/ActionList.docs.json Update docs to mention horizontal-inset and refine description
.changeset/fresh-lights-wink.md Add changeset entry for the fix
Comments suppressed due to low confidence (1)

packages/react/src/ActionList/shared.ts:123

  • Add or update tests to cover the new horizontal-inset variant, verifying correct padding and margin behaviors in rendered output.
variant?: 'inset' | 'horizontal-inset' | 'full'

paddingInlineStart: 0, // reset ul styles
paddingY: variant === 'inset' ? 2 : 0,
paddingTop: variant === 'inset' ? 2 : 0,
paddingBottom: variant === 'inset' || variant == 'horizontal-inset' ? 2 : 0,
Copy link

Copilot AI May 8, 2025

Choose a reason for hiding this comment

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

Use strict equality (===) for the horizontal-inset variant check to match the existing pattern and avoid unintended coercion.

Suggested change
paddingBottom: variant === 'inset' || variant == 'horizontal-inset' ? 2 : 0,
paddingBottom: variant === 'inset' || variant === 'horizontal-inset' ? 2 : 0,

Copilot uses AI. Check for mistakes.
onInputRefChanged={onInputRefChanged}
placeholderText={placeholderText}
{...listProps}
variant={listProps.groupMetadata?.length ? 'horizontal-inset' : 'inset'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we maybe just do this in list? and have the logic be internal?

Copy link
Member Author

Choose a reason for hiding this comment

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

the list would have to override it's own variant prop and that feels a bit weird to me 🤔, there'd be no way for the consumer to override it

@francinelucca francinelucca added this pull request to the merge queue May 9, 2025
Merged via the queue into main with commit 261732e May 9, 2025
35 checks passed
@francinelucca francinelucca deleted the revert-6008-revert-5869-hectahertz/fix-padding-selectpanel-groups branch May 9, 2025 14:47
@primer primer bot mentioned this pull request May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member update snapshots 🤖 Command that updates VRT snapshots on the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants