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: spacing on report typing indicator #10790

Merged
merged 12 commits into from
Oct 21, 2022
Merged

fix: spacing on report typing indicator #10790

merged 12 commits into from
Oct 21, 2022

Conversation

mdneyazahmad
Copy link
Contributor

@mdneyazahmad mdneyazahmad commented Sep 2, 2022

Details

Fixed Issues

$ #10486
PROPOSAL: #10486 (comment)

Tests

  1. Open app
  2. Create group of at least 3 members
  3. Open every account from 3 different devices
  4. Start typing in the group
  5. Verify that "Name is typing..." appears below the composer on another device
  6. Now start typing from one more device (typing on 2 device)
  7. Verify that "Multiple users are typing..." is shown in the third device.
  • Verify that no errors appear in the JS console

QA Steps

  1. Open app
  2. Create group of at least 3 members
  3. Open every account from 3 different devices
  4. Start typing in the group
  5. Verify that "Name is typing..." appears below the composer on another device
  6. Now start typing from one more device (typing on 2 device)
  7. Verify that "Multiple users are typing..." is shown in the third device.
  • Verify that no errors appear in the JS console

PR Review Checklist

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 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 included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 was added in all src/languages/* files
    • 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
  • 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 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • 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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 was added in all src/languages/* files
    • 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

web.mp4

Mobile Web - Chrome

mweb-chrome.mp4

Mobile Web - Safari

mweb-safari.mp4

Desktop

desktop.mp4

iOS

ios.mp4

Android

android.mp4

@mdneyazahmad mdneyazahmad marked this pull request as ready for review September 5, 2022 12:02
@mdneyazahmad mdneyazahmad requested a review from a team as a code owner September 5, 2022 12:02
@melvin-bot melvin-bot bot requested review from Julesssss and parasharrajat and removed request for a team September 5, 2022 12:02
Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

Android: this does not look completely vertically centered.

image

@mdneyazahmad
Copy link
Contributor Author

mdneyazahmad commented Sep 7, 2022

@parasharrajat This is not just android thing but also other platforms. I had figured it out before, but I did not report it then. There is a margin of 5px in bottom of the composer.

Screenshot 2022-09-07 at 1 16 57 PM

App/src/styles/styles.js

Lines 1374 to 1376 in 85172f7

chatFooter: {
marginBottom: 5,
paddingLeft: 20,

-marginBottom: 5,

This will fix the issue. Should we commit it here?

@parasharrajat
Copy link
Member

I don't know why we have a bottom margin here. @shawnborton Could you please take a look and suggest us? Thank you.

@Julesssss
Copy link
Contributor

Julesssss commented Sep 7, 2022

I'm afraid I have no time to test this myself, but you should be able Android Studio to determine the exact margin/padding that is used natively. Build a dev build and use the Layout Inspector tool. You can select the TextInput View and it should show you the exact padding/margin attribute values.

@parasharrajat
Copy link
Member

Thanks, @Julesssss. I already tested it and as @mdneyazahmad suggested there is an applied bottom margin by us. I am just curious to see the design impact of this. Before we remove it, it should be good to take confirmation from design team.

@parasharrajat
Copy link
Member

@mdneyazahmad Please merge main to fix the tests.

@mdneyazahmad
Copy link
Contributor Author

@parasharrajat merged main

@shawnborton
Copy link
Contributor

@parasharrajat this screenshot here looks perfect to me:
image

I agree though that the bottom margin should be removed, not sure why/how that got there.

@parasharrajat
Copy link
Member

parasharrajat commented Sep 8, 2022

Thanks, @shawnborton. the text has little extra space below it due to the margin otherwise, this is good.

@mdneyazahmad Please remove the margin and share the screenshots for android and web of

  1. Typing indicator.
  2. Offline indicator.
  3. ExceededCommentLength indicator.

@parasharrajat
Copy link
Member

Bump @mdneyazahmad

@mdneyazahmad
Copy link
Contributor Author

mdneyazahmad commented Sep 15, 2022

Android

android1

android2

android3

android4

android5

Web

web1

web2

web3

web4

web5

@parasharrajat
Copy link
Member

parasharrajat commented Sep 15, 2022

This is not the composer offline indicator. composer offline indicator is only shown on Web|desktop. So out of scope of this PR.
image

Thanks for the images. Testing it...

@parasharrajat
Copy link
Member

@mdneyazahmad Did you remove the margin?

@shawnborton
Copy link
Contributor

@parasharrajat your recent screenshot looks different from the one above...

image

vs.

image

The second screenshot is correct - there should be just a little bit of margin above the typing/offline indicator.

@parasharrajat
Copy link
Member

parasharrajat commented Sep 15, 2022

Yeah, the first screenshot is an issue but not in the scope of this PR. That is a global offline indicator. Fixed my comment(mistype 😄)

@shawnborton
Copy link
Contributor

Hmm but both the global offline indicator and the typing indicator should take up the exact same space right? So they do seem related to me.

@parasharrajat
Copy link
Member

Yeah, they should. But this PR's issue was only talking about typing indicator which covers all the indicators of the composer. The global offline indicator resides in different parts of the code. But it can be done on this PR if @mdneyazahmad is up for it.

@shawnborton
Copy link
Contributor

Yeah, I think we should not treat the styling of them as separate personally. Basically the exact space where the typing indicator shows up is also the exact space where the global offline indicator would show up as well, so we should make sure they are congruent.

@shawnborton shawnborton self-requested a review October 18, 2022 14:50
shawnborton
shawnborton previously approved these changes Oct 18, 2022
@shawnborton
Copy link
Contributor

So the screenshots look good to me, but I just tested the original bug again on the latest version of the app, and the bug is no longer happening. So before we merge these changes, do you know what might have happened?

Co-authored-by: Rajat Parashar <parasharrajat@users.noreply.github.com>
@parasharrajat
Copy link
Member

Strange, let me test.

@parasharrajat
Copy link
Member

parasharrajat commented Oct 18, 2022

@mdneyazahmad Can you please confirm if the original issue is not more reproducible on the main? I can't reproduce.

If that is the case, let's revert all the changes for alignment and only remove the margin bottom.

@mdneyazahmad
Copy link
Contributor Author

mdneyazahmad commented Oct 19, 2022

@parasharrajat I had pointed this earlier #10790 (comment). This issue is fixed here. Should we continue with the refactor, or remove the change made here?

@parasharrajat
Copy link
Member

If that is the case, let's revert all the changes for alignment and only remove the margin-bottom.

@mdneyazahmad
Copy link
Contributor Author

Updated! This PR now addresses a completely different issue than the linked PR.

@parasharrajat
Copy link
Member

That's not an issue. At least our effort didn't go wasted.

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

LGTM. Based on the latest discussion, we reverted the code and just fixed the margin.

cc: @Julesssss

@shawnborton
Copy link
Contributor

Just want to confirm that the screenshots have been updated in the original comment?

@mdneyazahmad mdneyazahmad closed this by deleting the head repository Oct 21, 2022
@mdneyazahmad mdneyazahmad reopened this Oct 21, 2022
@Julesssss
Copy link
Contributor

@parasharrajat I had pointed this earlier #10790 (comment). This issue is fixed here.

Ah, that wasn't clear to me in that message. But thanks for clarifying

The latest edits to the description seem to show the most recent changes only, but @mdneyazahmad could you please confirm before I merge? Thanks

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Approved and tested on all platforms:

Screenshot 2022-10-21 at 11 26 43

Screenshot 2022-10-21 at 11 38 03

Screenshot 2022-10-21 at 11 42 21

Screenshot 2022-10-21 at 11 55 43

@Julesssss
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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

@Julesssss
Copy link
Contributor

Stupid check. I'm ignoring this as I clearly filled the reviewer checklist.

@Julesssss Julesssss merged commit c2775d8 into Expensify:main Oct 21, 2022
@melvin-bot melvin-bot bot added the Emergency label Oct 21, 2022
@Expensify Expensify deleted a comment from melvin-bot bot Oct 21, 2022
@Julesssss
Copy link
Contributor

See this, it is not an emergency.

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @Julesssss in version: 1.2.19-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.19-2 🚀

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.

5 participants