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

allow option row to have multiple lines of alternate text #15400

Merged
merged 2 commits into from
Feb 24, 2023

Conversation

bernhardoj
Copy link
Contributor

Details

Priority mode Most Recent description text is truncated instead of showing the rest of the text in a new line.

Fixed Issues

$ #15002
PROPOSAL: #15002 (comment)

Tests

Same as QA Steps

  • Verify that no errors appear in the JS console

Offline tests

Same as QA Steps

QA Steps

  1. Open Settings > Preferences > Language
  2. Change the language to Spanish
  3. Go back and open Priority Mode (Modo prioridad)
  4. Select Most recent (Más recientes)
  5. Verify the list item description is not truncated
  • 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
      • 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 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.
  • 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 author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web

web

Mobile Web - Chrome

330910

Mobile Web - Safari

image

Desktop

deesktop

iOS

image

Android

330907

@bernhardoj bernhardoj requested a review from a team as a code owner February 23, 2023 07:42
@melvin-bot melvin-bot bot requested review from Luke9389 and sobitneupane and removed request for a team February 23, 2023 07:42
@MelvinBot
Copy link

@Luke9389 @sobitneupane 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]

@bernhardoj
Copy link
Contributor Author

bernhardoj commented Feb 23, 2023

Additional screenshot to make sure other component that uses OptionRow does not get affected.

view

Workspace Members
4

Workspace Invite Page
image

Pronouns
1

Search Page
2

Report participants
3

Language page
image

New chat Page
image

IOU currency list Page
image

IOU single participants page
image

IOU multiple participants page
image

IOU Confirmation List Page
image

Timezone Select Page
image

@sobitneupane
Copy link
Contributor

@bernhardoj Can you please add screenshots from other components as well which use OptionRow? According to the checklist we are supposed to test all components impacted by the change.

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)

@bernhardoj
Copy link
Contributor Author

Sure. I will add more of the screenshots.

@bernhardoj
Copy link
Contributor Author

I have included more screenshots above. Hopefully it covers all OptionRow usage. Let me know If I miss some.

@@ -27,6 +27,7 @@ const PriorityModePage = (props) => {
value: key,
text: mode.label,
alternateText: mode.description,
alternateTextMaxLines: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

@bernhardoj Can you please add some comments to explain this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, why would we ever want alternateTextMaxLines to be 0? Wouldn't the minimum be 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can set it to 0 to not restrict the maximum number of lines, so it will take as many lines as needed.
https://reactnative.dev/docs/text#numberoflines

Copy link
Contributor

@sobitneupane sobitneupane left a comment

Choose a reason for hiding this comment

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

Screenshots/Videos

Web Screenshot 2023-02-23 at 18 23 55
Mobile Web - Chrome
Mobile Web - Safari
Desktop Screenshot 2023-02-23 at 18 28 27
iOS
Android
Test on other related components

Copy link
Contributor

@sobitneupane sobitneupane left a comment

Choose a reason for hiding this comment

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

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.

@Luke9389 Luke9389 merged commit 893d07a into Expensify:main Feb 24, 2023
@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

Name Duration
Open Search Page TTI 605.222 ms → 670.823 ms (+65.600 ms, +10.8%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 605.222 ms
Stdev: 28.036 ms (4.6%)
Runs: 554.931519000791 565.9842130001634 569.0605059992522 571.5486250007525 573.5301919998601 573.850545999594 573.8995770001784 578.0008550006896 581.8435469996184 583.7049969993532 587.7080889996141 588.2108970005065 591.2215989995748 602.6271159993485 606.980508999899 607.421753000468 607.8162839999422 608.1918949997053 610.131184999831 614.5086270002648 615.8828940000385 616.2734380001202 616.3685709992424 616.8971770005301 618.0018720002845 619.3253170000389 626.6014399994165 627.8834640001878 635.9850670006126 643.1325280005112 657.4952399991453 663.6179200001061 663.7045499999076

Current
Mean: 670.823 ms
Stdev: 15.742 ms (2.3%)
Runs: 639.7543540000916 646.1561279995367 651.2722979998216 653.7824299996719 654.3232430005446 654.8226720001549 656.2265630001202 659.4988609999418 660.7309980001301 661.6228430001065 662.1275639999658 662.5255539994687 667.0223390003666 667.5490319998935 669.8467619996518 670.5410559996963 671.355835000053 672.6749269999564 677.2390139997005 677.9795739995316 681.3389900000766 682.8704430004582 682.9195149997249 683.2198080001399 684.2996020000428 685.1573900002986 690.3358559999615 692.1639399994165 697.2372239995748 708.0818279990926

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 683.381 ms → 696.579 ms (+13.199 ms, +1.9%)
App start runJsBundle 181.800 ms → 183.094 ms (+1.294 ms, +0.7%)
App start nativeLaunch 20.903 ms → 21.688 ms (+0.784 ms, +3.8%)
App start regularAppStart 0.013 ms → 0.014 ms (+0.001 ms, +8.8%)
Show details
Name Duration
App start TTI Baseline
Mean: 683.381 ms
Stdev: 16.818 ms (2.5%)
Runs: 647.2265860000625 655.3717000000179 660.6470959996805 669.962175000459 671.8789619999006 672.3666319996119 672.8219170002267 673.2253459999338 673.3231830000877 675.1019900003448 675.5661110002548 675.5922290002927 676.3427240001038 677.4883199995384 677.6494899997488 680.7482690000907 680.8285039998591 681.7697170004249 682.5284909997135 683.2536960002035 684.6002479996532 690.0385769996792 697.5621459996328 697.8487139996141 699.3015639996156 700.1995200002566 702.6228090003133 703.4026899999008 705.4648179998621 711.4343370003626 728.6293730000034

Current
Mean: 696.579 ms
Stdev: 16.772 ms (2.4%)
Runs: 670.070058000274 672.2005789997056 673.7444580001757 678.1534510003403 680.0196479996666 680.0990869998932 680.643985000439 682.3129340000451 683.089925000444 685.235038000159 685.7632259996608 689.32773500029 691.6496770000085 694.0180919999257 695.3796520000324 695.5044400002807 698.8582969997078 699.0292950002477 699.0934480000287 702.5461680004373 702.9610529998317 702.9829540001228 703.1660040002316 703.4647589996457 703.9419510001317 712.264140999876 714.3588650003076 720.6250510001555 727.5877480003983 729.7631170004606 736.1025660000741
App start runJsBundle Baseline
Mean: 181.800 ms
Stdev: 8.833 ms (4.9%)
Runs: 168 168 171 171 172 173 173 174 174 175 176 177 178 181 182 184 184 184 186 186 187 187 188 189 189 191 194 195 195 202

Current
Mean: 183.094 ms
Stdev: 14.419 ms (7.9%)
Runs: 162 166 169 169 169 171 172 172 173 173 175 176 176 176 177 178 178 182 182 183 184 186 186 187 191 195 201 203 206 208 210 223
App start nativeLaunch Baseline
Mean: 20.903 ms
Stdev: 2.053 ms (9.8%)
Runs: 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 21 21 21 21 21 21 21 22 22 23 23 24 25 26 26

Current
Mean: 21.688 ms
Stdev: 2.284 ms (10.5%)
Runs: 19 19 19 20 20 20 20 20 20 20 20 20 20 20 21 21 21 21 21 22 22 22 23 23 23 24 24 24 25 25 27 28
App start regularAppStart Baseline
Mean: 0.013 ms
Stdev: 0.001 ms (4.7%)
Runs: 0.012043999508023262 0.012125999666750431 0.012411000207066536 0.012492000125348568 0.012613999657332897 0.012655000202357769 0.01269499957561493 0.012695999816060066 0.012817000038921833 0.012817999348044395 0.01281800027936697 0.01285799965262413 0.012899000197649002 0.012899000197649002 0.013060999102890491 0.013102000579237938 0.013183999806642532 0.013264999724924564 0.013265000656247139 0.013305999338626862 0.013306000269949436 0.0134680001065135 0.0134680001065135 0.013590999878942966 0.013631000183522701 0.013833999633789062 0.014038000255823135 0.014119000174105167 0.01416000071913004 0.014240999706089497 0.014526999555528164

Current
Mean: 0.014 ms
Stdev: 0.001 ms (5.4%)
Runs: 0.013061999343335629 0.01318300049751997 0.0134680001065135 0.013590999878942966 0.013590999878942966 0.013631000183522701 0.013631000183522701 0.013794000260531902 0.013835000805556774 0.013915999792516232 0.013915999792516232 0.013915999792516232 0.013915999792516232 0.013955999165773392 0.014038000255823135 0.01411999948322773 0.014282000251114368 0.014322999864816666 0.014486000873148441 0.014526999555528164 0.014649000018835068 0.014689000323414803 0.0147299999371171 0.014810999855399132 0.014973999932408333 0.015137000009417534 0.015298999845981598 0.015421000309288502 0.015461999922990799 0.015665000304579735 0.0163569999858737

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

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/Luke9389 in version: 1.2.77-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/Luke9389 in version: 1.2.77-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.77-4 🚀

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