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

[HOLD for payment 2023-10-27] [$500] IOS- Receipt border radius is not round #29230

Closed
1 of 6 tasks
kbecciv opened this issue Oct 10, 2023 · 28 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Oct 10, 2023

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.3.80.0
Reproducible in staging?: y
Reproducible in production?: y
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: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696931354301509

Action Performed:

  1. Go to any chat
  2. Click on + icon and select request money option
  3. Request money manually
  4. Go to transaction thread
  5. Click on three dots and add receipt
  6. Go back to previous screen
  7. Verify the receipt border radius

Expected Result:

receipt border radius should be round

Actual Result:

receipt border radius not round

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

Android: Native
Android: mWeb Chrome
iOS: Native
RPReplay_Final1696921036.1.MP4

IMG_6671 (1)

iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c9f60635e933b6e7
  • Upwork Job ID: 1711836727727636480
  • Last Price Increase: 2023-10-10
  • Automatic offers:
    • eh2077 | Contributor | 27239377
    • gadhiyamanan | Reporter | 27239379
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 10, 2023
@melvin-bot melvin-bot bot changed the title IOS- Receipt border radius is not round [$500] IOS- Receipt border radius is not round Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01c9f60635e933b6e7

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@vadymbokatov
Copy link
Contributor

vadymbokatov commented Oct 10, 2023

Proposal

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

Receipt border radius is not round

What is the root cause of that problem?

const receiptImageComponent = thumbnail ? (
<ThumbnailImage
previewSourceURL={thumbnailSource}
style={[styles.w100, styles.h100]}
isAuthTokenRequired
shouldDynamicallyResize={false}
/>
) : (

It seems that the styles.reportContainerBorderRadius which is responsible for Border radius is not. assigned to ThumbnailImage.

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

assign styles.reportContainerBorderRadius
Screenshot 2023-10-11 at 2 10 46 AM

@Krishna2323
Copy link
Contributor

Krishna2323 commented Oct 10, 2023

Proposal

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

IOS- Receipt border radius is not round

What is the root cause of that problem?

We are not applying the border radius properties to the inner container of the images.

<View style={[styles.reportActionItemImages, hoverStyle]}>
{_.map(shownImages, ({thumbnail, image}, index) => {
const isLastImage = index === numberOfShownImages - 1;
// 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 (
<View
key={`${index}-${image}`}
style={[styles.reportActionItemImage, borderStyle, hoverStyle]}
>
<ReportActionItemImage
thumbnail={thumbnail}
image={image}
/>
{isLastImage && remaining > 0 && (
<View style={[styles.reportActionItemImagesMore, hoverStyle]}>
<Text>+{remaining}</Text>
</View>
)}
</View>
);
})}
</View>

App/src/styles/styles.js

Lines 3600 to 3607 in b5445bd

reportActionItemImage: {
flex: 1,
width: '100%',
height: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
},

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

Border radius and overflow style should also be added to reportActionItemImage.

Styles to be added:

App/src/styles/styles.js

Lines 3592 to 3596 in b5445bd

borderTopLeftRadius: variables.componentBorderRadiusLarge,
borderTopRightRadius: variables.componentBorderRadiusLarge,
borderBottomLeftRadius: variables.componentBorderRadiusLarge,
borderBottomRightRadius: variables.componentBorderRadiusLarge,
overflow: 'hidden',

Optional:

We may want to subtract 4 from componentBorderRadiusLarge because the images container has borderWidth of 4 and if we don't subtract that then our images border radius will look a little more rounded.

borderRadius: variables.componentBorderRadiusLarge - 4

Result

image_border_radius

@ikevin127
Copy link
Contributor

Proposal

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

Receipt border radius should be rounded.

What is the root cause of that problem?

The problem comes from the fact that ThumbnailImage and Image rendered components from within the ReportActionItemImage.js component do not have borderRadius styles applied:

const receiptImageComponent = thumbnail ? (
<ThumbnailImage
previewSourceURL={thumbnailSource}
style={[styles.w100, styles.h100]}
isAuthTokenRequired
shouldDynamicallyResize={false}
/>
) : (
<Image
source={{uri: image}}
style={[styles.w100, styles.h100]}
/>
);

This causes both receipt and receipt placeholder pictures to not have rounded borders since currently both only have style={[styles.w100, styles.h100]} styles applied.

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

Add styles.reportContainerBorderRadius to both rendered components which will match the same borderRadius as the card has, like so:

    const receiptImageComponent = thumbnail ? (
        <ThumbnailImage
            previewSourceURL={thumbnailSource}
-            style={[styles.w100, styles.h100]}
+            style={[styles.w100, styles.h100, styles.reportContainerBorderRadius]}
            isAuthTokenRequired
            shouldDynamicallyResize={false}
        />
    ) : (
        <Image
            source={{uri: image}}
 -         style={[styles.w100, styles.h100]}
+            style={[styles.w100, styles.h100, styles.reportContainerBorderRadius]}
        />
    );

What alternative solutions did you explore? (Optional)

N/A

Videos

iOS
ios.mov

@yh-0218
Copy link
Contributor

yh-0218 commented Oct 11, 2023

Proposal

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

Receipt border radius should be rounded.

What is the root cause of that problem?

We don't have borderRadius to wrapper of ReportActionItemImage

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

We need to add borerRadius and overflow: hidden to wrapper.

style={[styles.reportActionItemImage, borderStyle, hoverStyle]}

Need to add reportActionItemImage

        borderRadius: variables.componentBorderRadiusLarge - 4,
        overflow: 'hidden',

reportActionItemImages: {

What alternative solutions did you explore? (Optional)

@PiyushChandra17
Copy link

Proposal

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

IOS- Receipt border radius is not round

What is the root cause of that problem?

Clearly we need borderRadius here,

<ThumbnailImage
previewSourceURL={thumbnailSource}
style={[styles.w100, styles.h100]}
isAuthTokenRequired
shouldDynamicallyResize={false}
/>

We are missing styles.reportContainerBorderRadius in style prop of ThumbNailImage component

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

We need to add style={[styles.w100, styles.h100, styles.reportContainerBorderRadius]}

<ThumbnailImage
    previewSourceURL={thumbnailSource}
-    style={[styles.w100, styles.h100]}
+    style={[styles.w100, styles.h100, styles.reportContainerBorderRadius]}
    isAuthTokenRequired
    shouldDynamicallyResize={false}
/>

What alternative solutions did you explore? (Optional)

NA

Result:

Simulator Screenshot - iPhone 13 - 2023-10-11 at 12 03 34

@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@lschurr
Copy link
Contributor

lschurr commented Oct 13, 2023

@allroundexperts could you review the proposals here?

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
@eh2077
Copy link
Contributor

eh2077 commented Oct 13, 2023

I'm going to post a proposal to fix this issue.

@eh2077
Copy link
Contributor

eh2077 commented Oct 14, 2023

Proposal

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

IOS- Receipt border radius is not round

What is the root cause of that problem?

The root cause of issue is from RN lib. On iOS platform, border radius is not working when using transparent border color.

See style of reportActionItemImages

App/src/styles/styles.ts

Lines 3711 to 3719 in fe282b4

reportActionItemImages: {
flexDirection: 'row',
borderWidth: 4,
borderColor: theme.transparent,
borderTopLeftRadius: variables.componentBorderRadiusLarge,
borderTopRightRadius: variables.componentBorderRadiusLarge,
overflow: 'hidden',
height: variables.reportActionImagesSingleImageHeight,
},

We can reproduce it using snack: https://snack.expo.dev/@eh2077/4c412a?platform=ios

iOS

Screen.Recording.2023-10-14.at.11.45.41.AM.mov

I reported this issue to upstream RN repo, see facebook/react-native#40969

It seems that the transparent or opacity border issue is tricky in RN, see also facebook/react-native#39286

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

From the style of reportActionItemImages

App/src/styles/styles.ts

Lines 3711 to 3719 in fe282b4

reportActionItemImages: {
flexDirection: 'row',
borderWidth: 4,
borderColor: theme.transparent,
borderTopLeftRadius: variables.componentBorderRadiusLarge,
borderTopRightRadius: variables.componentBorderRadiusLarge,
overflow: 'hidden',
height: variables.reportActionImagesSingleImageHeight,
},

We're using border-width: 4 and border-color: 'transparent' to introduce 4px space between image and the container.

We can use margin: 4 to achieve the spacing we want instead of using border-width and border-color.

We can just replace

App/src/styles/styles.ts

Lines 3713 to 3714 in fe282b4

borderWidth: 4,
borderColor: theme.transparent,

with

            margin: 4,

By doing so, we can get rid of the tricky inconsistent case of RN and solve the issue on iOS. Note we need to ensure the fix works for one or more than one receipts. See demo

ios.mp4

What alternative solutions did you explore? (Optional)

N/A

@allroundexperts
Copy link
Contributor

Thanks for the proposals everyone. I think no proposal other than @eh2077's explained why the border radius works fine on android / web while is broken on iOS.
@eh2077's proposal has the correct RCA and the solution proposed works fine as well. Let's go with them.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 15, 2023

Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

📣 @allroundexperts Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

📣 @eh2077 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

📣 @gadhiyamanan 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 17, 2023
@eh2077
Copy link
Contributor

eh2077 commented Oct 17, 2023

@allroundexperts PR #29776 is ready for review. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

🎯 ⚡️ Woah @allroundexperts / @eh2077, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @eh2077 got assigned: 2023-10-17 12:45:51 Z
  • when the PR got merged: 2023-10-18 15:07:02 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 20, 2023
@melvin-bot melvin-bot bot changed the title [$500] IOS- Receipt border radius is not round [HOLD for payment 2023-10-27] [$500] IOS- Receipt border radius is not round Oct 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.87-12 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 2023-10-27. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] A discussion in #expensify-bugs 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@lschurr
Copy link
Contributor

lschurr commented Oct 26, 2023

Could you work on the checklist for this one @allroundexperts? Thanks!

@lschurr
Copy link
Contributor

lschurr commented Oct 26, 2023

Payment summary:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 27, 2023
@lschurr
Copy link
Contributor

lschurr commented Oct 27, 2023

Payments made in Upwork for @eh2077 and @gadhiyamanan.

Bump @allroundexperts for the checklist :)

@allroundexperts
Copy link
Contributor

Checklist

Since this issue is very much related to RN, I don't think that there is any PR in our repo that we can point to that resulted in this. I also think that a Slack discussion is not needed here. However, a regression test would be helpful.

Regression Test

  1. On iOS, Open the App and login.
  2. Click on + icon and select request money option
  3. Request money manually
  4. Go to transaction thread
  5. Click on three dots and add a receipt. Go back to previous screen.

Verify the receipt border radius is round.

Do we 👍 or 👎 ?

@lschurr
Copy link
Contributor

lschurr commented Oct 30, 2023

All set!

@lschurr lschurr closed this as completed Oct 30, 2023
@JmillsExpensify
Copy link

$750 payment approved for @allroundexperts based on BZ summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests