Skip to content

[HOLD for payment 2025-02-04] [$250] Align Receipt Image Consistently in Expense Preview and Expense View #55040

Closed

Description

@m-natarajan

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.82-7
Reproducible in staging?: y
Reproducible in production?: y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation (hyperlinked to channel name): expensify-bugs

Action Performed:

  1. Submit a receipt expense which has blank page after 1/3 of the page
  2. Compare the receipt display in the expense view and the expense preview.
  3. Observe that the preview shows a different portion of the receipt (often blank).

Expected Result:

The same subset of the receipt (preferably the top portion) should be displayed consistently in both the expense view and the expense preview.

Actual Result:

The expense view correctly shows the top portion of the receipt.
The expense preview appears to display a lower section, which can sometimes be blank, leading to a poor user experience.

Workaround:

unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

i_39d2d9f8dac03e8fe6a45134aee2a9a706c8bd7b-2025-01-09 17_08_50.746.pdf

image (18)

image (17)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021879333035263669594
  • Upwork Job ID: 1879333035263669594
  • Last Price Increase: 2025-01-15
  • Automatic offers:
    • brunovjk | Reviewer | 105773591
    • Krishna2323 | Contributor | 105773593
Issue OwnerCurrent Issue Owner: @adelekennedy

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 9, 2025
  2. melvin-bot commented on Jan 9, 2025

    @melvin-bot

    Triggered auto assignment to @adelekennedy (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. Krishna2323 commented on Jan 10, 2025

    @Krishna2323
    Contributor

    Edited by proposal-police: This proposal was edited at 2025-01-10 03:10:33 UTC.

    Proposal

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

    Align Receipt Image Consistently in Expense Preview and Expense View

    What is the root cause of that problem?

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

    • Instead of completely removing ImageBehaviorContextProvider, we can use it for each image when we map through shownImages.
                    {shownImages.map(({thumbnail, isThumbnail, image, isEmptyReceipt, transaction, isLocalFile, fileExtension, filename}, index) => {
                        // Show a border to separate multiple images. Shown to the right for each except the last.
                        const shouldShowBorder = shownImages.length > 1 && index < shownImages.length - 1;
                        const borderStyle = shouldShowBorder ? styles.reportActionItemImageBorder : {};
                        return (
                            <ImageBehaviorContextProvider shouldSetAspectRatioInStyle={numberOfShownImages === 1 ? true : Str.isPDF(filename ?? '')}>
                                <View
                                    key={`${index}-${image}`}
                                    style={[styles.reportActionItemImage, borderStyle, hoverStyle]}
                                >
    • The value for shouldSetAspectRatioInStyle will be shouldSetAspectRatioInStyle={numberOfShownImages === 1 ? true : Str.isPDF(filename ?? '')}.
    • Instead of heightStyle, we would need to set minHeightStyle & maxHeightStyle.
        // The height varies depending on the number of images we are displaying.
        let maxHeightStyle = {};
        let minHeightStyle = {};
        if (numberOfShownImages === 1) {
            maxHeightStyle = StyleUtils.getMaximumHeight(variables.reportActionImagesSingleImageHeight);
            minHeightStyle = StyleUtils.getMinimumHeight(variables.reportActionImagesSingleImageHeight);
        } else if (numberOfShownImages === 2) {
            maxHeightStyle = StyleUtils.getMaximumHeight(variables.reportActionImagesDoubleImageHeight);
            minHeightStyle = StyleUtils.getMinimumHeight(variables.reportActionImagesDoubleImageHeight);
        } else if (numberOfShownImages > 2) {
            maxHeightStyle = StyleUtils.getMaximumHeight(variables.reportActionImagesMultipleImageHeight);
            minHeightStyle = StyleUtils.getMinimumHeight(variables.reportActionImagesMultipleImageHeight);
        }

    <View style={[styles.reportActionItemImages, hoverStyle, heightStyle]}>

    • The height from reportActionItemImages should also be removed.
      height: variables.reportActionImagesSingleImageHeight,

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


    What alternative solutions did you explore? (Optional)

    • We should pass true to shouldSetAspectRatioInStyle.
    • We can completely remove the ImageBehaviorContextProvider because it won't be required if we want to shouldSetAspectRatioInStyle as true from ReportActionItemImages.
    • The issue due to which ImageBehaviorContextProvider was introduced isn't reproducible after removing the context.
  4. melvin-bot commented on Jan 13, 2025

    @melvin-bot

    @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 15, 2025
  6. changed the title [-]Align Receipt Image Consistently in Expense Preview and Expense View[/-] [+][$250] Align Receipt Image Consistently in Expense Preview and Expense View[/+] on Jan 15, 2025
  7. melvin-bot commented on Jan 15, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 15, 2025
  9. melvin-bot commented on Jan 15, 2025

    @melvin-bot

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

  10. 15 remaining items

  11. Krishna2323 commented on Jan 22, 2025

    @Krishna2323
    Contributor

    @brunovjk, the PR is ready for review, only the android native video is not added cause the app crashes as soon as it is launched.

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 28, 2025
  13. changed the title [-][$250] Align Receipt Image Consistently in Expense Preview and Expense View[/-] [+][HOLD for payment 2025-02-04] [$250] Align Receipt Image Consistently in Expense Preview and Expense View[/+] on Jan 28, 2025
  14. melvin-bot commented on Jan 28, 2025

    @melvin-bot

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

  15. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 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 2025-02-04. 🎊

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

  16. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    @brunovjk @adelekennedy @brunovjk 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]

  17. brunovjk commented on Feb 3, 2025

    @brunovjk
    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: expensify-bugs

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other: quinthar
    • [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: No PR introduced the bug. (eg. a case wasn't considered)

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

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

    Regression Test Proposal

    Test:

    1. Submit a receipt expense which has blank page after 1/3 of the page
    2. Compare the receipt display in the expense view and the expense preview.
    3. The same subset of the receipt (preferably the top portion) should be displayed consistently in both the expense view and the expense preview.

    Do we agree 👍 or 👎

  18. adelekennedy commented on Feb 4, 2025

    @adelekennedy
    Contributor

    Contributor: @Krishna2323 paid $250 via Upwork
    Contributor+: @brunovjk  owed $250 via Upwork

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions