Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Distance - The route image is cropped in the IOU preview #40791

Closed
5 of 6 tasks
lanitochka17 opened this issue Apr 23, 2024 · 18 comments
Closed
5 of 6 tasks

[$250] Distance - The route image is cropped in the IOU preview #40791

lanitochka17 opened this issue Apr 23, 2024 · 18 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Apr 23, 2024

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: 1.4.64-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4502640
Issue reported by: Applause - Internal Team

Action Performed:

Prerequisites:
Create WS collect, invite an employee

  1. Open https://staging.new.expensify.com/
  2. Log in to the employee account
  3. Navigate to a workspace room
  4. Create a Distance IOU with any 2 waypoints
  5. Navigate to Report Conversation

Expected Result:

The route image must fit completely in the IOU preview

Actual Result:

The route image is cropped in the IOU preview

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6458075_1713824565000.Recording__75.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0160841ad69bf530a2
  • Upwork Job ID: 1782777779723137024
  • Last Price Increase: 2024-04-23
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

Triggered auto assignment to @Gonals (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
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.

@lanitochka17
Copy link
Author

@Gonals FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@ra-md
Copy link
Contributor

ra-md commented Apr 23, 2024

Proposal

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

The route image is cropped in the IOU preview

What is the root cause of that problem?

In this PR #35041, Object position top is added to resolve the issue of the receipt thumbnail not displaying its top portion. However, this causes the map distance request to appear cropped in the IOU preview.

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

First, we need to update ReceiptImage to accept a new additional prop objectPosition. We will use this to change the objectPosition of ThumbnailImage.

Then, in DistanceEReceipt, we can use the prop we just added and set it to CONST.IMAGE_OBJECT_POSITION.INITIAL.

Next, in the ReceiptUtils.getThumbnailAndImageURIs function, we need to update this line to return transaction. We will use this to check if the transaction is a distanceRequest in ReportActionItemImage.

return {thumbnail: `${path}.1024.jpg`, image: path, filename, transaction};

Finally, in here, we will set the objectPosition to CONST.IMAGE_OBJECT_POSITION.INITIAL if the request is a distance request.

const isDistanceRequest = transaction && TransactionUtils.isDistanceRequest(transaction);

propsObj = {
   shouldUseThumbnailImage: true,
   source: thumbnailSource,
   fallbackIcon: Expensicons.Receipt,
   fallbackIconSize: isSingleImage ? variables.iconSizeSuperLarge : variables.iconSizeExtraLarge,
   isAuthTokenRequired: true,
   objectPosition: isDistanceRequest ? CONST.IMAGE_OBJECT_POSITION.INITIAL : CONST.IMAGE_OBJECT_POSITION.TOP
};

What alternative solutions did you explore? (Optional)

N/A

@Gonals Gonals added the External Added to denote the issue can be worked on by a contributor label Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0160841ad69bf530a2

@melvin-bot melvin-bot bot changed the title Distance - The route image is cropped in the IOU preview [$250] Distance - The route image is cropped in the IOU preview Apr 23, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

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

@Gonals Gonals added the Bug Something is broken. Auto assigns a BugZero manager. label Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

Triggered auto assignment to @garrettmknight (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.

@Gonals
Copy link
Contributor

Gonals commented Apr 23, 2024

@Pujan92, what do you think of @ra-md's proposal?

@Pujan92
Copy link
Contributor

Pujan92 commented Apr 23, 2024

@ra-md Object position top is added to fix issue #34120.

@Gonals This seems to be a regression from #35041

cc: @dukenv0307

@ra-md
Copy link
Contributor

ra-md commented Apr 23, 2024

@Pujan92 Oh, I see. 😅

@Gonals
Copy link
Contributor

Gonals commented Apr 23, 2024

I think this may not be a blocker, since it just kinda moves an existing bug a few pixels 😆. What do you think, @mountiny?

@Beamanator
Copy link
Contributor

Aah this could be related to my Web-PDFs change where I centered receipts to the top - https://github.com/Expensify/Web-PDFs/pull/572

I also don't think this is a blocker

@neil-marcellini
Copy link
Contributor

The root cause is on the backend and already on prod so yeah, not a blocker. It would be great to fix soon though. It looks bad for distance requests.

@neil-marcellini neil-marcellini added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 23, 2024
@ra-md
Copy link
Contributor

ra-md commented Apr 23, 2024

proposal updated based on this comment

@Beamanator
Copy link
Contributor

I believe this should be handled by @dukenv0307 in #34120 since this is a regression of a PR from that issue

@dukenv0307
Copy link
Contributor

@Beamanator I will add the fix in this PR #40763.

@garrettmknight
Copy link
Contributor

Cool, closing this one in favor of the other then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants