Skip to content

[Due for payment 2026-04-20] Update /join-workspaces modal during onboarding #86192

Closed

Description

@MelvinBot

Coming from Expensify/Expensify#610291, let's update the onboarding modal /join-workspaces to:

  • Sort the available options by member count (descending)
  • Hide any workspaces beyond 5 behind a "Show more" button

Mocks

Final approved design (Figma file):

Image Image Image
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. dylanexpensify commented on Mar 24, 2026

    @dylanexpensify
    Contributor

    @MelvinBot can you propose how you'd solve this?

  2. MelvinBot commented on Mar 24, 2026

    @MelvinBot
    ContributorAuthor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The /join-workspaces onboarding modal currently displays available workspaces in an arbitrary order (whatever the API returns) and shows all of them at once regardless of how many there are. We need to sort them by member count (descending) and hide any beyond 5 behind a "Show more" button.

    What is the root cause of that problem?

    In src/pages/OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx (line 101), the policyIDItems array is built directly from Object.values(joinablePolicies) with no sorting applied — Object.values() yields whatever order the Onyx record has. There is also no truncation or "Show more" logic; the entire array is passed straight to SelectionList.

    What changes do you think we should make in order to solve the problem?

    All changes are in BaseOnboardingWorkspaces.tsx:

    1. Sort by member count — Chain .sort((a, b) => b.employeeCount - a.employeeCount) before the .map(...) on line 101 so workspaces with the most members appear first.

    2. Add "Show more" state — Add a useState boolean (e.g. showAll, default false) to track whether the full list is visible.

    3. Slice the list — When !showAll and there are more than 5 items, pass only the first 5 items to SelectionList's data prop.

    4. Add "Show more" button — When there are more than 5 workspaces and !showAll, render a "Show more" pressable below the list (e.g. as part of footerContent, above the existing "Skip" button) that sets showAll to true. Once expanded, the button is hidden and all items are shown.

    What alternative solutions did you explore? (Optional)

    • Server-side sorting: Could sort in the API response, but client-side sorting is simpler and keeps the change self-contained in the App.
    • Pagination via SelectionList: SelectionList doesn't natively support "show more" truncation, so managing it via state + array slicing before passing data is the straightforward approach.

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. mkhutornyi commented on Mar 24, 2026

    @mkhutornyi
    Contributor

    @dylanexpensify can you please update screenshots in OP? They're broken (or not accessible).

  4. melvin-bot commented on Mar 27, 2026

    @melvin-bot

    @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. melvin-bot commented on Mar 27, 2026

    @melvin-bot

    @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!

  6. melvin-bot commented on Mar 31, 2026

    @melvin-bot

    @mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  7. melvin-bot commented on Mar 31, 2026

    @melvin-bot

    @mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  8. dylanexpensify commented on Apr 1, 2026

    @dylanexpensify
    Contributor

    @mkhutornyi yes, sorry!

  9. dylanexpensify commented on Apr 1, 2026

    @dylanexpensify
    Contributor

    @mkhutornyi can you confirm those work?

  10. mkhutornyi commented on Apr 1, 2026

    @mkhutornyi
    Contributor

    works now. thanks

  11. 20 remaining items

  12. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  13. melvin-bot commented on Apr 19, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. mallenexpensify commented on Apr 20, 2026

    @mallenexpensify
    Contributor

    @mkhutornyi plz complete the BZ checklist and tag me in a post once you have. Thx

  15. mkhutornyi commented on Apr 20, 2026

    @mkhutornyi
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: new feature

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/626806

    Regression Test Proposal

    Test:

    1. Log in with an private-domain account that has access to more than 5 joinable workspaces
    2. Navigate to the join workspaces onboarding step
    3. Verify workspaces are sorted by member count (highest first)
    4. Verify only the first 5 workspaces are visible
    5. Verify a "Show more" button appears below the list
    6. Click "Show more" and verify all workspaces are now visible
    7. Verify the "Show more" button disappears after clicking it
    8. Verify the "Skip" button remains visible at all times
    9. Log in with an account that has 5 or fewer joinable workspaces
    10. Verify no "Show more" button is shown
    11. Verify all workspaces are displayed and sorted by member count

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-1916-ae4e-7e0c-8c3cf732af14
  16. mkhutornyi commented on Apr 20, 2026

    @mkhutornyi
    Contributor

    @mallenexpensify checklist completed

  17. melvin-bot commented on Apr 20, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  18. mallenexpensify commented on Apr 21, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @mkhutornyi due $250 via NewDot

    ^ Test case created

    Thx

  19. m-natarajan commented on Apr 21, 2026

    @m-natarajan

    @mkhutornyi This is regarding the regression test proposal
    We are blocked from executing these steps as this requires Log in with an private-domain account that has access to more than 5 joinable workspaces which we don't have access. Can you please suggest any workaround for this?

  20. mkhutornyi commented on Apr 21, 2026

    @mkhutornyi
    Contributor

    @m-natarajan In https://tempmail.so, keep changing address until domain becomes @mailshan.com which has 15 workspaces

    Image
  21. trjExpensify commented on May 6, 2026

    @trjExpensify
    Contributor

    approved $250 for @mkhutornyi

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 productionDailyKSv2ImprovementItem broken or needs improvement.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions