-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-14] [$250] Reports - Long pressing on an item does not display "Deselect" option #60320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Triggered auto assignment to @NicMendonca ( |
🚨 Edited by proposal-police: This proposal was edited at 2025-04-15 20:01:04 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Reports - Long pressing on an item does not display "Deselect" option What is the root cause of that problem?In App/src/components/SelectionListWithModal/index.tsx Lines 119 to 120 in 89dadb3
App/src/components/Search/SearchList.tsx Lines 384 to 388 in 89dadb3
What changes do you think we should make in order to solve the problem?
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A -- UI issue What alternative solutions did you explore? (Optional)Result |
🚨 Edited by proposal-police: This proposal was edited at 2025-04-15 20:04:20 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Reports - Long pressing on an item does not display "Deselect" option What is the root cause of that problem?Here App/src/components/Search/SearchList.tsx Lines 384 to 387 in 1f5363b
we just have instead of App/src/components/SelectionListWithModal/index.tsx Lines 118 to 119 in 1f5363b
What changes do you think we should make in order to solve the problem?We should update this logic to <MenuItem
title={longPressedItem?.isSelected ? translate('common.deselect') : translate('common.select')}
icon={longPressedItem?.isSelected ? Expensicons.EmptySquare : Expensicons.CheckSquare} Updating the proposal to meet expected results #60320 (comment) title={longPressedItem?.isSelected ? translate('common.deselect') : translate('common.select')} We just need to add a check Just update this App/src/components/Search/SearchList.tsx Lines 160 to 161 in 0591b9c
logic to const handleLongPressRow = useCallback(
(item: SearchListItem) => {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (shouldPreventLongPressRow || !isSmallScreenWidth || item?.isDisabled || item?.isDisabledCheckbox || !isFocused) {
return;
}
if (selectionMode?.isEnabled) {
onCheckboxPress?.(item);
return;
}
setLongPressedItem(item);
setIsModalVisible(true);
},
[isFocused, isSmallScreenWidth, shouldPreventLongPressRow, selectionMode, onCheckboxPress],
); We can do the same on What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
PROPOSAL UPDATED
|
This comment has been minimized.
This comment has been minimized.
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Reports - Long pressing on an item does not display "Deselect" option What is the root cause of that problem?In SearchList, we currently lack the logic to display the “Deselect” option when an item is already selected App/src/components/Search/SearchList.tsx Lines 360 to 364 in 76d3b13
What changes do you think we should make in order to solve the problem?We should display either the "Select" or "Deselect" option based on longPressedItem?.isSelected, similar to how it’s handled here. App/src/components/Search/SearchList.tsx Lines 360 to 364 in 76d3b13
<MenuItem
title={longPressedItem?.isSelected ? translate('common.deselect') : translate('common.select')}
icon={longPressedItem?.isSelected ? EmptySquare : CheckSquare}
onPress={turnOnSelectionMode}
/> Note Note for C+: I'm not sure if this is valid as the initial proposal. I reported the bug here and previously provided a solution What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?I think the test is unnecessary here because we already have a test for it. But if we believe it's necessary, we can render the SearchList and simulate a long-press event, similar to how it's done in WorkspaceTagsTest What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Job added to Upwork: https://www.upwork.com/jobs/~021912294803414711441 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra ( |
@Expensify/design Can we have mock for this change? Since it was not present earlier. |
@shubham1206agra Here's an example from the Categories table https://expensify.slack.com/archives/C01GTK53T8Q/p1744378314184679?thread_ts=1744377560.307809&cid=C01GTK53T8Q |
Interesting. Once in select mode after long-pressing I wouldn't expect the same behavior. Curious to hear what @Expensify/design thinks here. We could change it to deselect, but in some ways I feel like the interaction shouldn't be triggered at all? Maybe it's easy to just change it to deselect though. |
This comment has been minimized.
This comment has been minimized.
Triggered auto assignment to @mollfpr, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@linhvovan29546 Thanks for reporting this issue. I checked with the team about the order of proposal and we don't consider proposals made in slack as of now. Link for reference. |
🚨 Edited by proposal-police: This proposal was edited at 2025-04-17 05:04:09 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Long pressing the item while selection mode is on still opens selection options. What is the root cause of that problem?Missing case here App/src/components/Search/SearchList.tsx Line 163 in 5209c95
What changes do you think we should make in order to solve the problem?Include the missing case to prevent any item long press interaction here. if (shouldPreventLongPressRow || !isSmallScreenWidth || item?.isDisabled || selectionMode?.isEnabled || item?.isDisabledCheckbox || !isFocused) { App/src/components/Search/SearchList.tsx Line 163 in 5209c95
Also implement the same for other pages like workspace Categories page, Tags page, etc...
And of-course some cleanup. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?NA What alternative solutions did you explore? (Optional)Alternatively we could toggle the selection on long press when selection mode is enabled. const handleLongPressRow = (item: SearchListItem) => {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (shouldPreventLongPressRow || !isSmallScreenWidth || item?.isDisabled || item?.isDisabledCheckbox || !isFocused) {
return;
}
if(selectionMode?.isEnabled){
onCheckboxPress?.(item);
return;
}
setLongPressedItem(item);
setIsModalVisible(true);
}; App/src/components/Search/SearchList.tsx Lines 160 to 170 in 5e7543e
And modify const handleLongPressRow = (item: TItem) => {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (!turnOnSelectionModeOnLongPress || !isSmallScreenWidth || item?.isDisabled || item?.isDisabledCheckbox || (!isFocused && !isScreenFocused)) {
return;
}
if(selectionMode?.isEnabled){
rest?.onCheckboxPress?.(item);
return;
}
setLongPressedItem(item);
setIsModalVisible(true);
if (onLongPressRow) {
onLongPressRow(item);
}
}; App/src/components/SelectionListWithModal/index.tsx Lines 80 to 91 in 5e7543e
Look for any other page which might need the same fix. Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
@shubham1206agra Thanks for the review! Just wondering, should we consider an automated test for this case? |
@shubham1206agra Sorry I am a little bit late to post a proposal.
So could you please take a look at my proposal. |
@linhvovan29546 Not really |
We're gonna get alignment in the design team first before we decide on proposals 😄 |
I think I generally agree with this? I don't feel strongly but I think this is what I would do. Otherwise yeah, we could just show the deselect option but that feels like overkill when a simple tap of the row would unselect it. |
In some apps long pressing in editing mode just toggles the selection like a normal tap. So that's another possibility. Don't think we need the menu is basically what I'm getting at. Happy to disable or just treat it as a tap. Let's hear what @dannymcclain thinks too |
I've asked a query to @shubham1206agra here. waiting for the reply. |
@ChavdaSachin I can't see the question. Can you please recheck? |
No overdue, the PR is still being worked on. |
PR is ready for review. |
if i remember correctly we have disabled long press on selected items on reports page and transaction rows, isn't that correct @shawnborton ? 🤔 @ChavdaSachin what does your PR do exactly? |
@allgandalf We are marking long press as regular press in different pages in workspace pages (like Distance Rates, Categories, Tags, Taxes and Report Fields) |
So this has nothing to do with |
I didn't get it honestly, so there would be no action if we long press after this PR? |
No worri we will include report page as well. Thanks for hoping in to remind us. |
I checked the staging - long press on reports page and transaction rows are working as expected (treating long press as regular click when selection mode is enabled). |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-05-14. 🎊 For reference, here are some details about the assignees on this issue:
|
@shubham1206agra @NicMendonca @shubham1206agra The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal Template
Regression Test ProposalPrecondition:Test:Do we agree 👍 or 👎 |
@NicMendonca This is not a bug, but a feature change request. Here is the test. Pre-requisites: A workspace with -Distance Rates, Categories, Tags, Taxes and Report Fields enabled.
|
Payment summaryContributor+: @shubham1206agra - $250 paid via NewDot |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.1.28-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @linhvovan29546
Slack conversation (hyperlinked to channel name): #expensify-opensource
Action Performed:
Select
Expected Result:
Should show "Deselect"
Actual Result:
Not displayed "Deselect"
Workaround:
unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Platforms Tested:
On which of our officially supported platforms was this issue tested:Screenshots/Videos
Add any screenshot/video evidence
Screen.Recording.2025-04-11.at.17.10.41.mov
NSHB7846.1.MP4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @NicMendoncaThe text was updated successfully, but these errors were encountered: