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/15079: Clicking on the send icon on the compose box closes the Keyboard on mweb chrome #15554

Conversation

tienifr
Copy link
Contributor

@tienifr tienifr commented Feb 28, 2023

Details

The logic in onMouseDown that prevent the keyboard from being closed when clicking is not triggered when the Send button is disabled. We need to move that e.preventDefault logic to the container that wraps the Send button instead. This PR does that

Fixed Issues

$ #15079
$ #15079 (comment)

Tests

  1. Open the app on mWeb
  2. Go to a chat
  3. Click on Chatbox (don't write anything)
  4. Then the keyboard appears. Now, click on the send button on the chatbox
  5. Verify that it doesn’t close the keyboard upon clicking the send icon.
  6. Do 5 above steps again on Android and verify that it is consistent between MWEB CHROME & ANDROID
  • Verify that no errors appear in the JS console

Offline tests

Same above

QA Steps

  1. Open the app on mWeb
  2. Go to a chat
  3. Click on Chatbox (don't write anything)
  4. Then the keyboard appears. Now, click on the send button on the chatbox
  5. Verify that it doesn’t close the keyboard upon clicking the send icon.
  6. Do 5 above steps again on Android and verify that it is consistent between MWEB CHROME & ANDROID
  • 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.3.mp4
Mobile Web - Chrome
chrome.mp4
Mobile Web - Safari
safari.1.mp4
Desktop
desktop.mp4
iOS
iosnative.mp4
Android
Screen-Recording-2023-02-28-at-16.55.05.mp4

@tienifr tienifr marked this pull request as ready for review March 1, 2023 12:46
@tienifr tienifr requested a review from a team as a code owner March 1, 2023 12:46
@melvin-bot melvin-bot bot requested review from mollfpr and nkuoch and removed request for a team March 1, 2023 12:46
@MelvinBot
Copy link

@nkuoch @mollfpr 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]

@mollfpr
Copy link
Contributor

mollfpr 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
15554.Web.mov
Mobile Web - Chrome
15554.mWeb.Chrome.mp4
Mobile Web - Safari
15554.mWeb.Safari.mp4
Desktop
15554.Desktop.mov
iOS
15554.iOS.mp4
Android
15554.Android.mp4

Copy link
Contributor

@mollfpr mollfpr left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@nkuoch nkuoch merged commit 880109f into Expensify:main Mar 2, 2023
@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 602.783 ms → 663.942 ms (+61.160 ms, +10.1%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 602.783 ms
Stdev: 21.280 ms (3.5%)
Runs: 569.574137000367 578.6928710006177 578.6987720001489 580.7977710003033 581.072224999778 583.260009999387 585.3011880004779 586.6389969997108 587.3407390005887 587.6894120005891 589.7067470001057 590.6024170005694 591.6418460002169 592.8747560000047 593.8081869995221 594.1118979994208 594.5393889993429 602.234822999686 604.1712649995461 604.2738849995658 604.4654139997438 607.4409179994836 611.9069010000676 612.3954270007089 613.2896729996428 614.2016599997878 616.8049720004201 621.4672039998695 628.8057059999555 631.3050540005788 643.9644370004535 649.5945640001446 659.1551919998601

Current
Mean: 663.942 ms
Stdev: 22.745 ms (3.4%)
Runs: 619.4329840000719 621.08227599971 629.4467780003324 633.3963630003855 645.9104000004008 648.7948810001835 649.8389900000766 650.4588629994541 650.627970000729 651.1256519993767 653.7908939998597 654.8080250006169 657.2751870006323 657.6714690001681 657.706991000101 658.1784269995987 661.7166750002652 663.9905190002173 665.7279869997874 666.2555749993771 666.3508310001343 670.0337730003521 670.8014740003273 672.9202879993245 673.8164480002597 679.3019610000774 681.6746010007337 682.9430340006948 687.8395999995992 696.1323650004342 697.4429120002314 715.9915370000526 717.6131180003285

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 714.222 ms → 721.110 ms (+6.889 ms, +1.0%)
App start regularAppStart 0.014 ms → 0.014 ms (+0.001 ms, +5.8%)
App start nativeLaunch 19.452 ms → 19.129 ms (-0.323 ms, -1.7%)
App start runJsBundle 202.094 ms → 196.781 ms (-5.313 ms, -2.6%)
Show details
Name Duration
App start TTI Baseline
Mean: 714.222 ms
Stdev: 31.792 ms (4.5%)
Runs: 641.1123620001599 662.2652059998363 675.3510469999164 675.7903410000727 677.333154999651 685.6031759995967 690.3568430002779 691.5173089997843 695.6632070001215 699.3790020002052 700.698274999857 700.824482999742 701.7304640002549 702.1761119998991 702.1868899995461 706.5334540000185 709.4277450004593 710.7290629995987 719.1979700000957 724.8822640003636 726.8668640004471 730.4588029999286 739.488951000385 742.7831859998405 746.5613949997351 746.8118730001152 751.2382039995864 752.2743710000068 752.9903250001371 753.9513240000233 754.3788000000641 784.5264280000702

Current
Mean: 721.110 ms
Stdev: 27.582 ms (3.8%)
Runs: 665.6270460002124 675.9769059997052 677.4795209998265 686.3725600000471 687.16657499969 688.0231879996136 690.0692710001022 697.2563749998808 702.548596999608 703.4327999996021 704.2798300003633 716.3588560000062 717.4793760003522 719.2660990003496 721.4669979996979 723.3859540000558 724.6822509998456 730.0454749995843 731.8861109996215 733.087178000249 733.6890669995919 734.7284679999575 736.8005630001426 737.7228830000386 739.5102300001308 740.8693000003695 743.3687530001625 749.2976799998432 758.2947420002893 766.6574990004301 767.7631980003789 770.9411439998075
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (4.0%)
Runs: 0.012614000588655472 0.012899000197649002 0.012980000115931034 0.013062000274658203 0.013183999806642532 0.013224000111222267 0.013264999724924564 0.013264999724924564 0.0133050000295043 0.0133050000295043 0.0133050000295043 0.013346999883651733 0.013387000188231468 0.013427999801933765 0.013427999801933765 0.013469000346958637 0.01358999963849783 0.013630999252200127 0.0138349998742342 0.01387499924749136 0.013875000178813934 0.013997000642120838 0.01403799932450056 0.01403799932450056 0.014038000255823135 0.014282000251114368 0.01444500032812357 0.01464799977838993 0.014689000323414803 0.014851000159978867

Current
Mean: 0.014 ms
Stdev: 0.001 ms (4.7%)
Runs: 0.0133050000295043 0.013305999338626862 0.013346000574529171 0.013549999333918095 0.01355000026524067 0.013835000805556774 0.013875000178813934 0.013916000723838806 0.0139979999512434 0.014038999564945698 0.014078999869525433 0.014161000028252602 0.014201000332832336 0.014282000251114368 0.014485999941825867 0.014525999315083027 0.014525999315083027 0.014607000164687634 0.014810999855399132 0.0148930000141263 0.014933999627828598 0.01505500078201294 0.015095999464392662 0.015095999464392662 0.0152580002322793 0.015258999541401863 0.015259000472724438 0.015544000081717968 0.015625
App start nativeLaunch Baseline
Mean: 19.452 ms
Stdev: 1.682 ms (8.6%)
Runs: 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 20 20 20 20 21 22 22 23 23 24

Current
Mean: 19.129 ms
Stdev: 1.039 ms (5.4%)
Runs: 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 22
App start runJsBundle Baseline
Mean: 202.094 ms
Stdev: 19.612 ms (9.7%)
Runs: 168 172 175 180 182 183 185 186 187 189 189 193 194 197 198 199 200 202 204 205 207 212 213 215 219 221 221 222 232 233 236 248

Current
Mean: 196.781 ms
Stdev: 19.222 ms (9.8%)
Runs: 162 169 172 174 174 175 176 179 179 186 187 188 191 191 193 194 197 197 201 204 205 207 207 209 214 216 217 218 222 223 233 237

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

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to staging by https://github.com/nkuoch 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