Toggle selection with long press when selection mode is enabled#60595
Conversation
|
@dubielzyk-expensify currently there are two different checkmark icons are being used. Categories, Tags, Members, Etc...(with box) Could you confirm if all pages should use the same icon for checkmark? if yes, then which? |
|
Interesting. Didn't know that. Great catch 👍 I would think we'd use the boxy one, but I'll defer to @dannymcclain here and maybe @shawnborton has some opinions too. |
|
Agree, I think the boxier one makes more sense but let's let El Rey De Los Icons give us the final ruling here. |
🤣 The square check (box) is the correct one for this! |
|
@shubham1206agra this is what it looks like from my end. |
src/components/Search/SearchList.tsx
Outdated
| return; | ||
| } | ||
| if (isSmallScreenWidth && selectionMode?.isEnabled) { | ||
| onCheckboxPress?.(item); |
There was a problem hiding this comment.
@ChavdaSachin You don't need to touch this code as this was implemented in #60800
There was a problem hiding this comment.
Merge main and fix this conflict
There was a problem hiding this comment.
@ChavdaSachin Please don't remove this. Since it might be used later somewhere else.
There was a problem hiding this comment.
I did this as per your suggestion but now there's a lint error.
Should I again remove that file and perform relevant cleanup?
|
@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] |
src/components/Search/SearchList.tsx
Outdated
| }, | ||
| [isFocused, isSmallScreenWidth, shouldPreventLongPressRow], | ||
| ); | ||
| const handleLongPressRow = (item: SearchListItem) => { |
There was a problem hiding this comment.
@shubham1206agra could I add a lint ignore comment here?
previously handleLongPressRow was wrapped with useCallback hook, but currently I had to remove useCallback in-order to make it work.
the problem: if handleLongPressRow is wrapped in useCallback, it would memoize the function and would return the memoized version which would lead to a bug -
- go to search page(small screen device)
- turn on selection mode
- long press a few items
- notice as soon as third item is selected, second item is unselected due to memoized version of the function.
two possible solution:
- add lint ignore comment
- remove useCallback from renderItem function(which is not ideal)
cc. @mollfpr
There was a problem hiding this comment.
I did this as per your suggestion but now there's a lint error.
Should I again remove that file and perform relevant cleanup?
This reverts commit a37ad52.
|
Thanks @shubham1206agra. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-05-03.at.12.09.04.PM.movAndroid: mWeb ChromeScreen.Recording.2025-05-03.at.11.54.56.AM.moviOS: HybridAppScreen.Recording.2025-05-03.at.12.01.54.PM.moviOS: mWeb SafariScreen.Recording.2025-05-03.at.11.50.44.AM.movMacOS: Chrome / SafariNA MacOS: DesktopNA |
|
✋ 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/mollfpr in version: 9.1.40-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.1.40-7 🚀
|



Explanation of Change
Fixed Issues
$ #60320
PROPOSAL: #60320 (comment)
Tests
Same as QA
There are a few console errors relevant to 'canBeMissing' but those are irrelevant to this PR.
Offline tests
Same as QA.
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Note
these tests are only for small screen devices.
Pre-requisites: A workspace with -Distance Rates, Categories, Tags, Taxes and Report Fields enabled.
workspace -> memberspage.selectwhen popover menu is visible.workspace -> Distance Rates,workspace -> Categories,workspace -> Tags,workspace -> Taxesandworkspace -> Report Fields.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-05-02.at.12.45.45.AM.mov
Android: mWeb Chrome
Screen.Recording.2025-05-02.at.12.50.43.AM.mov
iOS: Native
Screen.Recording.2025-05-02.at.2.17.16.AM.mov
iOS: mWeb Safari
Screen.Recording.2025-05-02.at.2.21.17.AM.mov
MacOS: Chrome / Safari
MacOS: Desktop