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

[$500] Android - Scan - '+n' box in the expense preview has monotone design compared to other platforms #29827

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 17, 2023 · 31 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 17, 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.85-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch New Expensify app
  2. Create more than three Scan requests in workspace chat
  3. Go to the workspace chat
    Take a look at the '+n' box in the expense preview and see the difference between Android app and web app

Expected Result:

The '+n' box in the expense preview on Android app shares the same design as the web app

Actual Result:

The '+n' box in the expense preview on Android app does not have two shades of triangles compared to other platforms (web, mweb, desktop and iOS app)

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

Bug6240971_1697570682613!Android

Bug6240971_1697570682637!web

Android: mWeb Chrome
iOS: Native
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/~01bb1eaa9608e54e7c
  • Upwork Job ID: 1714384161488551936
  • Last Price Increase: 2023-10-24
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 27443578
    • eh2077 | Contributor | 27443580
@lanitochka17 lanitochka17 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 17, 2023
@melvin-bot melvin-bot bot changed the title Android - Scan - '+n' box in the expense preview has monotone design compared to other platforms [$500] Android - Scan - '+n' box in the expense preview has monotone design compared to other platforms Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@melvin-bot melvin-bot bot added 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

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 17, 2023

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

@bernhardoj
Copy link
Contributor

Proposal

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

The +n text of receipt images only has one color on Android compared to other platforms where there are 2 different colors.

What is the root cause of that problem?

The +n triangle has a style below

App/src/styles/styles.ts

Lines 3754 to 3766 in 9664f8c

reportActionItemImagesMoreCornerTriangle: {
position: 'absolute',
bottom: 0,
right: 0,
width: 0,
height: 0,
borderStyle: 'solid',
borderWidth: 0,
borderBottomWidth: 40,
borderLeftWidth: 40,
borderColor: 'transparent',
borderBottomColor: theme.cardBG,
},

To show the highlighted red triangle background color below, we set it through borderColor (shorthand) and borderBottomColor as you can see from the code above.
Screenshot 2023-10-18 at 15 14 47

After doing some investigation, setting both borderColor (shorthand) and border*Color doesn't work.

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

Set the border color one by one.

borderTopColor: 'transparent',
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: theme.cardBG,

@eh2077
Copy link
Contributor

eh2077 commented Oct 19, 2023

Proposal

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

Android - Scan - '+n' box in the expense preview has monotone design compared to other platforms.

What is the root cause of that problem?

The root cause of this issue is that the way we draw triangle is not working in RN of Android, see

App/src/styles/styles.ts

Lines 3755 to 3767 in b3c4419

reportActionItemImagesMoreCornerTriangle: {
position: 'absolute',
bottom: 0,
right: 0,
width: 0,
height: 0,
borderStyle: 'solid',
borderWidth: 0,
borderBottomWidth: 40,
borderLeftWidth: 40,
borderColor: 'transparent',
borderBottomColor: theme.cardBG,
},

We're using borderWith (and border*Width) and borderColor (and border*Color) to create the shape of triangle, which is a common method to create triangle from web but things become tricky on RN when working with border with transparent color, see RN issue related to border and transparent.

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

To solve this issue, instead of drawing triangle using borderWidth and borderColor, we can use Svg and Polygon from react-native-svg to draw the triangle we need.

To achieve it, we replace this line with

<Svg 
    height={triangleWidth} 
    width={triangleWidth} 
    style={{ position: 'absolute' }}
>
    <Polygon
        points={`${triangleWidth},0 ${triangleWidth},${triangleWidth} 0,${triangleWidth}`}
        fill={isHovered ? theme.border : theme.cardBG}
    />
</Svg>

and define triangle width variable like

const triangleWidth = variables.reportActionItemImagesMoreCornerTriangleWidth; // 40

See demo

0-android.mp4

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Oct 20, 2023
@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Oct 20, 2023

Will review proposals over the weekend.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 20, 2023
@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Oct 23, 2023

Sorry for the delay. Will review today. Got some high priority issues last week.

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@JmillsExpensify
Copy link

Still waiting on issue proposal review

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Oct 27, 2023

Sorry for the delay. Will review now

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 27, 2023
@abdulrahuman5196
Copy link
Contributor

Working on review today. If not complete by today, will re-assign myself to provide faster update.

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@abdulrahuman5196
Copy link
Contributor

@bernhardoj 's solution here #29827 (comment) doesn't seem to be working for me.

@abdulrahuman5196
Copy link
Contributor

@eh2077 's proposal here #29827 (comment) looks good and works well.

🎀 👀 🎀
C+ Reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@MonilBhavsar
Copy link
Contributor

Looks good to me. Let's test it on all platforms regardless of issue happening on Android only and for various screen sizes

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

melvin-bot bot commented Oct 30, 2023

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

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 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 📖

@bernhardoj
Copy link
Contributor

@abdulrahuman5196 Can you recheck my proposal? It works totally fine

Screen.Recording.2023-10-31.at.10.57.35.mov

Isn't it better to fix the styling instead of re-creating it with an SVG? 😄

@melvin-bot
Copy link

melvin-bot bot commented Oct 31, 2023

@JmillsExpensify @MonilBhavsar @abdulrahuman5196 @eh2077 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@eh2077
Copy link
Contributor

eh2077 commented Oct 31, 2023

PR will be ready by tmr.

@bernhardoj
Copy link
Contributor

@abdulrahuman5196 can you check my comment before @eh2077 raise the PR?

cc: @MonilBhavsar

@abdulrahuman5196
Copy link
Contributor

Thanks for raising up @bernhardoj. I tried again and your solution is working.
But still I would opt the current selected solution only. IMO both are straightforward fixes, and having a component for the triangle UI seems better for long term. Even if the solution would have worked the first time of my try, my suggestion would still have been the same.

@bernhardoj
Copy link
Contributor

I think creating the triangle with an SVG isn't a straightforward fix.

and having a component for the triangle UI seems better for long term

May I know why it's better for the long term? Creating a triangle with a border seems a common thing to do.

I would like to know @MonilBhavsar opinion on which solution is better, pure CSS vs SVG. (fyi, my proposal comes first 😄)

@eh2077
Copy link
Contributor

eh2077 commented Oct 31, 2023

I think using border to create triangle is more like a trick. My understanding is that the App always prefers holistic approaches over tricks.

@MonilBhavsar
Copy link
Contributor

May I know why it's better for the long term?

Looks like react-native have issues with the properties we use to generate triangle using CSS and chances are we could run into similar issue again.
https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+border+transparent+

@bernhardoj
Copy link
Contributor

If we are talking about the potential issues in the future, then I think every approach has it. The issue we have here is that we can't combine the borderColor shorthand and border*Color style on Android which is a regression from RN 0.71.8 based on the upstream issue

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

eh2077 commented Nov 1, 2023

@abdulrahuman5196 PR #30701 is ready for review, thanks!

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Not a regression. A platform specific present from implementation.

Determine if we should create a regression test for this bug.
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.

No. Not beneficial for this minor UI bug.

@JmillsExpensify

Seems melvin didn't update here automatically. This issue should be on payment due today - #30701 (comment)

@JmillsExpensify
Copy link

Payment summary:

  • Issue reporter: N/A
  • Contributor: @eh2077 $750 (incl. urgency bonus)
  • Contributor+: @abdulrahuman5196 $750 (incl. urgency bonus)

@JmillsExpensify
Copy link

Everyone paid out based on summary above. Closing!

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants