Repository navigation
Open the Search row long-press menu from the global modal stack - #105112
Conversation
Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
The failing Analysis: One measurement failed: Evidence
|
|
🤖 Android test steps verification results: ✅ pass On Android, long-pressing a Search expense row still opens the "Select" menu, "Select" turns on selection mode with that row selected, and long-press in selection mode toggles rows directly. Dismissing the menu with Back leaves selection mode off, so no user-visible regression was seen.
|
|
@MelvinBot in |
Selection mode turns on while the menu fades out, as it did before the migration. closeModal still runs from onModalHide, so the entry leaves the stack only after the menu has hidden. Co-authored-by: daledah <daledah@users.noreply.github.com>
|
Done in 5cae58f. "Select" now turns on selection mode right away, like before.
Checks run
The PR description's "Behavior note" still says selection turns on after the menu hides. I couldn't edit it from this run, so please update it to say selection turns on as soon as "Select" is pressed. |
…owLongPressMenuToGlobalModal Co-authored-by: daledah <daledah@users.noreply.github.com>
Co-authored-by: daledah <daledah@users.noreply.github.com>
|
Fixed the failing Cause: Fix: I merged I couldn't run typecheck or lint locally in this environment, so CI will confirm the fix. I ignored |
Co-authored-by: daledah <daledah@users.noreply.github.com>
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Fixed the failing Cause: My previous commit removed Fix: I reformatted that statement to match oxfmt's output. I ignored |
|
@MelvinBot please fill Tests section |
|
I filled in the Tests section of the PR description. The steps cover these cases on a narrow layout:
I also updated the stale "Behavior note" and the two wrapper descriptions. They now say "Select" turns on selection mode on press. Offline tests and QA Steps are still empty for you to fill in. I didn't run these steps here, because the web test browser can't long-press. An earlier Android run passed steps 1–7 and 9–11, but that was before the latest wrapper change. |
|
@MelvinBot please open this PR |
|
Done. This PR is now marked as ready for review. QA Steps and Offline tests are still empty in the description, so please fill them in, or add "[No QA]" to the title if QA isn't needed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer Checklist
Screenshots/VideosiOS: HybridAppios.moviOS: mWeb Safariios-mweb.movMacOS: Chrome / Safariweb.mov |
|
@MelvinBot i've completed my checklist, please complete the author checklist |
|
I completed the PR Author Checklist. Every box is now checked. I also filled in the two empty sections:
The author's Screenshots/Videos section is still empty. Your iOS and MacOS videos are in your reviewer checklist comment. If you want them in the description too, please copy them there or ask me to. The failing |
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
This PR failing because of the issue #105824 |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.31-0 🚀
|
|
No help site update needed — this PR refactors how the existing long-press selection menu opens without changing the user workflow or making existing article instructions incorrect. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀
Bundle Size Analysis (Sentry): |





Explanation of Change
useRowLongPressMenukept the menu's visibility and the pressed row in local state, then returned amodalelement that each of the five Search views had to render. This PR opens the menu from the global modal stack instead. It follows the pattern from the hold/reject educational modal migration:src/components/Modalstays pure UI, and the caller chains its own follow-up off theshowModalpromise. There is no intended user-visible change.src/components/Modal/Global/MobileSelectionMenuModalWrapper.tsxrenders the bottom-docked "Select" menu. It takessentryLabelas a prop and has no Search imports, so the Table and report transaction long-press migrations can reuse it. It resolvesCONFIRMas soon as the user picks "Select" andCLOSEotherwise. It callscloseModalonce, fromonModalHide, after the hide animation ends.src/hooks/useMobileSelectionMenuModal.ts, modeled onuseConfirmModal, exposesshowMobileSelectionMenuModal({id?, sentryLabel?}).useRowLongPressMenu: the modal state and the returnedmodalare gone. All existing guards stay: route focus,shouldPreventLongPressRow, narrow layout, disabled rows and checkboxes, and pending delete. The hook then shows the menu withCONST.SENTRY_LABEL.SEARCH.SELECTION_MODE_MENU_ITEM. OnCONFIRMit runsturnOnMobileSelectionMode()andtoggle(item, itemTransactions). In mobile selection mode a long press still toggles the row directly. The file is now.ts, because it no longer contains JSX.useSearchListViewStateno longer returnsmodal, and the five views (ExpenseFlatSearchView,ExpenseReportSearchView,ExpenseGroupedSearchView,ChatSearchView,TaskSearchView) no longer render{modal}.Behavior note: selection mode still turns on as soon as "Select" is pressed, like before. The wrapper resolves the promise on press and removes the menu from the modal stack only after the hide animation ends.
AI tests run locally:
npm run typecheck: passed.npm run lint-changed: passed.npm run spell-changed: passed.react-compiler-compliance-check checkon the changed source files: passed.oxfmt(npm run fmt): only the changed files were affected.tests/unit/components/MobileSelectionMenuModalWrapperTest.tsxrenders the real menu. It checks that "Select" resolvesCONFIRMon press and pops the entry only after the hide animation, that dismissing resolvesCLOSE, that the entry pops only once, and that nothing pops while the menu is visible.tests/unit/Search/useRowLongPressMenuTest.tsxruns insideModalProvider. It covers confirm, dismiss, toggling directly in selection mode, the Sentry label, and every guard.tests/unit/Search, the Search unit suites andtests/ui/Search*: all passed (80 + 8 suites).Fixed Issues
$ #103509
PROPOSAL: #103509 (comment)
Tests
Use a narrow layout: a mobile device, or a browser window resized to mobile width. Have at least 2 expenses.
Offline tests
Same as tests. Step 15 covers the offline case: a row that is pending delete opens no menu.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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