Skip to content

[Due for payment 2026-04-01] [TRACKING] Split SelectionList into smaller, purpose-built list components #65212

Closed
7 of 7 issues completed

Description

@mountiny

coming from here

Proposal

Split SelectionList into smaller, purpose-built list components

Strategy

Expensify’s blue ocean strategy depends on shipping features quickly without destabilising the app. Engineering velocity directly improves Free Cash Flow by reducing time spent on regressions and long PR cycles. Refactoring a critical UI primitive will shorten future feature lead-time and lower maintenance cost per customer seat.

Background

The highly adaptable SelectionList component is based on React Native’s SectionList, which demonstrates its flexibility for various purposes. It has become very complex, supporting over 90 properties and being used in 107 different components. This design was aimed at reducing repetition and covers many functionalities, making it a central component of many projects. On the other hand, developers often have to work with its many settings to make changes, which can easily cause regressions in some use cases. This complexity means there’s a lot for new developers to learn about how to use and integrate the component. A similar change was done recently where the refactoring of the SearchList sped up its rendering by 1.5 seconds (almost 40% improvement).

Problem

When a developer changes list behaviour in SelectionList, they modify a 90+ prop monolith referenced by 107 components, which frequently causes regressions and lengthens feature delivery time.

Solution

Break the current SelectionList down into several smaller, more focused components. Each component will be designed for a group of similar cases, making them simpler and more streamlined. This approach will reduce the complexity of each component, remove unnecessary props and simplify the operations inside. The plan for this refactoring involves the following steps:

  1. Audit usage across all 107 components to identify clusters of similar configurations and usage patterns.
  2. Define smaller components for each identified cluster, with logic and props needed only for the specific case.
  3. Gradual migration strategy - Introduce new components incrementally and replace existing SelectionList usages one by one to avoid large-scale disruption.
  4. Clean-up - Once all usages have been migrated, remove the original SelectionList.
  5. Define guidelines for contributor on how to decide when to create a new list and when it's still ok to update existing list knowing it will make it "heavier" and more compled

Advantages
This will result in:

  • Improved performance: Fewer props and conditional branches will result in faster rendering and fewer re-renders.
  • Better maintainability: Changes are isolated and the risk of regression is much smaller. Also testing will be faster as there would be less cases to check.
  • Simpler debugging: Smaller, more specific components are easier and faster to understand and troubleshoot.
Issue Owner

Current Issue Owner: @JmillsExpensify

Activity

  1. melvin-bot commented on Jun 30, 2025

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

  2. mountiny commented on Jun 30, 2025

    @mountiny
    ContributorAuthor

    Looking for internal engineer to help with this but @zfurtak I believe you can start looking into ways to split this up, make sure to create this in small PRs that are easy to test and review please. Thanks!

  3. zfurtak commented on Jul 1, 2025

    @zfurtak
    Contributor

    I've been thinking about how to get this issue started, and I've come up with a plan:

    So, what is the plan? ✨

    So far, I've looked into which components use the SelectionList, and it turns out that around 80%(!!) of its usage doesn't involve sections (more details here). I'd suggest taking it one step at a time.

    What would be the first step?

    First things first, I would create a new list component that doesn't involve sections. This could then be used in all relevant cases. Once that's in place, we could check potential performance improvements in more complex scenarios — there's a good chance the gains might already be significant at that stage. 🚀
    Next, we could make a list of components to update so that they use the new list. From there, we can start creating pull requests iteratively, refactoring one component per PR. This would make it easy to divide the work among developers and reduce the risk of regressions.
    Later on, we could consider a more detailed breakdown into specialised components, using the new universal list as a base — in line with the DRY principle.

    What about the components that need sections?


    After we've dealt with the non-section use cases, we can then focus on making the ones involving sections better. One approach could be to group them based on how they are used, making it easier to design specialised components. We could also optimise the SelectionList (or create a new one), it will be possible and easier as there will be only 25 usages left to cover (instead of 125).

    Let me know what do you think 😊

  4. mountiny commented on Jul 5, 2025

    @mountiny
    ContributorAuthor

    That sounds good to me

  5. mountiny commented on Jul 7, 2025

    @mountiny
    ContributorAuthor

    @zfurtak 👋 Georgia @grgia will help you push this ahead from internal side

  6. grgia commented on Jul 7, 2025

    @grgia
    Contributor

    @zfurtak, the plan sounds good. Could you please break it down into a bulleted list representing each piece of the plan (in the smallest PRs possible) for me? I'm sure you know, ideally we'd want to avoid any massive PRs since they are easy to revert 😁

  7. 128 remaining items

  8. changed the title [-][TRACKING] Split SelectionList into smaller, purpose-built list components[/-] [+][Due for payment 2026-04-01] [TRACKING] Split SelectionList into smaller, purpose-built list components[/+] on Mar 25, 2026
  9. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  10. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.43-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-04-01. 🎊

    For reference, here are some details about the assignees on this issue:

    • @zfurtak does not require payment (Contractor)
  11. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@zfurtak] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
    • [] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
  12. melvin-bot commented on Apr 1, 2026

    @melvin-bot

    Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

  13. JmillsExpensify commented on Apr 7, 2026

    @JmillsExpensify
    Contributor

    Pretty sure we're all good here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionNewFeatureSomething to build that is a new item.WeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions