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

Dark Mode Tweaks #13748

Merged
merged 4 commits into from
Dec 23, 2022
Merged

Dark Mode Tweaks #13748

merged 4 commits into from
Dec 23, 2022

Conversation

grgia
Copy link
Contributor

@grgia grgia commented Dec 20, 2022

Details

Changes made:

Update camera icon
image

MenuItem highlight color
imageimage

Line Divider color
image

Match comma color
imageimage

Fixed Issues

$ #13729
$ #13735
$ #13747
$ #13728

Tests

  • Verify that no errors appear in the JS console
  • Go to profile > click on avatar > ensure camera icon matches description
  • Go to an IOU where you owe money > click pay > ensure dropdown menu button divider line is appBG color
  • Go to LHN and find an unread group chat with 3+ people > ensure commas are white > click to read > ensure commas are now supporting text color
  • Open a menu (press + button) and ensure that the highlight color matches the description (web/desktop only)
  • Go to a workspace > send invoice > hover over "Send invoice" and "View all invoices" > ensure that the hover color matches the description

Offline tests

QA Steps

  • Verify that no errors appear in the JS console
  • Same as Tests

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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 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 correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • 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 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(themeColors.componentBG)
  • 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 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2022-12-21.at.4.17.02.PM.mov
Mobile Web - Chrome
Screen.Recording.2022-12-21.at.4.23.26.PM.mov
Mobile Web - Safari
Screen.Recording.2022-12-21.at.4.26.02.PM.mov
Desktop
Screen.Recording.2022-12-21.at.4.19.37.PM.mov
iOS
Screen.Recording.2022-12-21.at.4.27.50.PM.mov
Android
Screen.Recording.2022-12-21.at.4.24.38.PM.mov

@grgia grgia self-assigned this Dec 20, 2022
@shawnborton
Copy link
Contributor

Screenshots look great, thanks for the speedy work!

@grgia grgia changed the title [WIP] Dark Mode Tweaks Dark Mode Tweaks Dec 21, 2022
@grgia grgia marked this pull request as ready for review December 22, 2022 00:33
@grgia grgia requested a review from a team as a code owner December 22, 2022 00:33
@melvin-bot melvin-bot bot requested review from aimane-chnaif and amyevans and removed request for a team December 22, 2022 00:33
@melvin-bot
Copy link

melvin-bot bot commented Dec 22, 2022

@aimane-chnaif @amyevans One of you needs to 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]

@grgia
Copy link
Contributor Author

grgia commented Dec 22, 2022

Thoughts on this side-by-side?
(1px vs 2px):
imageimage

@shawnborton
Copy link
Contributor

I think I prefer 1px, but I don't feel too strongly.

@aimane-chnaif
Copy link
Contributor

I think I prefer 1px, but I don't feel too strongly.

same to me 🙂

But if we use 2px, tab highlight border can be applied to boundaries after making transparent on space between 2 buttons:

button.with.dropdown.mov

@shawnborton
Copy link
Contributor

Can you show a comparison for the tab highlighting with 1px gap? I feel like it will work fine, because the tab highlight is an outer outline right?

@aimane-chnaif
Copy link
Contributor

Can you show a comparison for the tab highlighting with 1px gap? I feel like it will work fine, because the tab highlight is an outer outline right?

If 1 px, 2 buttons borders are not consistent because of overlapping one over another

button.with.dropdown.mov

@aimane-chnaif
Copy link
Contributor

But both are only applied when border is transparent which makes space between buttons.
If any color is set to border, cannot use this approach.

@aimane-chnaif
Copy link
Contributor

So are we good with current version which uses 1px but no highlight border around boundaries? @shawnborton

button.with.dropdown.mov

@shawnborton
Copy link
Contributor

Yeah, I think that latest version you shared looks great

@grgia
Copy link
Contributor Author

grgia commented Dec 22, 2022

Sweet sounds good to me! Looks like this PR is ready for final review in that case

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Dec 23, 2022

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 / Chrome
    • iOS / native
    • iOS / 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 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 correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • 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(themeColors.componentBG)
  • 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web 2 2-2 1 3
209170965-603911fe-0221-4647-8661-c97ec0db4e76.mov
4 4-2
Mobile Web - Chrome
mchrome.mp4
Mobile Web - Safari
msafari.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.mp4

NOTE: Web has screenshots for each issue respectively, other platforms are videos

Copy link
Contributor

@aimane-chnaif aimane-chnaif left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@shawnborton
Copy link
Contributor

Looks good to me too - going to go ahead and merge this as Amy is OOO.

@shawnborton shawnborton merged commit 7f276b6 into main Dec 23, 2022
@shawnborton shawnborton deleted the georgia-darkModeTweaks branch December 23, 2022 15:52
@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.

@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
TTI 831.476 ms → 850.950 ms (+19.474 ms, +2.3%)
runJsBundle 200.500 ms → 210.094 ms (+9.594 ms, +4.8%)
nativeLaunch 9.323 ms → 9.767 ms (+0.444 ms, +4.8%)
regularAppStart 0.014 ms → 0.017 ms (+0.003 ms, +19.0%) 🔴
Show details
Name Duration
TTI Baseline
Mean: 831.476 ms
Stdev: 42.644 ms (5.1%)
Runs: 761.429049000144 771.5527209993452 791.1377820000052 795.0002350006253 796.1352510005236 798.2088159993291 801.9084740001708 805.2123709991574 805.9559119995683 809.3368880003691 810.1645030006766 812.5926699992269 813.7514529991895 814.2989489994943 814.3837730009109 818.245312999934 820.1996059995145 823.1395570002496 826.4088150002062 827.6637130007148 839.254117000848 839.9489569999278 840.0850649997592 849.6907330006361 860.3261200003326 871.2317869998515 878.3411190006882 894.8089439999312 916.0710889995098 926.3442499991506 942.9166209995747

Current
Mean: 850.950 ms
Stdev: 46.426 ms (5.5%)
Runs: 764.9972229991108 778.3632030002773 784.3840580005199 788.2646079994738 798.2006969992071 810.1217410005629 811.0986850000918 812.5180990006775 815.9234909992665 826.1486649997532 826.4639240000397 830.1280380003154 834.5713069997728 838.5451970007271 845.6994039993733 852.9483049996197 858.8134940005839 860.0651110000908 864.0226349998266 867.9256229996681 868.6125879995525 872.2447040006518 879.7847370002419 882.7817069999874 886.4821979999542 896.4673519991338 902.0137670002878 914.6120699997991 929.1654119994491 931.6776689998806 946.4069619998336
runJsBundle Baseline
Mean: 200.500 ms
Stdev: 19.898 ms (9.9%)
Runs: 169 170 172 177 178 185 185 186 186 188 188 188 188 195 196 203 205 205 205 207 208 214 218 222 223 225 227 228 228 246

Current
Mean: 210.094 ms
Stdev: 27.101 ms (12.9%)
Runs: 173 176 176 178 180 181 181 183 187 189 191 192 196 198 204 209 211 213 214 216 219 220 227 227 229 230 244 248 250 254 261 266
nativeLaunch Baseline
Mean: 9.323 ms
Stdev: 1.353 ms (14.5%)
Runs: 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 11 11 11 11 13 13

Current
Mean: 9.767 ms
Stdev: 1.838 ms (18.8%)
Runs: 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 11 12 12 12 12 13 14 14
regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (6.9%)
Runs: 0.012897999957203865 0.013101998716592789 0.013141999021172523 0.013225000351667404 0.013305999338626862 0.013345999643206596 0.013467999175190926 0.013630999252200127 0.013630999252200127 0.013793999329209328 0.013794001191854477 0.013915998861193657 0.013996999710798264 0.014079000800848007 0.014118999242782593 0.01411999948322773 0.014159999787807465 0.014241000637412071 0.0143630001693964 0.014445001259446144 0.014445001259446144 0.014485999941825867 0.014567000791430473 0.015056001022458076 0.015461999922990799 0.01550300046801567 0.015625 0.015625 0.015706000849604607 0.015786999836564064 0.015991000458598137 0.017090000212192535

Current
Mean: 0.017 ms
Stdev: 0.001 ms (5.2%)
Runs: 0.0157880000770092 0.015991000458598137 0.015991000458598137 0.01603199914097786 0.016114000231027603 0.016276998445391655 0.01635799929499626 0.016520000994205475 0.016642000526189804 0.016642998903989792 0.01668200083076954 0.016805000603199005 0.016845999285578728 0.017009001225233078 0.017131000757217407 0.017211999744176865 0.0172520000487566 0.0172520000487566 0.0172520000487566 0.0174150001257658 0.017578000202775 0.017822999507188797 0.017945000901818275 0.01810699887573719 0.01810699887573719 0.018350999802350998 0.018473001196980476 0.019572000950574875

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @shawnborton in version: 1.2.44-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.44-0 🚀

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

@@ -75,7 +75,7 @@ const MenuItem = (props) => {
}}
style={({hovered, pressed}) => ([
styles.popoverMenuItem,
StyleUtils.getButtonBackgroundColorStyle(getButtonState(props.focused || hovered, pressed, props.success, props.disabled, props.interactive)),
StyleUtils.getButtonBackgroundColorStyle(getButtonState(props.focused || hovered, pressed, props.success, props.disabled, props.interactive), true),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hover background colour for menu item turned out to be the same as the one for block quotes thereby causing this issue where the quote line became invisible.

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

Successfully merging this pull request may close these issues.

5 participants