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-08-28] [$1000] Web - Lounge access icon does not change color on hover #22766

Closed
1 of 6 tasks
kbecciv opened this issue Jul 12, 2023 · 83 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 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@kbecciv
Copy link

kbecciv commented Jul 12, 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!


Action Performed:

  1. Click on the settings (profile icon)
  2. Hover over various buttons, observe color change of the icon.
  3. Click Profile.
  4. Hover over personal details, observe color change of the icon.
  5. Hover over Lounge Access.

I your account doesn't have the necessary to see the "Lounge Access" button and you are in dev, you can just force it to show here:

{props.user.hasLoungeAccess && (
<MenuItem
title={props.translate('loungeAccessPage.loungeAccess')}
icon={Expensicons.LoungeAccess}
iconWidth={40}
iconHeight={40}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_LOUNGE_ACCESS)}
shouldShowRightIcon
/>
)}

Expected Result:

The Lounge Access icon changes the color on hover. Note: The expected results is wrong about the star colour, it should also turn white when hovered.

iconfixed.mov

Actual Result:

The Lounge Access icon does not change color on hover.

Screen.Recording.2023-07-13.at.11.39.11.AM.mov

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.39-8
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
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @oesayan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689147377663069

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ef8779c3c4a9e364
  • Upwork Job ID: 1681793701036728320
  • 2023-07-19
  • Automatic offers:
    • | | 0
    • | | 0
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 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

@oesayan
Copy link

oesayan commented Jul 12, 2023

Proposal

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

Lounge access button does not change color when hovered over like the rest of the icons.

What is the root cause of that problem?

The svg file of the lounge-access icon has two hardcoded color fills - green (for the couch) and gold (for the star), so when the user hovers over the icon the logo does not change its color since the colors are hardcoded inside the .svg itself.

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

There is only one clean way to fix the issue - we need to apply the fill for the star dynamically, converting the .svg to a component/function. I found a clear and straight-forward way to do that without changing the code significantly.
The good thing is that the import/export chain stays the same - importing Expensicons would still work as intended.

  1. We are changing the lounge-access.svg to lounge-access.js so it becomes a JS function/React component. We are leaving the file inside the same folder.
  2. We are changing line 63 in the Expensicons.js file that manages all the icons so that the new file is properly imported.
-import LoungeAccess from '../../../assets/images/lounge-access.svg';
+import LoungeAccess from '../../../assets/images/lounge-access.js';
  1. We are rewriting the SVG file into a component. To do that we need an SVG library (it is already being used in other parts of graphics, so it is not a problem). Then we are rewriting the hardcoded SVG into a component - it is straightforward, we are just creating a wrapper that imports the react-native-svg so we can dynamically create the svg and then this wrapper exports the component as a LoungeAccess
    We are also moving the fill to the star path itself so it can be individually colored.

We are also removing unnecessary polygon that was hardcoded inside the .svg by the designer - the SVG optimizing module removes it after compiling the Expensify - that means it is unnecessary and that means we do not need to import the polygon functionality from the react-native-svg module - less dependencies is always better.

This original .svg file has a polygon...

screen1

that is actually removed during the compilation and is completely redundant - that's why we are no longer creating a polygon in the new lounge-access.js file.

screen2
  1. The only thing left to do is to pass the props into our new lounge-access.js component - size (width, height) and isHovered boolean so we can detect if user hovers over the icon and change the color of the star accordingly. We achieve that by adding isHovered boolean to MenuItem.js and Icon component index.js file, which then passes it to the lounge-access.js - this results in three new lines of code and that's it.

What is good is that we can still use import Expensicons and Expensicons.LoungeAccess inside the ProfilePage.js - I was only able to achieve that yesterday - I tried to keep the architecture of the app the same way it was before.

Here is a video -

2023-08-01.06.34.11.mov

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

📣 @oesayan! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@oesayan
Copy link

oesayan commented Jul 13, 2023

Contributor details
Your Expensify account email: esaian.oleg@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~017637da0274c11b53

@melvin-bot
Copy link

melvin-bot bot commented Jul 13, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@hungvu193
Copy link
Contributor

hungvu193 commented Jul 13, 2023

Proposal

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

Web - Lounge access icon does not change color on hover

What is the root cause of that problem?

We're filling the hard code color here, because of that, the icon wasn't changed color while hovering:

.st0{fill:#03D47C;}
.st1{fill:#FEE45E;}

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

Change this to:

.st0{fill-rule:evenodd;clip-rule:evenodd;}
.st1{fill-rule:evenodd;clip-rule:evenodd;}

or just these 2 lines from our lounge-access.svg file

What alternative solutions did you explore? (Optional)

In order to keep the star's yellow when it's not hover, we should make our svg to a component.

  1. Convert lounge-access.svg to LoungeAccessIcon.js.
  2. Update our icon inside MenuItem to LoungeAccessIcon:
                    <MenuItem
                        title={props.translate('loungeAccessPage.loungeAccess')}
                        icon={LoungAccessIcon}
                        iconWidth={40}
                        iconHeight={40}
                        onPress={() => Navigation.navigate(ROUTES.SETTINGS_LOUNGE_ACCESS)}
                        shouldShowRightIcon
                    />
  1. Update our Icon/index.js component to receive isHovered as a prop.
  2. Passing the isHovered props to LoungeAccessIcon, then update the className st1 to custom the color when hovering:
    <G>
      <Path
        fill={props.isHovered ? props.fill : "#FEE45E"}
        className="st1"
        d="M31,9.8c-0.1-0.2-0.2-0.4-0.5-0.4h-2.1l-0.8-2C27.4,7,27.1,7,27,7c-0.1,0-0.4,0-0.6,0.4l-0.8,1.9h-2.1 c-0.4,0-0.5,0.4-0.5,0.4c0,0.1-0.1,0.4,0.1,0.6l1.6,1.8l-0.6,1.9c-0.1,0.3,0.1,0.5,0.2,0.7c0.1,0,0.3,0.2,0.7,0.1l2-1.1l2,1.2 c0.3,0.2,0.6,0,0.7-0.1c0.1-0.1,0.3-0.3,0.2-0.7l-0.6-2l1.5-1.7C31,10.3,31,10,31,9.8z"
      />
      <Polygon className="st1" points="28.5,7 28.5,7 28.5,7  " />
    </G>

With this approach, we can do whatever color we want, we can control the way it display.
Full integration at my branch:
https://github.com/hungvu193/App/tree/feat-22766

Result:

Screen.Recording.2023-07-31.at.19.25.34.mov

@melvin-bot
Copy link

melvin-bot bot commented Jul 13, 2023

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@sophiepintoraetz
Copy link
Contributor

@aldo-expensify - I'm re-assigning this one to you to see if you can reproduce because this I don't have access to a DEV environment 🙏

@oesayan
Copy link

oesayan commented Jul 13, 2023

@sophiepintoraetz

Sorry to hijack the thread, but as I stated in the slack thread, it is not only happening in the dev.

"Hey, sorry for answering late. This icon is not about the dev/staging but about the account eligibility - I am not sure what makes the account eligible, but mine main account shows the icon even in the prod iOS build (also dev and staging of course).

My other testing account is not eligible and I don’t have the button anywhere (not in dev, staging or prod) - I guess your testing account is the same.

It is also reproducible on every platform, not just macOS.

TLDR - not just dev build, but staging and prod too - but the account needs to be eligible to see the button. Also every platform, not just macOS Chrome/Safari."

@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Jul 13, 2023

@oesayan the issue literally states DEV and none of the platforms staging or production are confirmed (n/a) - which means I cannot reproduce it with my environment.

If this is not the case, then the issue needs to be updated to reflect that.

image

@oesayan
Copy link

oesayan commented Jul 13, 2023

@sophiepintoraetz
I reported the bug and the engineer who created a GH issue thought it is dev only and MacOS Safari/Chrome only, however it is not. I will try to mention the engineer in the Slack again so they can update the GH accordingly.

@aldo-expensify
Copy link
Contributor

I'm not sure what are the conditions for that button to show, but I reproduced it modifying the code to force the button to be there.

We should fix it, my only question would be: is the yellow start supposed to turn white too when we hover?

@aldo-expensify aldo-expensify removed the Needs Reproduction Reproducible steps needed label Jul 13, 2023
@aldo-expensify
Copy link
Contributor

@Expensify/design quick question, should the start in the icon for "Lounge access" go white when we hover the button? or just the couch should go white?

image

@sophiepintoraetz
Copy link
Contributor

Asking here too - thank you Aldo!

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@aldo-expensify
Copy link
Contributor

We will go with the star and the couch white.

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@hungvu193
Copy link
Contributor

hungvu193 commented Jul 17, 2023

Just updated my proposal. One question, does the star need to be yellow while it's inactive?

@aldo-expensify
Copy link
Contributor

while it's inactive

While it is not hovered and the couch is green? it should remain yellow

@shawnborton
Copy link
Contributor

Sounds like we decided on Slack to use all white for the icon on hover.

@aldo-expensify aldo-expensify added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 18, 2023
@kbecciv kbecciv changed the title Dev: Web - Lounge access icon does not change color on hover Web - Lounge access icon does not change color on hover Jul 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

📣 @situchan 🎉 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 Aug 9, 2023

📣 @hungvu193 🎉 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 Aug 9, 2023

📣 @oesayan 🎉 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
Copy link

melvin-bot bot commented Aug 9, 2023

@hungvu193 @sophiepintoraetz @aldo-expensify @situchan this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

  • Decide whether any proposals currently meet our guidelines and can be approved as-is today
  • If no proposals meet that standard, please take this issue internal and treat it as one of your highest priorities
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor labels Aug 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

Current assignee @situchan is eligible for the Internal assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @hungvu193 got assigned: 2023-08-09 17:56:06 Z
  • when the PR got merged: 2023-08-15 07:34:16 UTC
  • days elapsed: 3

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 Aug 21, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Lounge access icon does not change color on hover [HOLD for payment 2023-08-28] [$1000] Web - Lounge access icon does not change color on hover Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.55-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 2023-08-28. 🎊

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 Aug 21, 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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@sophiepintoraetz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@hungvu193
Copy link
Contributor

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @hungvu193 got assigned: 2023-08-09 17:56:06 Z
  • when the PR got merged: 2023-08-15 07:34:16 UTC
  • days elapsed: 3

On to the next one 🚀

I think this PR is eligible for urgency bonus, because It got approved in 1 day and only waiting for final review after that.

@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Aug 28, 2023

Payouts due:

Issue Reporter: $250 @oesayan (already paid)
Contributor: $1500 @hungvu193
Contributor+: $1500 @situchan - I'll release payment once the checklist is finished.

Eligible for 50% #urgency bonus? Y

image

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Aug 28, 2023
@sophiepintoraetz
Copy link
Contributor

Bump @situchan

@situchan
Copy link
Contributor

situchan commented Aug 29, 2023

This was missed during initial implementation of lounge access page in #20881.
I don't think regression test is needed here. This is super minor UI bugimprovement which doesn't affect users.

@sophiepintoraetz
Copy link
Contributor

All set here.

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 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

9 participants