Skip to content

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Aug 21, 2025

Note: This isn't a very good idea/implementation, i'm just exploring what's possible

  • Adds dev story for rendering 500 elements
  • Adds example story for rendering 50 items on open and then more items on scroll. Open story ↗
  • Known bug: Scroll resets to top when the items change. Works well when primer_react_select_panel_remove_active_descendant feature flag is on. Open story with feature flag on ↗

@siddharthkp siddharthkp self-assigned this Aug 21, 2025
Copy link

changeset-bot bot commented Aug 21, 2025

⚠️ No Changeset found

Latest commit: ba49415

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label Aug 21, 2025
@siddharthkp siddharthkp added the skip changeset This change does not need a changelog label Aug 21, 2025
Copy link
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-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 21, 2025
Copy link
Contributor

github-actions bot commented Aug 21, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.84 KB (0%)
packages/react/dist/browser.umd.js 89.99 KB (0%)

@siddharthkp siddharthkp changed the title SelectPanel story to load more items on scroll SelectPanel: Add story to load more items on scroll Aug 21, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6633 August 21, 2025 11:19 Inactive
@@ -765,6 +765,7 @@ function Panel({
onOpen={onOpen}
onClose={onClose}
overlayProps={{
id: id ? `${id}--dialog` : undefined,
Copy link
Member

Choose a reason for hiding this comment

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

Did you need to make this change to SelectPanel? Wondering if you could've passed an id from your story in overlayProps instead.

Copy link
Member Author

@siddharthkp siddharthkp Aug 21, 2025

Choose a reason for hiding this comment

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

You're right. Can do with just overlayProps. Updated!

Copy link
Member

Choose a reason for hiding this comment

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

Nice, thanks! Was wondering because if we wanted to go this route of loading more items on scroll, not having to modify SelectPanel here would mean we could do that today, without needing a primer/react update first.

Copy link
Member Author

@siddharthkp siddharthkp Aug 22, 2025

Choose a reason for hiding this comment

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

perfect! there is however another bug here :(

Scroll resets to top when the items change. Works well when primer_react_select_panel_remove_active_descendant feature flag is on. I've asked what's the rollout plan on slack

Copy link
Contributor

Choose a reason for hiding this comment

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

You should assume that FF to be on for this use case

@github-actions github-actions bot temporarily deployed to storybook-preview-6633 August 22, 2025 07:52 Inactive
@siddharthkp siddharthkp marked this pull request as ready for review August 22, 2025 09:52
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 09:52
@siddharthkp siddharthkp requested a review from a team as a code owner August 22, 2025 09:52
@siddharthkp siddharthkp requested a review from pksjce August 22, 2025 09:52
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 example stories to demonstrate SelectPanel performance with large datasets and implements a load-more-on-scroll feature. The changes explore rendering strategies for handling many items in SelectPanel components.

  • Adds a dev story that renders 500 items at once for performance testing
  • Implements an example story that initially loads 50 items and progressively loads more on scroll
  • Includes performance measurement timing to compare rendering approaches

Reviewed Changes

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

File Description
packages/react/src/SelectPanel/SelectPanel.examples.stories.tsx Adds RenderMoreOnScroll story with scroll-based pagination, performance measurement, and user controls
packages/react/src/SelectPanel/SelectPanel.dev.stories.tsx Adds LotsOfItems story for testing performance with 500 items and timing measurement

@siddharthkp siddharthkp added this pull request to the merge queue Aug 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2025
@siddharthkp siddharthkp added this pull request to the merge queue Aug 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2025
@francinelucca francinelucca added this pull request to the merge queue Aug 27, 2025
Merged via the queue into main with commit e669d7e Aug 27, 2025
43 checks passed
@francinelucca francinelucca deleted the selectpanel-perf-stories branch August 27, 2025 04:11
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 skip changeset This change does not need a changelog staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants