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

Fix icon color for saved search popup menu #49569

Merged

Conversation

jaydamani
Copy link
Contributor

@jaydamani jaydamani commented Sep 21, 2024

Details

The icon color inside three dot menu for saved search are incorrect.

Fixed Issues

$ #49440
PROPOSAL: #49440 (comment)

Tests

  1. Go to search tab
  2. Click on three dot menu on right side of a saved search
  3. Verify the default icon color is grey
  4. Hover or click one of the item in the menu
  5. Verify the color on hover/click is green
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Go to search tab
  2. Create a saved search if not present
  3. If on mobile devices, click grey button on top for list of saved searches
  4. Click on three dot menu on right side of a saved search
  5. Verify the default icon color is grey
  6. Hover or click one of the item in the menu
  7. Verify the color on hover/click is green
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

Screenshot_1726911113

Android: mWeb Chrome

Screenshot_1726911747

iOS: Native

Simulator Screenshot - iPhone 16 - 2024-09-21 at 11 59 02

iOS: mWeb Safari

Simulator Screenshot - iPhone 16 - 2024-09-21 at 12 03 22

MacOS: Chrome / Safari Screenshot 2024-09-21 at 08 26 58
MacOS: Desktop Screenshot 2024-09-21 at 12 09 07

@jaydamani jaydamani requested a review from a team as a code owner September 21, 2024 10:11
Copy link

melvin-bot bot commented Sep 21, 2024

@ishpaul777 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot removed the request for review from a team September 21, 2024 10:11
@ishpaul777
Copy link
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native
Screen.Recording.2024-09-21.at.5.01.17.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-09-21.at.5.03.21.PM.mov
iOS: Native
Screen.Recording.2024-09-21.at.4.52.02.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-09-21.at.4.54.35.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-09-21.at.4.48.39.PM.mov
MacOS: Desktop
Screen.Recording.2024-09-21.at.7.19.15.PM.mov

Copy link
Contributor

@ishpaul777 ishpaul777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@melvin-bot melvin-bot bot requested a review from lakchote September 21, 2024 13:56
@ishpaul777
Copy link
Contributor

NAB, curious if we should make similar change in this popover

Screenshot 2024-09-21 at 7 25 32 PM

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 21, 2024

Also since this changes colors for saved seach popover, tagging @Expensify/design for review

I added Design label and/or tagged @Expensify/design so the design team can review the changes.

Screenshots/Videos

Android: Native
Screen.Recording.2024-09-21.at.5.01.17.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-09-21.at.5.03.21.PM.mov
iOS: Native
Screen.Recording.2024-09-21.at.4.52.02.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-09-21.at.4.54.35.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-09-21.at.4.48.39.PM.mov
MacOS: Desktop
Screen.Recording.2024-09-21.at.7.19.15.PM.mov

@lakchote lakchote requested a review from a team September 23, 2024 05:34
@dubielzyk-expensify
Copy link
Contributor

This issue is actually not entirely correct. Cause our default colors on popup is that the icon is green:
CleanShot 2024-09-23 at 15 40 07@2x

But for the Search LHN we've changed the icon color to be green on active and grey on inactive.

I kinda think we should do one of two things here:

  1. Not do anything as the popover is different to the LHN bottom sheet
  2. Change the default icon color to be grey across the app (which we've spoken about before anyways).

I don't think we should treat this as an exception, but keen to hear what @Expensify/design things. cc @luacmartins

@jaydamani
Copy link
Contributor Author

@dubielzyk-expensify option 2 seems like a better choice but if it affects in too many places and we go for option 1, I think it should be still changed for mobile/narrow screens. It is not like a popup there, so it seems inconsistent on mobile devices. (the below screenshot is with changes from this PR)

image

@dubielzyk-expensify
Copy link
Contributor

Yeah. I think if we did 1 and 2 we'd just do it as a separate follow-up. I'm not totally against creating a specific override here, but it just feels a bit off. Let's hear what @dannymcclain thinks.

@dannymcclain
Copy link
Contributor

Ok I think this is my perspective:
The LHN items are different than the popover/menu items. All LHN items currently work this way: Gray icon for static, Green icon for active. You can see them working that way in Settings. So I could definitely see going with Jon's Option 1.

BUT I am a bit torn because I do prefer the update (Option 2) 😅 but am a little concerned about how many places an update like that would touch. ...Although we've been talking about making that change for a looooooong time now.

I do agree with Jon that we should not treat this as exception though. Can we get any insight into the level of effort/scariness for pursuing Option 2?

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 23, 2024

Can we get any insight into the level of effort/scariness for pursuing Option 2?

How far are willing to go if we pursue Option 2, are we talking about only popover menu item icons across app or include the alll other menuitems we have

example:
Screenshot 2024-09-24 at 12 09 37 AM

Screenshot 2024-09-24 at 12 11 15 AM

@dannymcclain @dubielzyk-expensify

Codewise i dont thinnk there's much effort to put in, we can default isPaneMenu to true always and selectively pass false when we need current colors (exactly opposite of what we do today default to false and selectively pass true)

@dannymcclain
Copy link
Contributor

🫣 We were talking about ALL of them 🫣

Although your comment does make me wonder if there's a phased/stepped approach we could potentially take (like start with menu items, then go through our "regular" option rows, and then tackle any stragglers, etc).

But yeah, initially I think Jon and I were talking about all of them everywhere.

@ishpaul777
Copy link
Contributor

its not much of effort to change the color globally TBH, i have prepared a draft PR with no intention to merge if team wants to take a look and we can run adhoc build, if all good we can bring the the changes to this PR

@dannymcclain
Copy link
Contributor

dannymcclain commented Sep 23, 2024

Whoa that's awesome. Let's have some peeps take a look!

@dubielzyk-expensify I tried to run a build for the proof-of-concept-draft-PR mentioned above but likely won't be around when it's finished doing its thing. Please check it out and I'll plan on looking tomorrow. Also, is there anyone else we should bring into this convo about this?

@luacmartins luacmartins self-requested a review September 23, 2024 23:51
@dubielzyk-expensify
Copy link
Contributor

We'll have to do an audit cause I've already found 2 place where it doesn't replace the icon color:
CleanShot 2024-09-24 at 09 52 41@2x
CleanShot 2024-09-24 at 09 53 17@2x

But that being said, I kinda wanna do this. Cause either we do it now-ish or we start having this half n half of Search being the outlier and the rest being different.

Keen to hear if @trjExpensify or @JmillsExpensify have any thoughts.

Also we can always revert this change later if we hate it, but I kinda dig it 😄

@dannymcclain
Copy link
Contributor

We'll have to do an audit cause I've already found 2 place where it doesn't replace the icon color

Totally agree. I also found a spot (Subscription > Request early cancellation) that didn't get the correct color.

But that being said, I kinda wanna do this. Cause either we do it now-ish or we start having this half n half of Search being the outlier and the rest being different.
Also we can always revert this change later if we hate it, but I kinda dig it 😄

This is how I feel too. We've been talking about this update for ages, and I feel like the Search release is "forcing our hand" in a good way. I think we should just lean into it.

Like yes, it's totally possible/probable/likely that there will be a few scattered places that we won't catch and we'll have to file bug reports to fix—but IMO that's acceptable and worth it.

@trjExpensify
Copy link
Contributor

I'm not super passionate, but I'm not really following the issue with what's in prod today based on the current status quo?

The rows in the search popover looks the same as other popovers to me?

image image

@dannymcclain
Copy link
Contributor

but I'm not really following the issue with what's in prod today based on the current status quo?

The "issue" really becomes more pronounced on mobile where our LHN items and menu items become conflated and look almost the same but not quite the same.

@jaydamani
Copy link
Contributor Author

jaydamani commented Sep 24, 2024

We'll have to do an audit cause I've already found 2 place where it doesn't replace the icon color:

Agreed, there will be a few places with some specific exception but since this does not break any functionality I also think they can be fixed as we find them.

Also, I investigated the places mentioned above and they have an issue on staging as well. They do not change color when hovered even on staging.

image

This does not change color because table icon is hardcoded as green. This can be fixed by editing the svg and removing the hardcoded color.

image

image

The color for this place is hardcoded here.
Similar issue exists for "Subscription > Request early cancellation". It is also hardcoded here

@luacmartins
Copy link
Contributor

Ok, sounds like a plan. @jaydamani can you update the PR to invert the isPaneMenu logic, e.g. how we have done here

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaydamani please address the comments above

@jaydamani
Copy link
Contributor Author

@luacmartins working on it

@jaydamani
Copy link
Contributor Author

Updated below places that had hardcoded colors. All of them now change colors on hover:

  • Workspace settings > Expensify Card > select any card > Deactivate card
  • Workspace settings > Workflow > Add approval workflow
  • Workspace settings > Workflow > select any non default workflow > Delete
  • Security settings > Add copilot
  • Subscription > Request early cancellation
  • Table icon in three dot menu inside workspace settings.
    Note: For table icon, the color was hardcoded with fill attribute for path in table.svg. Removing the fill breaks the image so instead fill is set as inherit

Let me know if any of them should be reverted.

Also, I am not sure what should be the best steps for QA. Should we instruct them to roam around in app and find incorrect/old icons or just ask them to verify the above mentioned places where we explicitly made some changes.

@luacmartins
Copy link
Contributor

luacmartins commented Sep 26, 2024

Gonna run an adhoc build. @dubielzyk-expensify @dannymcclain could you please test the build to make sure the colors are correct?

Copy link
Contributor

@dubielzyk-expensify
Copy link
Contributor

Looked everywhere and couldn't find any faults. Looking great! 👏 Would love @dannymcclain 's eyes on it as a double check before we go ahead, but I think this is good

@luacmartins
Copy link
Contributor

Would love @dannymcclain 's eyes on it as a double check before we go ahead, but I think this is good

Thanks for testing. In this case, I'll go ahead and merge this to avoid any conflicts in the meantime. @dannymcclain let me know if you find anything weird and we can address it in a follow up.

@luacmartins luacmartins merged commit 91d11c5 into Expensify:main Sep 26, 2024
16 checks passed
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@dannymcclain
Copy link
Contributor

Totally fine with y'all merging without my review—this is a pretty "low-stakes" update in that we're not really going to break anything here. Sorry I didn't get a chance to check it out yesterday! I will keep my eyes peeled for miscolored icons, but I'm stoked we're finally pushing this through!

Copy link
Contributor

🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.41-0 🚀

platform result
🤖 android 🤖 cancelled 🔪
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@roryabraham
Copy link
Contributor

This appears to have caused a regression: #49885

@luacmartins
Copy link
Contributor

Thanks! Fix merged

Copy link
Contributor

🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants