Hide rooms the user has left from the workspace rooms list#92198
Hide rooms the user has left from the workspace rooms list#92198sumo-slonik wants to merge 2 commits into
Conversation
Leaving a room optimistically closes it (statusNum CLOSED) and strips its reportID. The workspace rooms list still showed the closed room because policyChatRoomsSelector only filtered by policy, chat type, and archival, so tapping the row navigated to a "not here" page. Skip closed reports in policyChatRoomsSelector. This covers the offline leave case and the online optimistic window, without hiding unjoined rooms (still open) or workspace rooms the admin left (only notification hidden). Fixes Expensify#92031
…/92031-rooms-left-offline-clickable
4d348da to
7f953c5
Compare
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@shubham1206agra 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f953c55ed
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (isClosedReport(report)) { | ||
| continue; |
There was a problem hiding this comment.
Filter hidden room membership on offline leave
In the actual private-room leave flow, isWorkspaceMemberLeavingWorkspaceRoom() is true for restricted workspace rooms when the user is still a policy employee, so leaveRoom() only merges the current user's participant notificationPreference to hidden and does not set statusNum to CLOSED. Because this selector only skips closed reports, leaving a private workspace room while offline still leaves it visible in Workspace > Rooms until a server update arrives, so the offline regression described by this change remains.
Useful? React with 👍 / 👎.
Explanation of Change
Skip closed reports in
policyChatRoomsSelector. Covers both the offline leave and the online optimistic window, and doesn't hide unjoined rooms (still open) or admin-left rooms (only notification preference changes,statusNumunchanged).Fixed Issues
$ #92031
PROPOSAL:
Tests
workspaceRoomsPagebeta.Offline tests
workspaceRoomsPagebeta and create a private room.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))npm run compress-svg)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari