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 navigation in ExpensifyHelp #15192

Merged
merged 3 commits into from
Feb 22, 2023
Merged

Fix navigation in ExpensifyHelp #15192

merged 3 commits into from
Feb 22, 2023

Conversation

marcochavezf
Copy link
Contributor

Details

The navigation from a Playbook article to the hub Playbook hub page is broken because we are checking according to a list of fixed hub pages:

Screen.Recording.2023-02-15.at.18.51.17.mov

This PR fixes the navigation by checking dynamically if the route belongs to one of the existing hubs.

Fixed Issues

$ N/A

Tests

  1. Navigate to one of the Playbook article (on dev http://localhost:4000/articles/playbooks/Expensify-Playbook-for-US-based-VC-Backed-Startups, on production https://help.expensify.com/articles/playbooks/Expensify-Playbook-for-US-based-VC-Backed-Startups)
  2. Click on the Back button
  3. Verify it navigates to the Playbooks hub page
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as Test steps (only production)

  • 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

ExpensifyHelp only works on web

Web
Screen.Recording.2023-02-15.at.18.59.12.mov

@marcochavezf marcochavezf self-assigned this Feb 16, 2023
@marcochavezf marcochavezf requested a review from a team as a code owner February 16, 2023 01:00
@melvin-bot melvin-bot bot requested review from jasperhuangg and removed request for a team February 16, 2023 01:01
@MelvinBot
Copy link

@jasperhuangg 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]

docs/assets/js/main.js Outdated Show resolved Hide resolved
@jasperhuangg
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 / 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

N/A

Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@jasperhuangg jasperhuangg merged commit 175ca34 into main Feb 22, 2023
@jasperhuangg jasperhuangg deleted the marco-fixPlaybooksNav branch February 22, 2023 23:31
@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 693.570 ms → 711.496 ms (+17.927 ms, +2.6%)
App start regularAppStart 0.013 ms → 0.014 ms (+0.001 ms, +5.8%)
App start runJsBundle 194.781 ms → 194.344 ms (-0.438 ms, ±0.0%)
Open Search Page TTI 605.994 ms → 605.439 ms (-0.555 ms, ±0.0%)
App start nativeLaunch 20.613 ms → 19.967 ms (-0.646 ms, -3.1%)
Show details
Name Duration
App start TTI Baseline
Mean: 693.570 ms
Stdev: 21.178 ms (3.1%)
Runs: 650.8193830000237 661.8001920003444 665.6451089996845 667.2674920000136 672.9487889995798 673.1174689996988 675.0651139998809 676.2165040001273 684.1170030003414 684.3544819997624 685.196232999675 690.6221219999716 693.4124509999529 693.4650360001251 694.5940249999985 694.6990390000865 695.8451220002025 700.5847439998761 701.4936159998178 707.5358490003273 708.7546380003914 709.6020130002871 709.8381260000169 712.1318910000846 715.5060040000826 720.3245160002261 732.8937919996679 742.1015200000256

Current
Mean: 711.496 ms
Stdev: 33.654 ms (4.7%)
Runs: 661.6318779997528 675.940302000381 676.1997210001573 677.8369760001078 679.3572340002283 683.134111000225 685.6929029999301 687.5910259997472 688.5183460004628 688.6013259999454 690.5444590002298 691.8788149999455 693.0406200001016 698.205277999863 699.472721000202 700.6626669997349 706.0467100003734 707.3857739996165 707.4848290001974 709.245918000117 710.4795960001647 713.7228520000353 717.8464289996773 718.3292819997296 734.5535580003634 734.7400319995359 754.3918049996719 760.2342720003799 762.5911090001464 767.4922259999439 787.0460200002417 797.9882530001923
App start regularAppStart Baseline
Mean: 0.013 ms
Stdev: 0.001 ms (7.0%)
Runs: 0.011881000362336636 0.011921999976038933 0.012044000439345837 0.0122079998254776 0.012246999889612198 0.012288999743759632 0.012369999662041664 0.012409999966621399 0.012532999739050865 0.012613999657332897 0.012939000502228737 0.012980000115931034 0.013020999729633331 0.01314299926161766 0.013183999806642532 0.013183999806642532 0.013305999338626862 0.013346999883651733 0.013426999561488628 0.013632000423967838 0.013671999797224998 0.013671999797224998 0.013834000565111637 0.0138349998742342 0.013875000178813934 0.013956000097095966 0.013957000337541103 0.014566999860107899 0.01464799977838993 0.014648999087512493 0.0147299999371171 0.01590999960899353

Current
Mean: 0.014 ms
Stdev: 0.001 ms (4.2%)
Runs: 0.01314299926161766 0.013183999806642532 0.013265000656247139 0.013306000269949436 0.013345999643206596 0.013508999720215797 0.01358999963849783 0.013590999878942966 0.013590999878942966 0.013793999329209328 0.013793999329209328 0.0138349998742342 0.013956000097095966 0.013956999406218529 0.013996999710798264 0.0139979999512434 0.014038000255823135 0.014038000255823135 0.014200999401509762 0.01432300079613924 0.014485999941825867 0.01460800040513277 0.01464799977838993 0.014688999392092228 0.0147299999371171 0.014771000482141972 0.014852000400424004 0.014933000318706036 0.014973999932408333 0.015339999459683895
App start runJsBundle Baseline
Mean: 194.781 ms
Stdev: 20.953 ms (10.8%)
Runs: 159 160 165 168 171 175 176 180 181 185 186 188 188 189 192 192 192 193 196 196 198 201 204 205 212 217 222 222 223 223 226 248

Current
Mean: 194.344 ms
Stdev: 18.935 ms (9.7%)
Runs: 165 169 172 172 176 179 179 179 180 181 181 184 184 185 186 188 190 190 195 198 198 201 208 209 211 213 215 215 225 225 226 240
Open Search Page TTI Baseline
Mean: 605.994 ms
Stdev: 17.680 ms (2.9%)
Runs: 567.6700440002605 582.0066330004483 582.6302489992231 585.5495199998841 586.6491709994152 587.2899579992518 590.9496670002118 594.4122729999945 594.4573570005596 594.9434820003808 595.4882399998605 596.3684489997104 597.0544030005112 597.3293460002169 597.7983400002122 604.1809489997104 605.0568039994687 606.3774420004338 607.3403320005164 608.4849039996043 614.044719000347 620.1614590007812 620.871460000053 621.3823659997433 621.4105630004779 624.6228849999607 627.4455570001155 627.4805910000578 629.4801430003718 629.8802899997681 634.9930829992518 637.9943040004

Current
Mean: 605.439 ms
Stdev: 18.769 ms (3.1%)
Runs: 569.4578050002456 576.311767000705 579.5089120008051 583.4296469995752 585.0506189996377 585.2766530001536 588.6710609998554 589.9005540004 590.7040210003033 594.0649819998071 599.5032970001921 600.1207280000672 600.875121999532 601.1467289999127 601.3707280000672 601.5522469999269 601.6128750005737 603.5351560004056 604.7080889996141 605.0239670006558 606.4278159998357 606.7079270007089 611.4051109999418 616.2083330005407 620.1542159998789 622.034789999947 624.416016000323 627.0001629991457 630.1916100000963 634.0491949999705 635.2331539997831 638.1440840000287 645.6958010001108
App start nativeLaunch Baseline
Mean: 20.613 ms
Stdev: 2.210 ms (10.7%)
Runs: 17 18 18 18 18 19 19 19 19 19 19 19 20 20 20 20 20 21 21 21 22 22 22 22 22 23 23 23 23 26 26

Current
Mean: 19.967 ms
Stdev: 2.008 ms (10.1%)
Runs: 17 18 18 18 18 18 18 18 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 22 22 24 25 25

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/jasperhuangg in version: 1.2.76-1 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.76-7 🚀

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

1 similar comment
@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.76-7 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.76-7 🚀

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

@parasharrajat
Copy link
Member

Not a regression from this PR especially but we could have handled such scenarioshttps://github.com//issues/22014 as well while fixing the navigation for docs.

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