[Desktop Navigation] Add a dedicated Workspace filter to the Reports tab#59450
Conversation
There was a problem hiding this comment.
this is temporary right? eventually we need to fallback to something so that we display it for user. Something like "unknown" or simply policyID?
There was a problem hiding this comment.
related to above ☝️ if by any chance
policies[`${ONYXKEYS.COLLECTION.POLICY}${workspaceFilter}`]
is undefined, then we have no name and we display nothing
There was a problem hiding this comment.
withPermissionCheck sounds super generic and its not easy to know what permission we check.
Change the name to something related to what we are actually implementing. Example: typeFiltersKeysWith[Optional|Possible]Policy etc
There was a problem hiding this comment.
can we instead do something like:
const [firstArray, ...rest] = arrays;
return [key, [firstArray, policy, rest]? also it reads quit bad with the generic name firstArray. Maybe we can call it for what it is - like filtersConfig, filtersConfig element(s)?
There was a problem hiding this comment.
I renamed it to firstFiltersSection to indicate what it is related to
3c4d950 to
24ab5b1
Compare
|
@Expensify/design @flaviadefaria @mountiny Hey, it should be ready for testing, feel free to generate new builds and check if the new workspace filter works fine :) Tomorrow I'll put final touches on this PR and release it for review |
|
🚧 @dannymcclain has triggered a test app build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
I would think that if this is part of the updated LHB project, we should not be changing the header when a workspace is selected, right? |
|
Actually maybe that is expected for now, since the other PR is the one that updates the content/look of the header. So maybe ignore me! |
Yes, it's expected for now, the workspace icon will be removed in another PR :) |
289Adam289
left a comment
There was a problem hiding this comment.
LGTM. Left just one small comment. It may be possible that sanitize checks will be needed, but I wasn't able to find anything else.
There was a problem hiding this comment.
Workspace name can include space so running it through sanitizeSearchValue is necessary
|
@dukenv0307 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I think from a design perspective this is good to go 🚀 |
There was a problem hiding this comment.
We only use policies to get the name of specific policyID, so I think we should pass the policyName: string
There was a problem hiding this comment.
Hmm, I implemented it similarly to other filters, we pass the entire collection and extract data for specific ids/ids. Also, it will be useful when we implement a multiselect workspace filter
There was a problem hiding this comment.
I think it should be !queryJSON || ...
There was a problem hiding this comment.
Hmm, I am not sure if isCannedQuery should be true when !queryJSON, maybe I'll reuse code that I wrote in SearchTypeMenu.tsx
|
Looks good, just left some minor comments |
|
Awaiting for the feedback to be addressed |
a125f4b to
09f9c68
Compare
|
@dukenv0307 I replied to your comments, please check if it's ok now :) |
|
code looks good now |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-04-09.at.00.42.06.movAndroid: mWeb ChromeScreen.Recording.2025-04-09.at.00.39.38.moviOS: NativeScreen.Recording.2025-04-09.at.00.41.01.moviOS: mWeb SafariScreen.Recording.2025-04-09.at.00.38.36.movMacOS: Chrome / SafariScreen.Recording.2025-04-09.at.00.38.02.movMacOS: DesktopScreen.Recording.2025-04-09.at.00.45.09.mov |
|
LGTM |
mountiny
left a comment
There was a problem hiding this comment.
@WojtekBoman @dukenv0307 are there no unit tests to add for this new search option?
| /** | ||
| * A copy of `isDefaultExpensesQuery` handling the policy ID, used if you have access to the leftHandBar beta. | ||
| * When this beta is no longer needed, this method will be renamed to `isDefaultExpensesQuery` and will replace the old method. | ||
| * |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.25-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.25-4 🚀
|
I believe the logic of the new filter still needs to be adjusted, it will be done in the next [Desktop Navigation] PRs, so we'll add tests once the whole functionality is finished |
|
thanks |


Explanation of Change
This PR adds a new Workspace filter to the Reports tab. To display the new screen it's necessary to have access to the
leftHandBarbeta.Fixed Issues
$ #59366
PROPOSAL:
Tests
Precondition: You are logged in to an account with access to the
leftHandBarbetaWorkspacefrom the filters listView resultsOffline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-04-08.at.13.10.46.mov
Android: mWeb Chrome
Screen.Recording.2025-04-08.at.13.12.44.mov
iOS: Native
Screen.Recording.2025-04-08.at.13.28.47.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-04-08.at.13.03.52.mov
MacOS: Desktop
Screen.Recording.2025-04-08.at.13.08.05.mov