Skip to content

[HOLD for payment 2023-10-09] [$500] Web - Money request tab glitches when trying to select text in the scan receipt tab #27551

Closed

Description

@kbecciv

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


Action Performed:

  1. Click on request money.
  2. Go to the scan tab.
  3. Try to select any text in the body

Expected Result:

We should be able to select the text

Actual Result:

We are not able to select the text and the page glitches to the right

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.70.5
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-09-14.at.11.39.22.PM.mov
Recording.4510.mp4

Expensify/Expensify Issue URL:
Issue reported by: @esh-g
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694715075087069

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01edfae28ba0808400
  • Upwork Job ID: 1702746615305179136
  • Last Price Increase: 2023-09-22
  • Automatic offers:
    • akinwale | Contributor | 26855518
    • esh-g | Reporter | 26855520

Activity

  1. added
    Daily
    Bug
    on Sep 15, 2023
  2. melvin-bot commented on Sep 15, 2023

    @melvin-bot

    Triggered auto assignment to @puneetlath (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Sep 15, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. added
    External
    on Sep 15, 2023
  5. changed the title [-]Web - Money request tab glitches when trying to select text in the scan receipt tab[/-] [+][$500] Web - Money request tab glitches when trying to select text in the scan receipt tab[/+] on Sep 15, 2023
  6. melvin-bot commented on Sep 15, 2023

    @melvin-bot
  7. added
    Help Wanted
    on Sep 15, 2023
  8. melvin-bot commented on Sep 15, 2023

    @melvin-bot

    Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new.

  9. melvin-bot commented on Sep 15, 2023

    @melvin-bot

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

  10. akinwale commented on Sep 15, 2023

    @akinwale
    Contributor

    Proposal

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

    Money request tab glitches when trying to select text in the scan receipt tab.

    What is the root cause of that problem?

    Trying to select text triggers the swipe action on the Scan tab, causing either the Manual or Distance tab to show while dragging the mouse.

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

    Solution 1
    Add a PanResponder to the root view of the Scan tab in ReceiptSelector to handle swipes and prevent the tab from swiping when trying to select text.

    1. Create the PanResponder ref.
    const panResponder = useRef(
        PanResponder.create({
            onMoveShouldSetPanResponder: () => true,
        })
    ).current;
    
    1. Add the pan handlers to the root view.
    <View
        style={[styles.uploadReceiptView(isSmallScreenWidth)]}
        {...panResponder.panHandlers}
    >
    

    Solution 2
    In some cases, the user may attempt to select text without placing the cursor on the text area. The limitation with Solution 1 is that dragging in any area to the left or right of the text will cause the tab to be swiped. There is a 20px horizontal margin for the root view, so dragging in the margin area would still cause the tab to swipe.

    This can be handled with the following steps.

    1. Create the PanResponder ref.
    const panResponder = useRef(
        PanResponder.create({
            onMoveShouldSetPanResponder: () => true,
            onPanResponderTerminationRequest: () => false,
        })
    ).current;
    
    1. Wrap the text controls with a View, and add the pan handlers to this wrapper view.
    +<View
    +    style={styles.w100}
    +    {...panResponder.panHandlers}>
        <Text style={[styles.textReceiptUpload]}>{translate('receipt.upload')}</Text>
        <Text style={[styles.subTextReceiptUpload]}>
            {isSmallScreenWidth ? translate('receipt.chooseReceipt') : translate('receipt.dragReceiptBeforeEmail')}
            <CopyTextToClipboard
                text={CONST.EMAIL.RECEIPTS}
                textStyles={[styles.textBlue]}
            />
            {isSmallScreenWidth ? null : translate('receipt.dragReceiptAfterEmail')}
        </Text>
    +</View>

    What alternative solutions did you explore? (Optional)

    None.

    27551-demo.mp4
  11. puneetlath commented on Sep 18, 2023

    @puneetlath
    Contributor

    @eVoloshchak thoughts on the proposal?

  12. 39 remaining items

  13. dylanexpensify commented on Oct 10, 2023

    @dylanexpensify
    Contributor

    Payment summary:

  14. dylanexpensify commented on Oct 10, 2023

    @dylanexpensify
    Contributor

    Payments sent! @eVoloshchak mind completing checklist? Thank you!

  15. eVoloshchak commented on Oct 11, 2023

    @eVoloshchak
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Add ability to Take/Upload Receipts #23046
    • 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: https://github.com/Expensify/App/pull/23046/files#r1355375054
    • A discussion in #expensify-bugs 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: I don't think an additional discussion is needed here, this is an isolated occurrence and kind of an edge case
    • Determine if we should create a regression test for this bug
      Again, since this is an edge case a few users would have ever encountered (and is limited to web/Desktop), I don't think a regression test is required here
  16. JmillsExpensify commented on Oct 12, 2023

    @JmillsExpensify
    Contributor

    $750 payment approved for @eVoloshchak based on BZ summary.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions