Skip to content

SelectPanel: Update SelectPanel to use modern ActionList - #4794

Merged
siddharthkp merged 68 commits into
mainfrom
select-panel-action-list
Sep 10, 2024
Merged

SelectPanel: Update SelectPanel to use modern ActionList#4794
siddharthkp merged 68 commits into
mainfrom
select-panel-action-list

Conversation

@broccolinisoup

@broccolinisoupbroccolinisoup commented Jul 30, 2024

Copy link
Copy Markdown
Member

Note

New feature flag introduced: primer_react_select_panel_with_modern_action_list

What's changed

This is a pretty scary PR to roll out as it is replacing ActionList used internally in SelectPanel, that is why we are putting everything behind a feature flag (see FilteredActionList "entry file").

  • There should be no change without the feature flag enabled
  • Jest tests added for both states of the feature flag
  • VRT snapshots added for both states of the feature flag
  • Some accessibility remediations that were made to ActionList and not deprecated/ActionList do cause certain tests to fail in dotcom CI. I have a PR for dotcom updating tests that works with both states of the feature flag (can be merged independently)

Rollout strategy

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

Merge checklist

Integration tests:

@changeset-bot

changeset-botBot commented Jul 30, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0b57206

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

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

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-actionsgithub-actionsBot added the staff Author is a staff member label Jul 30, 2024
@broccolinisoupbroccolinisoup changed the title super wipIgnore - super wip selectpanelJul 30, 2024
Comment threadpackages/react/src/FilteredActionList/FilteredActionList.tsx Outdated
@github-actions

github-actionsBot commented Jul 30, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js96.86 KB (+0.46% 🔺)
packages/react/dist/browser.umd.js97.18 KB (+0.55% 🔺)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4794 July 31, 2024 05:35 Inactive
@broccolinisoupbroccolinisoup added the skip changeset This change does not need a changelog label Jul 31, 2024
@broccolinisoupbroccolinisoup changed the title Ignore - super wip selectpanelSelectPanel: Update SelectPanel to use modern ActionListAug 1, 2024

@camertroncamertron 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.

Awesome, nice work! As far as groups go, it looks like both the beta and deprecated versions of ActionList support them. Maybe we could create a sub-component called MappedActionListGroup? Then we could do something like:

functionMappedActionListGroup({ items, header }: GroupProps){return(<ActionList.Group><ActionList.GroupHeadingvariant={header.variant}>{header.title}</ActionList.GroupHeading>{items.map((item)=><MappedActionListitem={item}>)}</ActionList.Group>)}

text,
variant,
disabled,
trailingVisual: TrailingVisual,

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.

I'm not sure if this is a common pattern, but I personally find it a bit confusing to use TitleCase for these renamed variables. Can we avoid renaming them, or name them something else, eg. originalTrailingVisual?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👋

the TitleCase is so that we can render them as a component in JSX

prop accepted as leadingVisual, rendered in the body as <LeadingVisual/>, it would have been nicer if the prop was already TitleCased to signal that it accepts a component (and not a string, for example), but probably not the correct time to change that here

Comment threadpackages/react/src/FilteredActionList/FilteredActionList.tsx Outdated
@primer-integration

primer-integrationBot commented Aug 28, 2024

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/339537

Update: These tests are passing

@siddharthkp

siddharthkp commented Aug 28, 2024

Copy link
Copy Markdown
Member

Next steps:

@siddharthkp

siddharthkp commented Aug 30, 2024

Copy link
Copy Markdown
Member

Next steps:

  • Get PR review
  • (non blocker) Need to debug unrelated visual changes (this PR introduces the tiniest change in contrast that doesn't matter in the long run, but would be nice to pin down)

@joshblackjoshblack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Just had a question

if (activeDescendantRef.current && scrollContainerRef.current) {
scrollIntoView(activeDescendantRef.current, scrollContainerRef.current, {...menuScrollMargins, behavior: 'auto'})
}
}, [items])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is items a memoized value or is a plain value typically?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

They are memoized in SelectPanel before passing to FilteredActionList. Tell me more?

@joshblack

Copy link
Copy Markdown
Member

Also wanted to leave a question, would it be possible for this to go in the next release batch? (I think it would be rc.5)

Would help out a ton on my end, the release is starting to get big 😅

@siddharthkp

siddharthkp commented Sep 9, 2024

Copy link
Copy Markdown
Member

Also wanted to leave a question, would it be possible for this to go in the next release batch? (I think it would be rc.5)

Absolutely! I can wait :)

Update: rc.4 was merged yesterday, can merge this now 🎉

@camertroncamertron mentioned this pull request Sep 9, 2024
12 tasks
@primerprimerBot mentioned this pull request Sep 10, 2024
@broccolinisoup

Copy link
Copy Markdown
MemberAuthor

So happy to see this is merged!! Thanks @siddharthkp 🥹 💖

@primerprimerBot mentioned this pull request Oct 18, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@broccolinisoup@siddharthkp@joshblack@camertron