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

Add border radius to button container. Fix rectangular outline when focused. #13377

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Dec 6, 2022

Fixed Issues

$ #13372

Tests

Same as QA

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Log out
  2. Use the keyboard and press "tab" until the "Continue" button is highlighted
  3. Verify that the button has a blue highlight and that it's shape is rounded border matching the button edge. It should not be rectangular.
  • 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:
    • 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 was added in all src/languages/* files
    • 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 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
2022-12-06_10-30-57.mp4
Mobile Web - Chrome

2022-12-12_12-41-21

Mobile Web - Safari

2022-12-12_12-29-53

Desktop 2022-12-06_14-08-50
iOS

N/A

Android

N/A

@marcaaron marcaaron self-assigned this Dec 6, 2022
@marcaaron
Copy link
Contributor Author

I've tried looking around but I'm not sure if "tab focus" is really a thing on native platforms or something we have to worry about. Tested on mobile web Safari with this option enabled and it looks good.

2022-12-12_12-30-25

@marcaaron
Copy link
Contributor Author

Ok, tab focus seem not relevant for native. At least for now - there's no accessibility outline for the button nor is it tab focusable.

@marcaaron marcaaron marked this pull request as ready for review December 12, 2022 22:50
@marcaaron marcaaron requested a review from a team as a code owner December 12, 2022 22:50
@melvin-bot melvin-bot bot requested review from aimane-chnaif and joelbettner and removed request for a team December 12, 2022 22:51
@melvin-bot
Copy link

melvin-bot bot commented Dec 12, 2022

@aimane-chnaif @joelbettner 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]

@aimane-chnaif
Copy link
Contributor

Tested as many pages as possible where Button component is used.
So far looks good on chrome, desktop.
Will test more on safari after 403 auth error gone (not able to test right now because logged out already)

@aimane-chnaif
Copy link
Contributor

One thing: this is not using Button component but avatar highlight should be rounded as well?
Screenshot 2022-12-13 at 5 13 44 PM

@marcaaron
Copy link
Contributor Author

@aimane-chnaif Not gonna tackle that in this PR. At first glance... it's not really clear how the outline would work for this shape so I'm not sure if there's anything we would fix about it and it's something I'd ask the design team about in Slack.

@marcaaron
Copy link
Contributor Author

Bump

@aimane-chnaif
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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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
web.mov
Mobile Web - Chrome

mchrome

Mobile Web - Safari

msafari

Desktop
desktop.mov
iOS

ios

Android

android

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 🎉 Tests well

Copy link
Contributor

@aldo-expensify aldo-expensify left a comment

Choose a reason for hiding this comment

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

Tested well for me too

@marcaaron
Copy link
Contributor Author

Cool looks like we have the necessary reviews so gonna pop off @joelbettner.

@joelbettner if you want to review this post merge feel free!

@marcaaron marcaaron merged commit dd8308f into main Dec 16, 2022
@marcaaron marcaaron deleted the marcaaron-fixFocusOutline branch December 16, 2022 21:19
@marcaaron marcaaron removed the request for review from joelbettner December 16, 2022 21:19
@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 823.353 ms → 833.359 ms (+10.006 ms, +1.2%)
nativeLaunch 9.563 ms → 10.032 ms (+0.470 ms, +4.9%)
regularAppStart 0.016 ms → 0.015 ms (-0.001 ms, -3.8%)
runJsBundle 203.531 ms → 191.563 ms (-11.969 ms, -5.9%)
Show details
Name Duration
TTI Baseline
Mean: 823.353 ms
Stdev: 35.269 ms (4.3%)
Runs: 762.6100190000143 775.3173970000353 783.7921329999808 785.6268740000669 790.2760109999217 794.8865229999647 795.3656540000811 795.7349809999578 796.9146680000704 801.7859290000051 805.3316820000764 805.6849710000679 809.2689459999092 810.6133600000758 819.4339079998899 820.5422340000514 825.035731999902 825.0610760001 825.6030550000723 832.1526430000085 836.6851009998936 838.8962210000027 839.3625980000943 853.9494670000859 857.220057999948 857.3154619999696 869.631563999923 870.6163089999463 905.4349469998851 910.431033999892

Current
Mean: 833.359 ms
Stdev: 39.022 ms (4.7%)
Runs: 765.6011169999838 779.4925579999108 785.9278289999347 787.4727560000028 793.2599490000866 795.474382000044 799.5021039999556 800.1299270000309 814.9386950000189 816.44950899994 816.5087309998926 818.1721179999877 823.5889159999788 825.1328459999058 825.6879020000342 825.9506679999176 829.4176950000692 830.47289799992 830.8518040000927 831.5228160000406 843.4791349999141 844.8833069999237 847.5312860000413 859.894462000113 861.1329210000113 873.6499340001028 877.5502939999569 886.7998790000565 898.2579449999612 915.7803549999371 929.6083889999427
nativeLaunch Baseline
Mean: 9.563 ms
Stdev: 1.600 ms (16.7%)
Runs: 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 12 14 14

Current
Mean: 10.032 ms
Stdev: 1.892 ms (18.9%)
Runs: 7 8 8 8 8 8 8 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 12 12 13 13 14 15
regularAppStart Baseline
Mean: 0.016 ms
Stdev: 0.001 ms (5.4%)
Runs: 0.014445000095292926 0.014771000016480684 0.014811000088229775 0.015177000081166625 0.015217999927699566 0.01525900000706315 0.01525900000706315 0.015379999997094274 0.015420999843627214 0.015461999922990799 0.015583999920636415 0.015583999920636415 0.01570700015872717 0.015868999995291233 0.015949999913573265 0.01595000014640391 0.01599099999293685 0.016032000072300434 0.016112999990582466 0.01615400006994605 0.01619499991647899 0.01639799983240664 0.016398000065237284 0.016438999911770225 0.016641999827697873 0.016967999981716275 0.01696800021454692 0.017048999899998307 0.01729299989528954 0.017782000126317143 0.018268999876454473

Current
Mean: 0.015 ms
Stdev: 0.001 ms (7.1%)
Runs: 0.013264999957755208 0.013589999871328473 0.013996999943628907 0.014078999869525433 0.01432300009764731 0.014484999934211373 0.014485999941825867 0.014689999865368009 0.0147299999371171 0.014811000088229775 0.0148930000141263 0.014933000085875392 0.014934000093489885 0.015217999927699566 0.01525900000706315 0.015381000004708767 0.015421000076457858 0.015583999920636415 0.015625 0.015828999923542142 0.01595099992118776 0.015951000154018402 0.01599099999293685 0.015992000000551343 0.01615400006994605 0.016357999993488193 0.01656099990941584 0.016804999904707074 0.016967999981716275 0.017700999975204468 0.0179449999704957
runJsBundle Baseline
Mean: 203.531 ms
Stdev: 28.298 ms (13.9%)
Runs: 156 169 171 174 175 178 178 178 181 186 186 189 190 191 192 192 200 206 211 212 212 213 221 222 224 226 227 230 232 242 270 279

Current
Mean: 191.563 ms
Stdev: 15.817 ms (8.3%)
Runs: 167 169 169 173 176 176 178 179 180 183 183 183 185 186 189 189 191 192 194 195 196 197 201 202 203 203 206 206 207 207 232 233

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @marcaaron in version: 1.2.42-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @yuwenmemon in version: 1.2.42-2 🚀

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants