Skip to content

[Due for payment 2025-05-27] [Due for payment 2025-05-08] [$250] Distance rates - User goes to rate details when tapping on it in multiselect mode #58696

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.1.15-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5766860
Email or phone of affected tester (no customers): sustinov@applausemail.com
Issue reported by: Applause Internal Team
Device used: OnePlus 9 PRO/Android 14/Chrome, iPhone 12 PRO/iOS 18.3.1
App Component: Workspace Settings

Action Performed:

Prerequisites:
Create a WS, in the WS settings enable Distance rates, create multiple rates

Steps:

  1. Open Hybrid ND app
  2. Log in as a user with a configured WS
  3. Navigate to the WS settings
  4. Navigate to Distance rates
  5. Long press on any rate to activate multiselection
  6. Tap in the middle on any rate

Expected Result:

When you click on a rate in multiselect mode, that rate should select, not go to its details

Actual Result:

User goes to rate details when tapping on it in multiselect mode. In categories and tags, this field is selected when you tap on the field itself

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021902356609676349283
  • Upwork Job ID: 1902356609676349283
  • Last Price Increase: 2025-04-02
  • Automatic offers:
    • allgandalf | Reviewer | 106824264
    • abzokhattab | Contributor | 106824265
Issue OwnerCurrent Issue Owner: @maddylewis

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 19, 2025
  2. melvin-bot commented on Mar 19, 2025

    @melvin-bot

    Triggered auto assignment to @maddylewis (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. nkdengineer commented on Mar 19, 2025

    @nkdengineer
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    User goes to rate details when tapping on it in multiselect mode. In categories and tags, this field is selected when you tap on the field itself

    What is the root cause of that problem?

    We are navigating when click the distance rate row

    const openRateDetails = (rate: RateForList) => {
    Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATE_DETAILS.getRoute(policyID, rate.value));
    };

    What changes do you think we should make in order to solve the problem?

    We should add the condition like in the category page here

            if (isSmallScreenWidth && selectionMode?.isEnabled) {
                toggleRate(rate);
                return;
            }
    

    Note: We can fix the other page if it get the same bug

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    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.

  4. github-actions commented on Mar 19, 2025

    @github-actions
    Contributor

    ⚠️ @abzokhattab Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  5. abzokhattab commented on Mar 19, 2025

    @abzokhattab
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-03-19 10:51:54 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In multi-selection mode inside the distance rates, tapping on a row triggers navigation to the details page, when the expected behavior is to simply toggle the selection state.

    What is the root cause of that problem?

    The selectRow function inside the selection modal always triggers navigation to the details page, even in multi-selection mode, without checking whether we want to toggle the selection or navigate.

    What changes do you think we should make in order to solve the problem?

    To fix the root cause of this issue and prevent it in other places, we should disable executing the onSelectRow function inside the selection list if canSelectMultiple is true and isSmallScreenWidth.
    We can modify this part in the BaseSelectionListItemRenderer.tsx

    onSelectRow={() => {
    if (shouldSingleExecuteRowSelect) {
    singleExecution(() => selectRow(item, index))();
    } else {
    selectRow(item, index);
    }
    }}

    to

    onSelectRow={() => {
        if (canSelectMultiple && isSmallScreenWidth) {
             handleOnCheckboxPress(); 
        } else if (shouldSingleExecuteRowSelect) {
            singleExecution(() => selectRow(item, index))();
        } else {
            selectRow(item, index);
        }
    }}

    Optional: we can make this behavior optional by introducing a boolean prop such as shouldExecuteCheckboxSelectionOnMobile, which would allow us to enable or disable this behavior only in components where needed. This would prevent breaking any existing functionality and give us the flexibility to control it per component.

    POC:

    Screen.Recording.2025-03-19.at.11.52.37.mov

    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 can change the selection function inside
    the BaseSelectionList instead of the BaseSelectionListItemRenderer here

    we can add this condition to top of this function

         if (canSelectMultiple && isSmallScreenWidth) {
                    onCheckboxPress?.(item);
                    return;
                }
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2025
  7. changed the title [-]Distance rates - User goes to rate details when tapping on it in multiselect mode[/-] [+][$250] Distance rates - User goes to rate details when tapping on it in multiselect mode[/+] on Mar 19, 2025
  8. melvin-bot commented on Mar 19, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2025
  10. melvin-bot commented on Mar 19, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf (External)

  11. Krishna2323 commented on Mar 19, 2025

    @Krishna2323
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Distance rates - User goes to rate details when tapping on it in multiselect mode

    What is the root cause of that problem?

    • We don't have mechanism to prevent calling onSelectRow when selectionMode?.isEnabled is true and option can be selected. This should be applied in SelectionListWithModal.

    What changes do you think we should make in order to solve the problem?

    • First we need to extract onSelectRow & onCheckboxPress from the props here.
    • Then we would need to create a function onPress to call the onCheckboxPress function when selectionMode?.isEnabled and other required conditions are true.
        const onPress = (item: TItem) => {
            if (selectionMode?.isEnabled && onCheckboxPress && isSmallScreenWidth && !item?.isDisabled && !item?.isDisabledCheckbox) {
                onCheckboxPress(item);
                return;
            }
            onSelectRow(item);
        };
    • Lastly we would need to pass onPress and onCheckboxPress to SelectionList.
            <SelectionList
                ref={ref}
                sections={sections}
                onLongPressRow={handleLongPressRow}
                isScreenFocused={isScreenFocused}
                onSelectRow={onPress}
                onCheckboxPress={onCheckboxPress}
                // eslint-disable-next-line react/jsx-props-no-spreading
                {...rest}
            />

    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)

    Result

  12. melvin-bot commented on Mar 25, 2025

    @melvin-bot

    @allgandalf Huh... This is 4 days overdue. Who can take care of this?

  13. 70 remaining items

  14. maddylewis commented on May 20, 2025

    @maddylewis
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  15. maddylewis commented on May 27, 2025

    @maddylewis
    Contributor

    Payment Overview + Final To-Dos

  16. maddylewis commented on May 27, 2025

    @maddylewis
    Contributor

    Since this arose from a regression, i believe the payments are now $125. lmk if im mistaken!

  17. allgandalf commented on May 28, 2025

    @allgandalf
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: 166363d#r158190761

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    • Narrow devices (small screens) tests
    1. Create a workspace
    2. Navigate to Workspace settings and enable: distance rates, categories, tags, taxes, and report fields
    3. Create a few records in each of the above sections and invite a few members to the workspace
    4. Navigate to each of those pages (including the members page)
    5. Long press on a record to activate multiselection
    6. Tap in the middle of a record

    Confirm that the record is selected or unselected, and that the record details page does not open

    • Wide devices (web / desktop) tests
    1. Repeat steps 1 and 2 above
    2. Click on a record
    3. Confirm that the user is navigated to the record details page

    Do we agree 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions