fix: turn off selection mode when unmounting#47994
fix: turn off selection mode when unmounting#47994youssef-lr merged 5 commits intoExpensify:mainfrom
Conversation
|
@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] |
src/hooks/useMobileSelectionMode.ts
Outdated
| } | ||
| turnOffMobileSelectionMode(); | ||
| }; | ||
| // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Why should we disable lint here?
There was a problem hiding this comment.
do we want to include the autoTurnOff flag as a dependency here?
|
@dominictb As we already had logic to trigger App/src/pages/ReportParticipantsPage.tsx Line 322 in af98a53 and other similar places. |
|
We can use the custom hook in SelectionListWithModal, then remove the following logic: |
|
@dukenv0307 if you press back button, it will exit the selection mode first. Then press the button again -> the user will be navigated to the previous page. I think it's intentional to be like that, hence I didn't remove. |
| }; | ||
|
|
||
| useEffect(() => turnOffMobileSelectionMode(), []); | ||
| useMobileSelectionMode(true); |
There was a problem hiding this comment.
| useMobileSelectionMode(true); | |
| const {selectionMode} = useMobileSelectionMode(); |
Then remove const [selectionMode] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE);
|
2 minor comments |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-30.at.10.10.21.movAndroid: mWeb ChromeScreen.Recording.2024-08-30.at.10.10.21.moviOS: NativeScreen.Recording.2024-08-30.at.10.16.27.moviOS: mWeb SafariScreen.Recording.2024-08-30.at.10.14.17.movMacOS: Chrome / SafariScreen.Recording.2024-08-30.at.10.04.59.movMacOS: DesktopScreen.Recording.2024-08-30.at.10.19.06.mov |
|
LGTM |
src/hooks/useMobileSelectionMode.ts
Outdated
| const [selectionMode] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE); | ||
|
|
||
| useEffect(() => { | ||
| return () => { |
There was a problem hiding this comment.
Ah, I think we need to turnOffMobileSelectionMode when the component mount
|
LGTM and tests well |
|
✋ 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/youssef-lr in version: 9.0.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.27-1 🚀
|
Details
Fixed Issues
$ #47685
PROPOSAL: #47685 (comment)
Tests
Verify that: Selection mode will not be shown in Tags page.
Offline tests
QA Steps
Verify that: Selection mode will not be shown in Tags page.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
compressed_android.webm.mp4
Android: mWeb Chrome
compressed_aweb.webm.mp4
iOS: Native
ios.copy.mp4
iOS: mWeb Safari
ios.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
web.mov