Fix receipt hover preview opening on the wrong side of the thumbnail#96400
Fix receipt hover preview opening on the wrong side of the thumbnail#96400adamgrzybowski wants to merge 1 commit into
Conversation
|
@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@linhvovan29546 @NikkiWines @grgia One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f47094fed3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const overflowsRight = windowWidth > 0 && rightOfThumbnail + RECEIPT_PREVIEW_WIDTH + RECEIPT_PREVIEW_EDGE_MARGIN > windowWidth; | ||
| const left = overflowsRight ? Math.max(RECEIPT_PREVIEW_EDGE_MARGIN, anchorPosition.left - RECEIPT_PREVIEW_WIDTH - RECEIPT_PREVIEW_GAP) : rightOfThumbnail; | ||
| const fitsLeft = leftOfThumbnail >= RECEIPT_PREVIEW_EDGE_MARGIN; | ||
| const left = fitsLeft ? leftOfThumbnail : rightOfThumbnail; |
There was a problem hiding this comment.
Keep fallback preview inside the viewport
When the thumbnail is close enough to the left edge that fitsLeft is false but the viewport is only slightly wider than the narrow breakpoint, this fallback can place the 380px preview off the right edge. For example, with windowWidth 801 and a thumbnail at left 400, leftOfThumbnail is 4 so we choose rightOfThumbnail 484, making the preview extend to 864 before the edge margin; the previous overflow check would have clamped it to the left instead. This affects wide layouts just above the mobile breakpoint and clips the hover preview.
Useful? React with 👍 / 👎.
|
@linhvovan29546 |
Explanation of Change
Fixed Issues
$ #95975
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-07-17.at.16.23.36.mov