Skip to content

Exploration: Make SelectPanel item.id required - #6663

Closed
siddharthkp wants to merge 6 commits into
mainfrom
selectpanel-item-id-required
Closed

Exploration: Make SelectPanel item.id required#6663
siddharthkp wants to merge 6 commits into
mainfrom
selectpanel-item-id-required

Conversation

@siddharthkp

@siddharthkpsiddharthkp commented Aug 25, 2025

Copy link
Copy Markdown
Member

Caution

Breaking changes expected. Need to migrate instances in github/github before merging this. This might be a really big task, so we'd need to see how much time do we want to give this as part of v38 tasks

Notes:

Problem

  1. SelectPanel passes items to FilteredActionList which further passes them to ActionList
  2. Because of this implementation detail, it's became common practice in github/github to import ActionList item types to type items before passing them to SelectPanel (unfortunate because you aren't directly interacting with ActionList here, leaky type abstraction 😢)
  3. Because FilteredActionList used to internally use deprecated/ActionList (not anymore), there are a bunch of imports of ItemInput from deprecated/ActionList (backward compatible), both in primer/react and github/github-ui
  4. This means if we make item.id required for SelectPanel (in FilteredActionList), we get a lot of type errors because it doesn't match deprecated/ActionList types that folks are still using to type their items.

Solution

We need to break the problem into 2 parts

  1. (Make the change easier to make)
    • We should export item types from SelectPanel (re-exported from FilteredActionList)
    • update all the imports in primer/react
    • and github/github-ui (there are a bunch of these)
  2. (Make the easy change) Make item.id required and update instances where id is missing in items (very few of these)

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

Merge checklist

@siddharthkpsiddharthkp self-assigned this Aug 25, 2025
@changeset-bot

changeset-botBot commented Aug 25, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7a6475

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

This PR includes changesets to release 2 packages
NameType
@primer/reactMajor
@primer/styled-reactMajor

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 staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Aug 25, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 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-actionsBot requested a deployment to storybook-preview-6663 August 25, 2025 09:01 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6663 August 25, 2025 09:10 Inactive
@github-actions
github-actionsBot requested a deployment to storybook-preview-6663 August 25, 2025 09:54 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6663 August 25, 2025 10:08 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6663 August 25, 2025 10:25 Inactive
@siddharthkpsiddharthkp changed the title SelectPanel: Make item.id compulsory requiredExploration: Make SelectPanel item.id requiredAug 27, 2025
@siddharthkp

Copy link
Copy Markdown
MemberAuthor

Exploration complete, updated task list in https://github.com/github/primer/issues/5556 👍

@siddharthkp
siddharthkp deleted the selectpanel-item-id-required branch October 30, 2025 17:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@siddharthkp