You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-04-20] Update /join-workspaces modal during onboarding #86192
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:
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.
Add "Show more" state — Add a useState boolean (e.g. showAll, default false) to track whether the full list is visible.
Slice the list — When !showAll and there are more than 5 items, pass only the first 5 items to SelectionList's data prop.
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.
[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.
@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?
Activity
dylanexpensify commentedon Mar 24, 2026
@MelvinBot can you propose how you'd solve this?
MelvinBot commentedon Mar 24, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The
/join-workspacesonboarding 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), thepolicyIDItemsarray is built directly fromObject.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 toSelectionList.What changes do you think we should make in order to solve the problem?
All changes are in
BaseOnboardingWorkspaces.tsx: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.Add "Show more" state — Add a
useStateboolean (e.g.showAll, defaultfalse) to track whether the full list is visible.Slice the list — When
!showAlland there are more than 5 items, pass only the first 5 items toSelectionList'sdataprop.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 offooterContent, above the existing "Skip" button) that setsshowAlltotrue. Once expanded, the button is hidden and all items are shown.What alternative solutions did you explore? (Optional)
SelectionList:SelectionListdoesn't natively support "show more" truncation, so managing it via state + array slicing before passingdatais the straightforward approach.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.mkhutornyi commentedon Mar 24, 2026
@dylanexpensify can you please update screenshots in OP? They're broken (or not accessible).
melvin-bot commentedon Mar 27, 2026
@mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Mar 27, 2026
@mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Mar 31, 2026
@mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Mar 31, 2026
@mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
dylanexpensify commentedon Apr 1, 2026
@mkhutornyi yes, sorry!
dylanexpensify commentedon Apr 1, 2026
@mkhutornyi can you confirm those work?
mkhutornyi commentedon Apr 1, 2026
works now. thanks
20 remaining items
melvin-bot commentedon Apr 16, 2026
@mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Apr 19, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Apr 20, 2026
@mkhutornyi plz complete the BZ checklist and tag me in a post once you have. Thx
mkhutornyi commentedon Apr 20, 2026
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:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-1916-ae4e-7e0c-8c3cf732af14mkhutornyi commentedon Apr 20, 2026
@mallenexpensify checklist completed
melvin-bot commentedon Apr 20, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Apr 21, 2026
Payment Summary
Contributor+: @mkhutornyi due $250 via NewDot
^ Test case created
Thx
m-natarajan commentedon Apr 21, 2026
@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 workspaceswhich we don't have access. Can you please suggest any workaround for this?mkhutornyi commentedon Apr 21, 2026
@m-natarajan In https://tempmail.so, keep changing address until domain becomes @mailshan.com which has 15 workspaces
trjExpensify commentedon May 6, 2026
approved $250 for @mkhutornyi