Skip to content

show compose box before report is ready after logout #16922

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

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

getusha
Copy link
Contributor

@getusha getusha commented Apr 4, 2023

@techievivek @sobitneupane

Details

Fixed Issues

$ #16908
PROPOSAL: N/A

Tests

  1. Logout from the app
  2. Login with a working account
  3. While the skeleton UI is loaded for the chat screen, verify that the compose box is present.
  4. Ensure that you can't enter anything in the composer
  5. Verify that the Add actions, Emoji Icon and Send icon are disabled.
  • Verify that no errors appear in the JS console

Offline tests

  1. Login with a working account
  2. Disconnect the device from internet
  3. While the skeleton UI is loaded for the whole screen, verify that the compose box is present.
  4. Ensure that you can't enter anything in the composer
  5. Verify that the Add actions, Emoji Icon and Send icon are disabled.

QA Steps

Same as Tests

  • 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
Screen.Recording.2023-04-04.at.7.01.25.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-04-04.at.7.03.32.AM.mov
Mobile Web - Safari
Screen.Recording.2023-04-04.at.7.08.05.AM.mov
Desktop
Screen.Recording.2023-04-04.at.8.00.19.AM.mov
iOS
Screen.Recording.2023-04-04.at.9.39.51.AM.mov
Android
Screen.Recording.2023-04-04.at.8.40.45.AM.mov

@getusha getusha requested a review from a team as a code owner April 4, 2023 16:25
@melvin-bot melvin-bot bot requested review from johnmlee101 and mananjadhav and removed request for a team April 4, 2023 16:25
@MelvinBot
Copy link

@johnmlee101 @mananjadhav 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]

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

⚠️ ⚠️ Heads up! This pull request has the CP Staging label ⚠️ ⚠️
If you applied the CP Staging label before the PR was merged, the PR will be be immediately deployed to staging even if the open StagingDeployCash deploy checklist is locked.
However if you applied the CP Staging after the PR was merged it's possible it won't be CP'ed automatically. If you need it to be CP'ed to staging, tag a member of @Expensify/mobile-deployers to CP it manually, otherwise you can wait for it to go out with the next deploy.

@mananjadhav
Copy link
Collaborator

@johnmlee101 Does this need C+ review?

@johnmlee101
Copy link
Contributor

Yes please!

@mananjadhav
Copy link
Collaborator

@johnmlee101 @getusha while the composer loads, I think we should also be able to type the chats right?

The compose box is accessible and a message can be typed even while the skeleton UI loads

Expected result from #14223

composer-while-chat-loads.mov

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

@mananjadhav I don't think it's a good idea to enable the compose box before even the chat list renders. It should be disabled since it's initially loading everything.

@mananjadhav
Copy link
Collaborator

I definitely agree it shouldn't be enabled. I am just highlighting it was the expected result in the linked issue, and we should update the tests accordingly and ensure it is not reported as a regression later.

<ReportActionsSkeletonView containerHeight={this.state.skeletonViewContainerHeight} />
<>
<ReportActionsSkeletonView containerHeight={this.state.skeletonViewContainerHeight} />
<EmojiPicker ref={EmojiPickerAction.emojiPickerRef} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't understand why we should move this in this block? Also I see the linked issue is closed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was able to reproduce the issue it's hard to get it at first but got it after several attempts, this fixes that issue and also prevents having two EmojiPicker rendered inside ReportScreen. can you try reproducing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

As I mentioned in this comment, I think the right solution is not to move this inside an if block, rather remove two differences.

This still isn't convincing why it wouldn't open in offline mode. Hence, I think it is better to remove linking the issue, and if required tackle it separately if we're able to reproduce it consistently.

@mananjadhav
Copy link
Collaborator

@getusha Can you please remove #16913. The issue is closed and I can't be sure how we're solving by adding the EmojiPicker inside the !this.isReportReadyForDisplay() check.

I can understand you'd want to remove one extra instance of EmojiPicker (as it's loaded twice). For that I think we should:

  1. Move EmojiPicker in ReportScreen outside of any if block.
  2. Remove EmojiPicker from ReportActionsView

@mananjadhav
Copy link
Collaborator

@getusha Let's improve the content for our Tests:

  1. Logout from the app
  2. Login with a working account
  3. While the skeleton UI is loaded for the chat screen, verify that the compose box is present.
  4. Ensure that you can't enter anything in the composer
  5. Verify that the Add actions, Emoji Icon and Send icon are disabled.

I think we should also update our Offline tests? QA could be same as Tests

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

@mananjadhav Do we need offline tests for this issue? if so what do you think about this

  1. Login with a working account
  2. Disconnect the device from internet
  3. While the skeleton UI is loaded for the whole screen, verify that the compose box is present.
  4. Ensure that you can't enter anything in the composer
  5. Verify that the Add actions, Emoji Icon and Send icon are disabled.

@mananjadhav
Copy link
Collaborator

Yes I think it makes sense to add an offline test. The one you posted here looks fine

@getusha also just confirming are we not removing the two instances of EmojiPicker?

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

@mananjadhav I agree with your idea moving the EmojiPicker outside of the condition and removing the other one from ReportActionsView it makes sense, but should we handle that here as well?

@mananjadhav
Copy link
Collaborator

mananjadhav commented Apr 4, 2023

Yes thats what I feel, because we introduced the second instance of EmojiPicker, in the same PR, for which we're solving the regression.

What I meant by removing the other EmojiPicker related linked issue, is because we can't be certain this is what is causing the issue, and I think, we should look at it fresh/put it on hold, etc. rather than declaring resolved with this PR. What do you think?

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

and I think, we should look at it fresh/put it on hold, etc.

I agree, i also removed the issue from this PR description. the root cause might be different but it seems the EmojiPicker should be rendered before the conditions. like defined inside ReportActionsView

@mananjadhav
Copy link
Collaborator

i also removed the issue from this PR description. the root cause might be different

Thanks for that.

it seems the EmojiPicker should be rendered before the conditions. like defined inside ReportActionsView

I didn't understand this. Hence I recommended, removing it from ReportActionsView altogether, and in ReportScreen it should be outside of all the conditions may be just before the <PortalHost component.

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

This still isn't convincing why it wouldn't open in offline mode. Hence, I think it is better to remove linking the issue, and if required tackle it separately if we're able to reproduce it consistently.

@mananjadhav As you mentioned here, should we handle this separately or should i push the changes here?

@mananjadhav
Copy link
Collaborator

Apologies for the confusion. Let me clarify, I am requesting we fix the multiple EmojiPicker issues in the component tree in this PR because the linked PR introduced it.

Whether that solves the EmojiPicker in Offline mode is a separate issue, which can be first reproduced reliably, and/or kept on Hold (currently it is closed).

So yes we should just ensure we fix the changes introduced by the regression PR. Makes sense?

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

@mananjadhav thanks for clarifying that, just pushed the changes!

Copy link
Collaborator

@mananjadhav mananjadhav left a comment

Choose a reason for hiding this comment

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

Thanks for the changes and the patience here. Code looks good, will test now.

@mananjadhav
Copy link
Collaborator

mananjadhav commented Apr 4, 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
web-composer-when-chat-loading.mov
Mobile Web - Chrome
mweb-chrome-composer-when-chat-loading.mov
Mobile Web - Safari
mweb-safari-composer-when-chat-loading.mov
Desktop
desktop-composer-when-chat-loading.mov
iOS
ios-composer-when-chat-loading.mov
Android

Uploading android-composer-when-chat-loading.mov…


@francoisl I have some issues with the iOS setup. I've completed the checklist for all items except iOS Native. Could you help here?

@getusha
Copy link
Contributor Author

getusha commented Apr 4, 2023

@mananjadhav is it failing to build for IOS? if you have xcode version 14.3 you should either downgrade to 14.2 or apply this workaround travis-mark/lrn@0158547

Copy link
Contributor

@thienlnam thienlnam left a comment

Choose a reason for hiding this comment

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

Taking over review from @johnmlee101 since he's offline right now and it's a deploy blocker

@mananjadhav
Copy link
Collaborator

@getusha Thanks for the link. It is definitely related to XCode 14.3 but the workaround didn't help. My issue was due to React-codegen dependency not compatible with 14.3. I've managed to fix it and updated the screencast.

@thienlnam All yours.

@thienlnam
Copy link
Contributor

Oh perfect, I was working on fixing my simulator to test but this works as well!

@thienlnam thienlnam merged commit efe0a09 into Expensify:main Apr 4, 2023
OSBotify pushed a commit that referenced this pull request Apr 5, 2023
OSBotify added a commit that referenced this pull request Apr 5, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Apr 5, 2023

🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.2.94-3 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@sobitneupane
Copy link
Contributor

Thanks @mananjadhav @getusha for handling the blocker.

@OSBotify
Copy link
Contributor

OSBotify commented Apr 5, 2023

🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.94-3 🚀

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

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants