Navigate to room members page after inviting a user#91489
Conversation
After tapping Invite, the RHP was closing because inviteUsers() navigated to backTo (the pre-Members route) or REPORT_WITH_ID (the chat). Replace with backRoute, which already correctly resolves to ROOM_MEMBERS for policy employees or REPORT_WITH_ID_DETAILS for non-policy members — matching the header back button behavior. Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
@MelvinBot review why the |
|
@MelvinBot complete the checklist and test steps, and mark screenshots as done since they’ll be added in the reviewer checklist. |
History & Regression AnalysisThe old Why that old behavior is now wrong: The Is the current change safe? Yes, with one nuance:
The change is safe because:
Potential concern: Users won't land directly on the report chat to see the whisper after inviting. They'll land on the members list instead. This is a UX trade-off (staying in context vs. seeing the whisper), but the issue reporter and expected behavior explicitly state users should return to the members page. |
Explanation of Change
After tapping "Invite" on the Room Invite page,
inviteUsers()navigated tobackTo(the route before the Members page) or fell back toROUTES.REPORT_WITH_ID(the chat report). Both destinations sit outside the RHP modal stack, so the entire RHP closed instead of returning to the Members list.The fix replaces this branching with a single
Navigation.goBack(backRoute, {afterTransition})call — reusing thebackRouteconstant already computed and used by the header back button. This correctly routes toROUTES.ROOM_MEMBERSfor policy employees, orROUTES.REPORT_WITH_ID_DETAILSfor non-policy members / archived rooms.Fixed Issues
$ #91410
PROPOSAL: #91410 (comment)
Tests
Offline tests
N/A — navigation-only change, no network dependency.
QA Steps
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
Screenshots will be added by the reviewer during the review process.