Skip to content

Distance - Different zoom level when hovered on receipt when opened from LHN #93746

Closed

Description

@applause-bot

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.4.9-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: #93102
Email or phone of affected tester (no customers): #93102
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a map distance expense.
  4. Open the expense.
  5. Hover over the receipt.
  6. Remember the zoom level when hovered.
  7. Send a message to the expense and close the RHP.
  8. Open the expense from LHN.
  9. Hover over the receipt.

Expected Result:

Receipt zoom level should be the same when hovered on report RHP and report central pane.

Actual Result:

Receipt zoom level is lower when hovered on report central pane compared to report RHP.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7182788_1781641623895.2.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7182788

Issue OwnerCurrent Issue Owner: @WojtekBoman
Issue OwnerCurrent Issue Owner: @WojtekBoman

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jun 16, 2026
  2. applause-bot commented on Jun 16, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/4cbf5ed5153592e469486f011bd861ee63bc2a68c327c45e24b7e3c1e58fde78

  3. melvin-bot commented on Jun 16, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #93102

  4. melvin-bot commented on Jun 16, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jun 16, 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.
  6. MelvinBot commented on Jun 16, 2026

    @MelvinBot
    Contributor

    Proposal

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

    The full distance e-receipt overlay (shown on hover, added in #93102) appears at a different zoom level depending on where the expense is opened: lower zoom in the report central pane than in the RHP.

    What is the root cause of that problem?

    HoveredDistanceEReceipt sizes the overlaid e-receipt with a pure fit-to-box ratio:

    const scale = boxWidth && boxHeight && cardHeight ? Math.min(boxWidth / variables.eReceiptHoverCardWidth, boxHeight / cardHeight) : 0;

    boxWidth/boxHeight come from onOverlayLayout, i.e. the receipt container's rendered size. That container's size is not the same in both layouts because receiptStyle depends on the fillSpace prop:

    Because the box has different width/height (and a different aspect ratio) in each layout, Math.min(...) resolves to a different scale, so the e-receipt is fit to each box differently and the perceived zoom changes between RHP and central pane.

    Why the box differs — evidence
    • fillSpace is only passed true from the central-pane report view (MoneyRequestReportView.tsx:266) and Wide RHP (WideRHPReceiptPanel.tsx:82). A normal RHP money-request view leaves it false.
    • The base map thumbnail looks consistent across layouts because it scales as a contained image, but the hover overlay re-derives its own scale from the variable container box, so it does not stay consistent.
    • The outer ReceiptHoverZoom magnification (2.5×) is constant in both contexts, so it is not the cause — the difference comes entirely from the fit-to-box scale in HoveredDistanceEReceipt.

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

    Make the overlay's zoom independent of the layout-driven container size so it renders at the same effective scale in both RHP and central pane. Options, in order of preference:

    1. Anchor the overlay to the rendered receipt image, not the container box. Measure the underlying DistanceEReceipt map image's displayed dimensions and compute scale against those, so the overlaid full e-receipt always aligns 1:1 with the map thumbnail beneath it in every layout.
    2. Normalize the overlay box aspect ratio. Constrain the overlay (or the source dimensions feeding Math.min) to the same aspect ratio in both layouts (e.g. apply the 16/9 constraint used by expenseViewImage to the central-pane case) so the fit ratio is identical.

    Given this is a re-landed feature on a deploy blocker, reverting #93102 again is the fast fallback if a clean fix can't land in the deploy window.

    Confidence

    High on root cause (layout-dependent fit-to-box scale, with file:line evidence above). Medium on the exact fix — the precise normalization should be validated visually against both layouts.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93746) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Jun 16, 2026
  8. mountiny commented on Jun 16, 2026

    @mountiny
    Contributor

    Looks like a minor issue, I dont think we need to block the deploy on this

  9. WojtekBoman commented on Jun 18, 2026

    @WojtekBoman
    Contributor

    Regarding this issue:
    For testing purposes, I adjusted the receipt window to the size displayed in the full-screen report, resulting in the same zoom scale in both cases. The difference between the reports in RHP and full-screen mode is due to the different sizes of the receipt windows, so the scale is adjusted accordingly. Let me know if this is ok for you :) If the behavior is still incorrect we can investigate how to make it more consistent, but I believe it works fine cc: @mountiny @QichenZhu

    Screen.Recording.2026-06-18.at.12.25.21.mov
  10. QichenZhu commented on Jun 18, 2026

    @QichenZhu
    Contributor

    @WojtekBoman I'm not sure about the design change in your video.

    Before

    Image

    After

    Image
  11. WojtekBoman commented on Jun 18, 2026

    @WojtekBoman
    Contributor

    I've just changed it only for testing purposes to show that zoom level depends on the receipt window size, the windows are different so the scale is different as well

  12. QichenZhu commented on Jun 18, 2026

    @QichenZhu
    Contributor

    I've just changed it only for testing purposes

    Oh I see, my bad.

    zoom level depends on the receipt window size, the windows are different so the scale is different as well

    This makes sense to me.

  13. mountiny commented on Jun 18, 2026

    @mountiny
    Contributor

    Ok thanks

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions