Skip to content

fix(filtered-action-list): respect item renderers#8187

Open
joshblack wants to merge 7 commits into
mainfrom
copilot/fix-filtered-action-list-render-item
Open

fix(filtered-action-list): respect item renderers#8187
joshblack wants to merge 7 commits into
mainfrom
copilot/fix-filtered-action-list-render-item

Conversation

@joshblack

Copy link
Copy Markdown
Member

Closes github/primer#6891

This PR updates FilteredActionList so that item-level renderItem callbacks take precedence over the list-level fallback. Previously, the list renderer was applied after the item props and replaced an item renderer with undefined when no list-level renderer was provided.

Changelog

New

  • Add regression coverage for item-level renderers in grouped and ungrouped lists

Changed

  • Update FilteredActionList to preserve item-level custom renderers across grouped, virtualized, and standard lists

Removed

  • None

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

The main thing to verify is that item-level renderers override the list-level fallback without changing the existing default rendering path.

  • npm run build
  • npm run type-check
  • npm test -- --run --exclude '.agents/**'
  • npm run lint -- --ignore-pattern '.agents/**'
  • npm run lint:css -- --ignore-pattern '.agents/**'
  • npm run format:diff

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
Copilot AI review requested due to automatic review settings July 17, 2026 15:07
@joshblack
joshblack requested a review from a team as a code owner July 17, 2026 15:07
@joshblack
joshblack requested a review from siddharthkp July 17, 2026 15:07
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 360796c

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 Jul 17, 2026
@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 Jul 17, 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. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

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.

Pull request overview

This PR fixes FilteredActionList item rendering precedence so that an item’s own renderItem callback overrides the list-level renderItem fallback (including when the list-level fallback is undefined). It also adds regression tests and a patch changeset for release.

Changes:

  • Reordered prop spreading for MappedActionListItem usage so item-level renderItem isn’t overwritten by the list-level renderItem.
  • Added unit tests for custom item rendering in ungrouped and grouped lists.
  • Added a patch changeset for @primer/react.
Show a summary per file
File Description
packages/react/src/FilteredActionList/FilteredActionList.tsx Fixes prop precedence so item-level renderItem takes priority over list-level renderItem across grouped/virtualized/standard rendering paths.
packages/react/src/FilteredActionList/FilteredActionList.test.tsx Adds regression tests for item-level custom rendering behavior.
.changeset/filtered-action-list-item-renderer.md Declares a patch release note for the behavior fix.

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread packages/react/src/FilteredActionList/FilteredActionList.test.tsx

@joshblack joshblack left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot instead of changing the spread order, explicitly merge the renderItem prop

joshblack and others added 2 commits July 17, 2026 10:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…f relying on spread order

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@copilot instead of changing the spread order, explicitly merge the renderItem prop

Done in the latest commit. All three MappedActionListItem render paths now use 'renderItem' in item ? item.renderItem : listProps.renderItem to explicitly merge the prop, rather than relying on spread order.

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8187 July 17, 2026 15:32 Inactive
@joshblack joshblack added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jul 17, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
@github-actions
github-actions Bot requested a deployment to storybook-preview-8187 July 17, 2026 15:43 Abandoned
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
@github-actions github-actions Bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jul 17, 2026
@joshblack joshblack added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jul 17, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8187 July 17, 2026 15:53 Inactive
@github-actions github-actions Bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jul 17, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8187 July 17, 2026 16:04 Inactive
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants