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: added vertical margin to the code block #15570

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

allroundexperts
Copy link
Contributor

@allroundexperts allroundexperts commented Feb 28, 2023

Details

This PR adds vertical margin to the code block.

Fixed Issues

$ #15299
PROPOSAL: #15299 (comment)

Tests

  1. Open a chat
  2. Send one message - a normal word/sentence, then space and send a codeblock. Then space and send another normal word/sentence.
  3. Code block should be separated from text by 8px.
  • Verify that no errors appear in the JS console

Offline tests

Not applicable

QA Steps

  1. Open a chat
  2. Send one message - a normal word/sentence, then space and send a codeblock. Then space and send another normal word/sentence.
  3. Code block should be separated from text by 8px.
  • 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 / Chrome
    • iOS / native
    • iOS / 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 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.2023-03-01.at.12.55.03.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-03-01.at.1.04.53.AM.mov
Mobile Web - Safari
Screen.Recording.2023-03-01.at.1.05.31.AM.mov
Desktop
Screen.Recording.2023-03-01.at.12.56.06.AM.mov
iOS
Screen.Recording.2023-03-01.at.1.03.03.AM.mov
Android
Screen.Recording.2023-03-01.at.1.04.00.AM.mov

@allroundexperts allroundexperts marked this pull request as ready for review February 28, 2023 20:18
@allroundexperts allroundexperts requested a review from a team as a code owner February 28, 2023 20:18
@melvin-bot melvin-bot bot requested review from eVoloshchak and mountiny and removed request for a team February 28, 2023 20:19
@MelvinBot
Copy link

@mountiny @eVoloshchak 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]

@allroundexperts allroundexperts requested review from eVoloshchak and removed request for mountiny March 1, 2023 15:34
@mountiny mountiny self-requested a review March 1, 2023 15:59
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Looks good to me, @eVoloshchak gonna wait for your testing 🙌

@eVoloshchak
Copy link
Contributor

eVoloshchak commented Mar 2, 2023

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.
  • 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

Web image
Mobile Web - Chrome

image

Mobile Web - Safari

Simulator Screen Shot - iPhone 12 - 2023-03-02 at 13 07 31

Desktop image
iOS

Simulator Screen Shot - iPhone 12 - 2023-03-02 at 13 06 52

Android

image

Copy link
Contributor

@eVoloshchak eVoloshchak left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@mountiny mountiny merged commit 7c226dd into Expensify:main Mar 2, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

✋ 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

github-actions bot commented Mar 2, 2023

Performance Comparison Report 📊

Significant Changes To Duration

Name Duration
Open Search Page TTI 613.880 ms → 685.605 ms (+71.725 ms, +11.7%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 613.880 ms
Stdev: 9.474 ms (1.5%)
Runs: 591.8669430017471 592.8013919964433 600.4876309968531 600.5055349990726 605.7314860001206 607.3845220021904 607.9562579989433 608.6809490025043 608.9366049990058 609.4978029988706 610.7094729989767 612.8994549997151 612.9362800009549 613.0350340008736 613.0695809982717 613.3384610004723 615.0411380007863 615.2513430006802 615.3146160021424 616.9695229977369 617.5209150016308 617.8119719997048 618.1584070026875 620.3591309972107 623.5303960032761 624.0530200004578 624.2627770006657 624.5065510012209 626.156656999141 627.0961509980261 634.4016109965742

Current
Mean: 685.605 ms
Stdev: 16.387 ms (2.4%)
Runs: 655.5664069987833 662.0261229984462 663.3306070007384 665.719239000231 668.5402429997921 669.3706459999084 671.8145349994302 675.6168209984899 676.4545900002122 677.5707609988749 678.5600589998066 679.2385259978473 680.0804850012064 680.5191250033677 683.3112799972296 683.6088059991598 687.6794430017471 690.4475510008633 690.4893799982965 691.9633790031075 692.2427159994841 692.327596001327 696.4199629984796 697.0986329987645 700.6704510003328 703.3411459997296 703.6077479980886 705.282063998282 714.4585370011628 730.7945559993386

Meaningless Changes To Duration

Show entries
Name Duration
App start regularAppStart 0.014 ms → 0.015 ms (+0.001 ms, +4.7%)
App start nativeLaunch 19.844 ms → 19.767 ms (-0.077 ms, ±0.0%)
App start TTI 729.614 ms → 727.878 ms (-1.736 ms, ±0.0%)
App start runJsBundle 204.281 ms → 200.000 ms (-4.281 ms, -2.1%)
Show details
Name Duration
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (4.9%)
Runs: 0.012492001056671143 0.01285799965262413 0.01314299926161766 0.013223998248577118 0.013224001973867416 0.013224001973867416 0.013225000351667404 0.013265002518892288 0.013468999415636063 0.013509001582860947 0.013916000723838806 0.013955999165773392 0.013996999710798264 0.014038000255823135 0.014079000800848007 0.014159999787807465 0.014159999787807465 0.014159999787807465 0.014201000332832336 0.014322999864816666 0.014362998306751251 0.014485999941825867 0.01452600210905075 0.014607999473810196 0.01464800164103508 0.014688998460769653 0.014771003276109695 0.014852002263069153 0.014892999082803726 0.015054997056722641 0.015136998146772385

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.7%)
Runs: 0.01297999918460846 0.01297999918460846 0.01342800259590149 0.013672001659870148 0.013753000646829605 0.01395600289106369 0.013957001268863678 0.014118999242782593 0.014201000332832336 0.014242000877857208 0.014281999319791794 0.01428300142288208 0.014525998383760452 0.014567002654075623 0.014607999473810196 0.01464800164103508 0.014730002731084824 0.014770999550819397 0.014811001718044281 0.014812000095844269 0.014973998069763184 0.015014000236988068 0.015298999845981598 0.015421997755765915 0.015422001481056213 0.015502996742725372 0.015542998909950256 0.015584003180265427 0.015625 0.01574699953198433 0.01586899906396866 0.016520000994205475
App start nativeLaunch Baseline
Mean: 19.844 ms
Stdev: 1.481 ms (7.5%)
Runs: 17 17 18 18 18 18 18 18 18 19 19 20 20 20 20 20 20 20 21 21 21 21 21 21 21 21 21 21 21 22 22 22

Current
Mean: 19.767 ms
Stdev: 1.334 ms (6.7%)
Runs: 17 18 18 18 18 19 19 19 19 19 19 19 19 19 19 20 20 20 20 21 21 21 21 21 21 21 21 22 22 22
App start TTI Baseline
Mean: 729.614 ms
Stdev: 36.608 ms (5.0%)
Runs: 669.214552000165 678.1870499998331 680.3124010004103 681.330883000046 691.6816079989076 694.6921349987388 696.335705999285 698.0685419999063 701.9040389992297 706.9471720010042 712.7932850010693 715.7833090014756 719.2309679985046 721.4151879996061 722.9276000000536 723.4125339984894 724.3750879988074 724.8913620002568 725.1941169984639 728.3898940011859 728.3978370018303 746.8318269997835 756.3046669997275 760.0895829983056 760.6129450015724 768.2218980006874 770.1992899999022 771.3405570015311 773.4686850011349 775.4396510012448 797.3009469993412 822.3552469983697

Current
Mean: 727.878 ms
Stdev: 31.849 ms (4.4%)
Runs: 670.2342390008271 677.1430560015142 680.7157539986074 683.8228869996965 699.1324150003493 700.7665599994361 701.3954989984632 704.7572049982846 708.6478330008686 708.9098999984562 709.5596409998834 711.3414789997041 712.0831310003996 716.1807300001383 718.9807109981775 719.3309909999371 719.3898480013013 728.8270989991724 734.5884159989655 738.8514599986374 740.4759039990604 742.8877240009606 746.0785939991474 749.4979600012302 754.1392460018396 755.3009670004249 761.4172899983823 767.7891369983554 774.0647759996355 775.9368249997497 789.3650659993291 790.4814720004797
App start runJsBundle Baseline
Mean: 204.281 ms
Stdev: 26.632 ms (13.0%)
Runs: 166 166 170 177 178 179 180 182 185 186 188 191 195 197 199 199 200 200 201 204 206 207 208 222 231 232 233 237 245 251 256 266

Current
Mean: 200.000 ms
Stdev: 15.463 ms (7.7%)
Runs: 167 177 182 183 186 186 186 188 188 190 190 192 193 195 196 197 201 204 204 205 206 207 208 213 217 219 221 221 225 225 228

@github-actions github-actions bot added the DeployBlockerCash This issue or pull request should block deployment label Mar 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker.

@mountiny
Copy link
Contributor

mountiny commented Mar 2, 2023

Completely unrelated again

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to staging by https://github.com/mountiny in version: 1.2.78-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2023

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.78-0 🚀

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
DeployBlockerCash This issue or pull request should block deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants