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: Android - User can't open context menu by long press on code block. #28709

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

Krishna2323
Copy link
Contributor

@Krishna2323 Krishna2323 commented Oct 3, 2023

Details

Fixed Issues

$ #27187
PROPOSAL: #27187 (comment)

Tests

  1. Open any report
  2. Send a code block
  3. Focus on composer to open keyboard
  4. Try to open context menu by long pressing on the code block
  5. Observe context menu gets opened
  • Verify that no errors appear in the JS console

Offline tests

  1. Open any report
  2. Send a code block
  3. Focus on composer to open keyboard
  4. Try to open context menu by long pressing on the code block
  5. Observe context menu gets opened

QA Steps

  1. Open any report
  2. Send a code block
  3. Focus on composer to open keyboard
  4. Try to open context menu by long pressing on the code block
  5. Observe context menu gets opened
  • 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 the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • 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 grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is 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
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
    • 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 code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • 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 the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • 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_chrome.mp4
Mobile Web - Chrome
android_chrome.mp4
Mobile Web - Safari
ios_safari.mp4
Desktop
desktop_app.mp4
iOS
ios_native.mp4
Android
android_native.mp4

…ck if keyboard is open.

Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
@Krishna2323 Krishna2323 requested a review from a team as a code owner October 3, 2023 10:24
@melvin-bot melvin-bot bot requested review from robertKozik and removed request for a team October 3, 2023 10:24
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@robertKozik
Copy link
Contributor

robertKozik commented Oct 3, 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 the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • 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 grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is 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 code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • 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 the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • 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
web.mov
Mobile Web - Chrome
ios.-.android.-.web.mov
Mobile Web - Safari
ios.-.android.-.web.mov
Desktop
desktop.mov
iOS
ios.-.android.-.native.mov
Android
ios.-.android.-.native.mov

Copy link
Contributor

@robertKozik robertKozik left a comment

Choose a reason for hiding this comment

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

LGTM

@melvin-bot melvin-bot bot requested a review from srikarparsi October 3, 2023 16:36
Copy link
Contributor

@srikarparsi srikarparsi left a comment

Choose a reason for hiding this comment

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

lgtm as well!

@srikarparsi srikarparsi merged commit c222b7f into Expensify:main Oct 4, 2023
15 of 16 checks passed
@OSBotify
Copy link
Contributor

OSBotify commented Oct 4, 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 github-actions bot added the DeployBlockerCash This issue or pull request should block deployment label Oct 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Performance Comparison Report 📊

Significant Changes To Duration

Name Duration
App start TTI 1195.877 ms → 1315.495 ms (+119.618 ms, +10.0%) 🔴
App start runJsBundle 824.452 ms → 929.355 ms (+104.903 ms, +12.7%) 🔴
Show details
Name Duration
App start TTI Baseline
Mean: 1195.877 ms
Stdev: 37.393 ms (3.1%)
Runs: 1111.6144979998935 1118.7529619999696 1138.831414999906 1159.8115230000112 1160.1480749999173 1162.0625889999792 1164.99847900006 1166.925791000016 1176.0303700000513 1180.4658939999063 1182.9949560000096 1183.3165249999147 1186.6163639998995 1187.7316870000213 1192.5125500001013 1197.3459459999576 1197.673259000061 1207.449946000008 1209.3044479999226 1209.9743300001137 1213.042929999996 1216.6305629999842 1217.4845900000073 1221.0588650000282 1223.8648870000616 1225.449811999919 1231.880995000014 1247.564645000035 1256.8457090000156 1260.2424620001111 1263.5667119999416

Current
Mean: 1315.495 ms
Stdev: 36.751 ms (2.8%)
Runs: 1241.1758880000561 1264.1130269998685 1271.882974000182 1276.8675049999729 1285.5057029998861 1286.5454739998095 1287.3849550001323 1287.5110559999011 1288.2028230000287 1291.2764800000004 1292.8122040000744 1294.7643320001662 1296.929380999878 1302.3858610000461 1303.652278999798 1309.2585029997863 1311.392140999902 1314.101824999787 1317.9754670001566 1319.4719170001335 1338.9904249999672 1339.0972090000287 1343.7794750002213 1347.2320929998532 1348.3916369997896 1348.7247669999488 1351.2610889999196 1362.42664900003 1365.7470510001294 1395.430465000216 1396.0505619999021
App start runJsBundle Baseline
Mean: 824.452 ms
Stdev: 34.578 ms (4.2%)
Runs: 743 766 768 778 784 786 801 801 803 807 822 823 824 825 829 831 832 833 834 835 837 837 841 847 849 853 854 861 866 885 903

Current
Mean: 929.355 ms
Stdev: 28.874 ms (3.1%)
Runs: 851 882 900 905 906 907 910 910 911 914 916 917 918 921 922 923 925 929 940 945 946 947 949 951 952 954 954 960 972 977 996

Meaningless Changes To Duration

Show entries
Name Duration
Open Search Page TTI 639.879 ms → 646.281 ms (+6.402 ms, +1.0%)
App start nativeLaunch 21.267 ms → 21.581 ms (+0.314 ms, +1.5%)
App start regularAppStart 0.018 ms → 0.015 ms (-0.003 ms, -16.0%) 🟢
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 639.879 ms
Stdev: 30.610 ms (4.8%)
Runs: 589.8899740001652 605.1181240000296 607.9771319997963 609.8983570002019 609.9730230001733 612.3478190000169 612.5715339998715 615.0438239998184 617.6019700001925 619.0036220001057 619.902546999976 620.2083740001544 623.5453289998695 630.2799480000976 630.9104410000145 632.239501999924 637.0810950000305 640.0185959998053 643.3240160001442 646.9795739999972 647.6949879999738 653.916993000079 654.8836260000244 661.2816979999188 661.5532639999874 663.084635999985 673.4590660003014 679.5465100000147 694.8466799999587 698.3110360000283 723.7587079999503

Current
Mean: 646.281 ms
Stdev: 29.838 ms (4.6%)
Runs: 605.1304929996841 614.9177659996785 618.4980060001835 619.3570969998837 619.9484459999949 620.8411460001953 621.8054610001855 622.0781259997748 622.2657480002381 627.0372729999945 627.8240970000625 628.0826010000892 629.0708830002695 634.5454510003328 635.405557999853 636.728434999939 639.0333660002798 639.5006099999882 645.3448089999147 646.5467940000817 649.568929000292 651.1100260000676 652.2968350001611 655.1978349997662 662.406576000154 669.8349609998986 670.3983149998821 680.9994310000911 689.559936999809 703.5402839998715 707.9757489999756 734.1430659997277
App start nativeLaunch Baseline
Mean: 21.267 ms
Stdev: 2.048 ms (9.6%)
Runs: 19 19 19 19 19 19 20 20 20 20 20 20 20 20 21 21 21 21 22 22 22 22 22 23 23 23 24 24 26 27

Current
Mean: 21.581 ms
Stdev: 1.622 ms (7.5%)
Runs: 19 19 19 19 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23 23 23 23 24 25 25
App start regularAppStart Baseline
Mean: 0.018 ms
Stdev: 0.002 ms (8.9%)
Runs: 0.016032000072300434 0.01615400006994605 0.016804999904707074 0.01688600005581975 0.01692699990235269 0.01700900006107986 0.01721199997700751 0.017293000128120184 0.017414999892935157 0.017577999969944358 0.017577999969944358 0.017699999967589974 0.017700000200420618 0.017700999975204468 0.01774100004695356 0.017863000044599175 0.01798499980941415 0.01818799995817244 0.018229000037536025 0.01827000011689961 0.01831099996343255 0.018391999881714582 0.018554999958723783 0.018961000023409724 0.019652999937534332 0.02034499985165894 0.02038600016385317 0.020589000079780817 0.021078000077977777 0.02115899999625981 0.02136299991980195 0.02294900012202561

Current
Mean: 0.015 ms
Stdev: 0.001 ms (9.5%)
Runs: 0.01334700034931302 0.013427000027149916 0.013509999960660934 0.014078999869525433 0.014241999946534634 0.014322999864816666 0.01436399994418025 0.014404000248759985 0.014444999862462282 0.014690000098198652 0.0147299999371171 0.015015000011771917 0.015055000316351652 0.015137000009417534 0.015217999927699566 0.015217999927699566 0.015339999925345182 0.015339999925345182 0.015625 0.015746999997645617 0.015746999997645617 0.015949999913573265 0.015950999688357115 0.016478999983519316 0.016478999983519316 0.0168869998306036 0.017374999821186066 0.017822000198066235 0.018554999958723783 0.01985599985346198

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 5, 2023

🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.78-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 6, 2023

🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.78-4 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 6, 2023

🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.79-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 9, 2023

🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 9, 2023

🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 9, 2023

🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 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.

4 participants