Skip to content

[Due for payment 2026-03-30] Chat Report View - Enlarge and plus buttons on receipt image persist without hover #84388

Closed

Description

@mitarachim

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.3.32-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #83994
Email or phone of affected tester (no customers): dfghnhgfd@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11 / Chrome
App Component: Chat Report View

Action Performed:

Preconditions:

  • Logged in to any account
  • Has expense with an attached receipt image

Steps:

  1. Navigate to the workspace chat that has expense with an attached receipt image
  2. Open the expense details
  3. Observe the receipt image

Expected Result:

Enlarge and plus button should only appear if user hover on the receipt image and it should disappear if user move the mouse away from the receipt image

Actual Result:

Enlarge and plus buttons on receipt image persist without hover

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7095356_1772783628779.hoverr.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 6, 2026
  2. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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. github-actions commented on Mar 6, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  4. OSBotify commented on Mar 6, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #83994 - "feat: allow multiple receipts to be attached to a single expense" by @TaduJR (High confidence)
    Related Issues: #81435

    Recommendation: REVERT

    PR #83994 introduced hover-based buttons (enlarge and add receipt) on receipt images. However, the hover logic fails on Windows devices with touchscreens because the canUseTouchScreen() detection treats these hybrid devices as pure touch devices, disabling hover functionality even when users interact with a mouse.

    Labels: DeployBlockerCash label should be kept (this blocks the App deploy). DeployBlocker label should be removed (this is not a backend bug).

    Detailed Analysis

    Evidence

    Verification

    PR #83994 modified:

    • src/components/ReportActionItem/MoneyRequestReceiptView.tsx - Added the hover buttons and hover logic
    • src/styles/index.ts - Added styling for the button container
    • src/CONST/index.ts - Added button constants

    These are the exact files and components affected by the reported bug.

    Root Cause

    The hover implementation uses this logic in MoneyRequestReceiptView.tsx:

    const isTouchScreen = canUseTouchScreen();
    // ...
    <View style={[styles.receiptActionButtonsContainer, styles.pointerEventsBoxNone, !hovered && !isTouchScreen && styles.opacity0]}>

    The problem:

    1. canUseTouchScreen() checks navigator.maxTouchPoints > 0 on web
    2. On Windows 11 devices with touchscreens, this returns true even when the user is using a mouse
    3. When isTouchScreen is true, the condition !hovered && !isTouchScreen is always false
    4. Therefore, styles.opacity0 is never applied, and the buttons remain visible at all times
    5. The useHover hook also disables hover tracking when canUseTouchScreen() returns true, so hovered never becomes true from mouse interactions

    This is a fundamental issue with treating hybrid devices (laptops with touchscreens) as pure touch devices in the hover detection logic.

  5. removed
    DeployBlockerIndicates it should block deploying the API
    on Mar 6, 2026
  6. MelvinBot commented on Mar 6, 2026

    @MelvinBot
    Contributor

    Proposal

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

    After PR #83994 merged, the enlarge and plus buttons overlaid on receipt images in the expense detail view are always visible on web (Chrome on Windows), instead of only appearing when the user hovers over the receipt image.

    What is the root cause of that problem?

    The button visibility in MoneyRequestReceiptView relies on canUseTouchScreen() to distinguish mobile (always-show) from desktop (show-on-hover). The relevant line is:

    <View style={[styles.receiptActionButtonsContainer, styles.pointerEventsBoxNone, !hovered && !isTouchScreen && styles.opacity0]}>

    canUseTouchScreen() (at src/libs/DeviceCapabilities/canUseTouchScreen/index.ts) checks navigator.maxTouchPoints > 0. On Windows laptops with touchscreen capability (or certain Chrome configurations), maxTouchPoints is greater than 0 even when the user is using a mouse. This causes isTouchScreen to be true on desktop web, which means !isTouchScreen is false, so styles.opacity0 is never applied — the buttons remain permanently visible.

    Additionally, the useHover hook (src/hooks/useHover.ts) gates its onMouseEnter handler behind !canUseTouchScreen, so even if the visibility condition were different, hovered would never become true on these affected machines because mouse events are silently ignored.

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

    Replace the canUseTouchScreen() check with a more reliable method to determine whether hover should be supported. Two options:

    Option A (Recommended): Use the Hoverable component (the established pattern in the codebase, used by BaseVideoPlayer, TaskView, etc.) instead of the useHover hook. Hoverable delegates to ActiveHoverable on web which manages mouse enter/leave robustly, and on native (index.native.tsx) it always passes hovered=false. Use conditional rendering (like BaseVideoPlayer does) instead of opacity toggling:

    Hoverable wrapping the receipt area →
      isHovered provided via render-prop →
      conditionally render buttons when (isHovered || isMobile)
    

    This eliminates both the canUseTouchScreen() dependency and the need for pointerEventsBoxNone on the buttons container.

    Option B: Replace canUseTouchScreen() with a platform/layout check. For example, use shouldUseNarrowLayout from useResponsiveLayout() (already imported in the component) to determine mobile vs desktop context, since it uses screen dimensions rather than touch capability detection.

    In both options, the change is localized to src/components/ReportActionItem/MoneyRequestReceiptView.tsx.

    What alternative solutions did you explore? (Optional)

    • Using CSS @media (hover: hover) media query to detect hover capability — this is the web-standards approach but would require platform-specific style handling that doesn't align with the existing React Native pattern.
    • Removing the canUseTouchScreen guard from the useHover hook itself — this would fix the immediate issue but could break other consumers of the hook that rely on the current behavior.

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. puneetlath commented on Mar 6, 2026

    @puneetlath
    Contributor

    Given that this is only a problem on touch screen desktops, I'm going to demote. Let's fix as a follow-up @TaduJR

  8. 13 remaining items

  9. changed the title [-]Chat Report View - Enlarge and plus buttons on receipt image persist without hover[/-] [+][Due for payment 2026-03-30] Chat Report View - Enlarge and plus buttons on receipt image persist without hover[/+] on Mar 23, 2026
  10. melvin-bot commented on Mar 23, 2026

    @melvin-bot

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

  11. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.41-4 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 2026-03-30. 🎊

  12. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    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]

  13. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. ahmedGaber93 commented on Mar 24, 2026

    @ahmedGaber93
    Contributor

    Follow-up PR — no payment required.

  15. mallenexpensify commented on Mar 30, 2026

    @mallenexpensify
    Contributor

    If the regression penalty applies, comment on the issue linked to the PR that introduced the regression. Thx
    Looks like this is part of a project though.

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions