Skip to content

[HOLD for payment 2024-12-30] [$250] iOS&Android Expense - App does not respond to long tap on receipt placeholder area on expense preview #53697

Closed

Description

@IuliiaHerets

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: 9.0.72-0
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: Exp
Email or phone of affected tester (no customers): applausetester+zm69@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense with receipt.
  4. On the main workspace chat, long tap on the receipt area on the preview.
  5. Note that it responds to long tap and opens menu.
  6. Delete the expense.
  7. Submit an expense without receipt.
  8. On the main workspace chat, long tap on the receipt placeholder area on the preview.

Expected Result:

App will respond to the long tap and open more options menu.

Actual Result:

App does not respond to long tap on the empty receipt placeholder area on the expense preview.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6686288_1733482732185.ScreenRecording_12-06-2024_18-50-53_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866480849153052085
  • Upwork Job ID: 1866480849153052085
  • Last Price Increase: 2024-12-10
  • Automatic offers:
    • suneox | Reviewer | 105311644
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

  1. added
    Daily
    Bug
    on Dec 6, 2024
  2. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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. bernhardoj commented on Dec 6, 2024

    @bernhardoj
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-12-12 08:04:33 UTC.

    Proposal

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

    Long press on a empty receipt doesn't show the context menu.

    What is the root cause of that problem?

    The receipt empty state is wrapped with a pressable.

    function ReceiptEmptyState({hasError = false, onPress = () => {}, disabled = false, isThumbnail = false}: ReceiptEmptyStateProps) {
    const styles = useThemeStyles();
    const {translate} = useLocalize();
    const theme = useTheme();
    return (
    <PressableWithoutFeedback
    accessibilityRole="imagebutton"
    accessibilityLabel={translate('receipt.upload')}
    onPress={onPress}

    This makes it a nested pressable in a ReportPreview or MoneyRequestPreviewContent. The long press doesn't bubble up, which is why we manually handle the report preview long press to show the context menu.

    <PressableWithoutFeedback
    onPress={openReportFromPreview}
    onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
    onPressOut={() => ControlSelection.unblock()}
    onLongPress={(event) => showContextMenuForReport(event, contextMenuAnchor, chatReportID, action, checkIfContextMenuActive)}

    But we don't do the same for the receipt empty state component.

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

    But instead of handling the long press manually for receipt empty state, we can just render a View instead of Pressable if the receipt empty state onPress is undefined. (we need to remove the onPress default value)

    function ReceiptEmptyState({hasError = false, onPress = () => {}, disabled = false, isThumbnail = false}: ReceiptEmptyStateProps) {
    const styles = useThemeStyles();
    const {translate} = useLocalize();
    const theme = useTheme();
    return (
    <PressableWithoutFeedback
    accessibilityRole="imagebutton"
    accessibilityLabel={translate('receipt.upload')}
    onPress={onPress}

    const Wrapper = onPress ? PressableWithoutFeedback : View;
        return (
            <Wrapper
    

    Then, we can remove the receipt image onPress from the ReportPreview and MoneyRequestPreviewContent. (the onPress is only being used by receipt empty state)

    <ReportActionItemImages
    images={lastThreeReceipts}
    total={allTransactions.length}
    size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
    onPress={openReportFromPreview}
    />

    <ReportActionItemImages
    images={receiptImages}
    isHovered={isHovered || isScanning}
    size={1}
    onPress={shouldDisableOnPress ? undefined : onPreviewPressed}

    It was added because the parent pressable onPress isn't triggered when pressing on the receipt empty state. But we can remove it now since we won't use nested pressable anymore for the receipt empty state.

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

    When creating the test for this, I found that it behaves differently when running on the test environment. The issue we have here is basically if we have nested pressable, then only the inner pressable will receive the press/long-press event (which was observed first in this PR).

    But when I recreate this on the test environment as simple as this:

    render(
        <Pressable onLongPress={() => console.log('outer')}>
            <Pressable testID='test'>
    
            </Pressable>
        </Pressable>
    )
    fireEvent(await screen.findByTestId('test'), 'longPress');
    

    the outer pressable long press is triggered just fine. So, the unit test can't cover this case.

  4. melvin-bot commented on Dec 10, 2024

    @melvin-bot

    @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  5. added
    External
    on Dec 10, 2024
  6. changed the title [-]iOS&Android Expense - App does not respond to long tap on receipt placeholder area on expense preview[/-] [+][$250] iOS&Android Expense - App does not respond to long tap on receipt placeholder area on expense preview[/+] on Dec 10, 2024
  7. melvin-bot commented on Dec 10, 2024

    @melvin-bot
  8. added
    Help Wanted
    on Dec 10, 2024
  9. melvin-bot commented on Dec 10, 2024

    @melvin-bot

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

  10. 21 remaining items

  11. melvin-bot commented on Dec 23, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  12. melvin-bot commented on Dec 23, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.77-6 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 2024-12-30. 🎊

    For reference, here are some details about the assignees on this issue:

  13. melvin-bot commented on Dec 23, 2024

    @melvin-bot

    @suneox @bfitzexpensify @suneox 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]

  14. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Dec 23, 2024
  15. added
    Daily
    and removed
    Weekly
    on Dec 30, 2024
  16. bfitzexpensify commented on Dec 30, 2024

    @bfitzexpensify
    Contributor

    Payment summary:

    @bernhardoj to be paid $250 for contributor work via ND manual request
    @suneox to be paid $250 for C+ work - @suneox, please complete the BZ checklist and I'll finalise payment via Upwork

  17. suneox commented on Dec 30, 2024

    @suneox
    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: https://github.com/Expensify/App/pull/52848/files#r1899525216

    • [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.

      N/A: Due to it isn't an impactful bug

  18. bfitzexpensify commented on Dec 30, 2024

    @bfitzexpensify
    Contributor

    Thanks! Payment complete.

  19. moved this from Hold for Payment to Done in #expensify-bugson Dec 30, 2024
  20. bernhardoj commented on Dec 31, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  21. JmillsExpensify commented on Jan 8, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

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