Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 6, 2025

This PR adds the size prop to ActionList.LinkItem to match the functionality shipped to ActionList.Item in https://github.com/github/primer/issues/4587.

Problem

In @github/github/pull/393559, a size prop was added to ActionList.Item that defaults to medium but accepts large. However, ActionList.LinkItem did not have this same capability, creating an inconsistency between the two components.

Solution

Added the size prop to ActionList.LinkItem using the same prop naming and styles as ActionList.Item:

  • Type Definition: Added 'size' to the ActionListLinkItemProps Pick type
  • Implementation: Pass the size prop through to the underlying Item component
  • Default Value: Defaults to 'medium' (same as ActionList.Item)
  • Supported Values: 'medium' | 'large'

Usage

// Default size (medium)
<ActionList.LinkItem href="/github">Default Link</ActionList.LinkItem>

// Explicit medium size  
<ActionList.LinkItem href="/github" size="medium">Medium Link</ActionList.LinkItem>

// Large size
<ActionList.LinkItem href="/github" size="large">Large Link</ActionList.LinkItem>

Technical Details

The implementation leverages the existing infrastructure:

  • Uses the same CSS styling via data-size attribute that applies &[data-size='large'] for larger padding
  • Reuses the Item component's size handling mechanism
  • Maintains consistency with ActionList.Item behavior

Testing

  • Added test to verify the data-size attribute is correctly applied
  • Updated Storybook playground to include size control
  • All existing tests continue to pass

This change ensures feature parity between ActionList.Item and ActionList.LinkItem while maintaining the existing API and behavior.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

changeset-bot bot commented Aug 6, 2025

🦋 Changeset detected

Latest commit: 8b57f29

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Minor
@primer/styled-react Major

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

@Copilot Copilot AI changed the title [WIP] In @github/github/pull/393559 we added a size prop to ActionList.Item so it can be medium by default but accept large. Add the same thing to ActionList.LinkItem, using the same prop naming and styles. Add size prop to ActionList.LinkItem Aug 6, 2025
@Copilot Copilot AI requested a review from dylanatsmith August 6, 2025 15:57
Copilot finished work on behalf of dylanatsmith August 6, 2025 15:57
@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 Aug 6, 2025
Copy link
Contributor

github-actions bot commented Aug 6, 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!

@dylanatsmith
Copy link
Member

@copilot Add a changeset

Copy link
Contributor

github-actions bot commented Aug 6, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 90.2 KB (-0.07% 🔽)
packages/react/dist/browser.umd.js 90.38 KB (-0.12% 🔽)

Copy link
Contributor Author

Copilot AI commented Aug 6, 2025

@copilot Add a changeset

Added changeset for the ActionList.LinkItem size prop feature in commit 8b57f29. The changeset documents this as a minor version bump since it adds new functionality to the component.

Copilot finished work on behalf of dylanatsmith August 6, 2025 16:29
@dylanatsmith dylanatsmith marked this pull request as ready for review August 6, 2025 16:48
@Copilot Copilot AI review requested due to automatic review settings August 6, 2025 16:48
@dylanatsmith dylanatsmith requested a review from a team as a code owner August 6, 2025 16:48
@dylanatsmith dylanatsmith requested a review from pksjce August 6, 2025 16:48
Copy link
Contributor

@Copilot 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 adds a size prop to ActionList.LinkItem to achieve feature parity with ActionList.Item, which already has this functionality. The change allows LinkItem components to be rendered in either medium (default) or large sizes.

  • Add size prop to ActionListLinkItemProps type definition
  • Pass the size prop through to the underlying Item component
  • Add comprehensive test coverage and Storybook controls

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/react/src/ActionList/LinkItem.tsx Add size prop to type definition and component implementation
packages/react/src/ActionList/ActionList.test.tsx Add test to verify size prop functionality and data-size attribute
packages/react/src/ActionList/ActionList.stories.tsx Add size control to LinkItem Storybook playground
.changeset/add-actionlist-linkitem-size-prop.md Add changeset entry documenting the new feature

@dylanatsmith dylanatsmith requested a review from langermank August 6, 2025 16:49
Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

🚀

@langermank langermank added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit e53228c Aug 6, 2025
43 checks passed
@langermank langermank deleted the copilot/fix-e393a185-6534-4ada-9973-23023fb23e41 branch August 6, 2025 17:04
@primer primer bot mentioned this pull request Aug 6, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants