fix(filtered-action-list): respect item renderers#8187
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
🦋 Changeset detectedLatest commit: 360796c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
There was a problem hiding this comment.
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
MappedActionListItemusage so item-levelrenderItemisn’t overwritten by the list-levelrenderItem. - 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
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>
Done in the latest commit. All three |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d0c576-838c-4b5b-bace-149cf54189ae
|
Integration test results from github/github-ui PR:
All checks passed! |
Closes github/primer#6891
This PR updates
FilteredActionListso that item-levelrenderItemcallbacks take precedence over the list-level fallback. Previously, the list renderer was applied after the item props and replaced an item renderer withundefinedwhen no list-level renderer was provided.Changelog
New
Changed
FilteredActionListto preserve item-level custom renderers across grouped, virtualized, and standard listsRemoved
Rollout strategy
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 buildnpm run type-checknpm test -- --run --exclude '.agents/**'npm run lint -- --ignore-pattern '.agents/**'npm run lint:css -- --ignore-pattern '.agents/**'npm run format:diff