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

[$500] Chat --Tapping expand button and then plus icon, the compose box becomes extra big #28201

Closed
2 of 6 tasks
lanitochka17 opened this issue Sep 26, 2023 · 29 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 26, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Tap on a report
  3. Enter a number
  4. Tap enter few times and enter other number
  5. Tap plus icon near compose and close it by tapping on outside
  6. Note the size of compose box
  7. Tap expand button
  8. Tap plus icon near compose and note background compose box become extra big
  9. Tap outside and close plus icon options and note size of compose box

Expected Result:

When user taps expand button and taps plus icon near compose, the compose box must not become extra big

Actual Result:

When user taps expand button and taps plus icon near compose, the compose box becomes extra big

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.74-0

Reproducible in staging?: Yes

Reproducible in production?: Yes

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Bug6214224_box_big.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0170623ae497958496
  • Upwork Job ID: 1706527705972113408
  • Last Price Increase: 2023-10-10
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Sep 26, 2023
@melvin-bot melvin-bot bot changed the title Chat --Tapping expand button and then plus icon, the compose box becomes extra big [$500] Chat --Tapping expand button and then plus icon, the compose box becomes extra big Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0170623ae497958496

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)

@omergr8
Copy link

omergr8 commented Sep 26, 2023

Subject: Tapping expand button and then plus icon, the compose box becomes extra big.

Issue Overview

Currently, when a user clicks on the "stretch" button, it applies the CSS property flex: 1 1 0%; to the textarea div (the second sibling). However, its sibling div, the chat div, already has the same flex: 1 1 0% property applied. This results in both sibling divs taking equal amounts of space, which leads to the issue where the chat textarea becomes larger when the keyboard disappears.

Proposed Solution

The proposed solution is to dynamically adjust the flex properties of the sibling divs when the textarea is expanded. Specifically, we can set the chat area to occupy 70% of the available space, while the text area takes up the remaining 30%. By doing so, we can ensure that the textarea's size remains consistent and does not unexpectedly change when the keyboard appears or disappears.

Implementation Details

To implement this solution, we can employ JavaScript to toggle the flex properties of the sibling divs upon clicking the "stretch" button. Here's a high-level overview of the steps:

  1. When the "stretch" button is clicked:
    • Remove the inherited flex: 1 1 0%; property from both sibling divs.
    • Apply flex: 7 to the chat area div (occupying 70% of available space).
    • Apply flex: 3 to the text area div (occupying 30% of available space).

This adjustment ensures that the chat area remains larger, while the text area remains smaller, creating a more consistent user experience.

Expected Benefits

  • Prevents the textarea from unexpectedly changing size when interacting with the keyboard.
  • Enhances the user experience by maintaining a stable layout.
  • Offers greater control over the distribution of space between the sibling divs within the flex container.

Additional Considerations

  • Compatibility with various screen sizes and devices should be thoroughly tested to ensure responsiveness.
  • Accessibility and user testing should be conducted to validate the proposed solution.

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

📣 @omergr8! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@omergr8
Copy link

omergr8 commented Sep 26, 2023

Contributor details
Your Expensify account email: umar.mukhtar4455@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01c0eeade85c091525

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@suneox
Copy link
Contributor

suneox commented Sep 28, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Chat --Tapping expand button and then plus icon, the compose box becomes extra big

What is the root cause of that problem?

When the input is set to full size the height of the footer input group will get 50% remaining height (exclude header) at

<View style={[chatFooterStyles, props.isComposerFullSize && styles.chatFooterFullCompose]}>

by styles.chatFooterFullCompose flex: 1
Screenshot 2023-09-28 at 10 33 35

on mobile when the keyboard opens the height of the input group will reduce due to the total height being reduced
Screenshot 2023-09-28 at 10 34 23

What changes do you think we should make in order to solve the problem?

Condition to check isMobile

  const isMobile = Browser.isMobile() || Platform.OS === 'ios' || Platform.OS === 'android';

On mobile the height of the screen is limited with the keyboard so we shouldn't support to expand full composer, we will hide the expand and collapse buttons at


update to

  {!isMobile && isComposerFullSize && (
    ....
  )}

and

{!isComposerFullSize && isFullComposerAvailable && (

update to

  {!isMobile && !isComposerFullSize && isFullComposerAvailable && (
    ....
  )}

Make an attachment button to center

<View style={[styles.dFlex, styles.flexColumn, isFullComposerAvailable || isComposerFullSize ? styles.justifyContentBetween : styles.justifyContentCenter]}>

update to

  <View style={[styles.dFlex, styles.flexColumn, !isMobile && isFullComposerAvailable || !isMobile && isComposerFullSize ? styles.justifyContentBetween : styles.justifyContentCenter]}>

Result on mobile
Simulator Screenshot - iPhone 12 Pro - 2023-09-30 at 10 15 02

What alternative solutions did you explore? (Optional)

We can config a height or maxHeight for the input group on mobile instead of setting flex:1

<View style={[chatFooterStyles, props.isComposerFullSize && styles.chatFooterFullCompose]}>

  <View style={[chatFooterStyles, props.isComposerFullSize ? (isMobile ? styles.chatFooterFullComposeMobile : styles.chatFooterFullCompose) : undefined]}>

add style chatFooterFullComposeMobile bellow chatFooterFullCompose

    chatFooterFullComposeMobile: {
        height: 180, // 180-(7 lines) 200-(8 lines) or calculate any value based on team decision
    },

Result on mobile
Simulator Screenshot - iPhone 12 Pro - 2023-09-30 at 10 18 17

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@greg-schroeder
Copy link
Contributor

awaiting proposal review

@melvin-bot melvin-bot bot removed the Overdue label Sep 28, 2023
@hoangzinh
Copy link
Contributor

@hoangzinh
Copy link
Contributor

hoangzinh commented Sep 28, 2023

@greg-schroeder I traced back changelogs, we used to expand composer to full-screen last year #9031 #11608. But nowadays, It only occupies 50% of the screen height when the keyboard is hidden.
Screenshot 2023-09-29 at 01 21 27

I couldn't find when we changed from 100% to 50% screen in expand mode.

So just wanna confirm the expected behavior here, in expand mode, will the composer occupy 100% or 50% or any percentage of screen height (or fixed height)? Thanks

@omergr8
Copy link

omergr8 commented Sep 28, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Tapping expand button and then plus icon, the compose box becomes extra big.

What is the root cause of that problem?

The root cause of this problem is the conflicting flex properties applied to both sibling divs. This conflict causes them to share space equally, leading to the unintended resizing of the chat textarea.

What changes do you think we should make in order to solve the problem?

To address this issue, I propose dynamically adjusting the flex properties of the sibling divs when the textarea is expanded. Specifically, I suggest setting the chat area to occupy 70% of the available space, while the text area takes up the remaining 30%. This adjustment will ensure that the textarea's size remains consistent and does not unexpectedly change when the keyboard appears or disappears.

What alternative solutions did you explore?

In addition to the proposed solution that involves adjusting the flex properties of the sibling divs, we explored an alternative approach. Instead of relying on flex, an alternative solution would involve setting a fixed height or a maximum height (max-height) for the input group. This alternative approach simplifies the layout management by avoiding complex flex adjustments and may offer an effective way to address the issue.

@suneox
Copy link
Contributor

suneox commented Sep 30, 2023

I have updated the screenshot result for my proposal @hoangzinh @greg-schroeder Could you please review my proposal?

@hoangzinh
Copy link
Contributor

Thanks @suneox . I would like to wait for @greg-schroeder for the expectation here #28201 (comment)

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@greg-schroeder
Copy link
Contributor

Looking

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@greg-schroeder
Copy link
Contributor

@hoangzinh hmm. I see conflicting information about this as well. 🤔

@greg-schroeder
Copy link
Contributor

pinging here to see if anyone can be a better sleuth: https://expensify.slack.com/archives/C01GTK53T8Q/p1696260318348419

@greg-schroeder
Copy link
Contributor

from @puneetlath:

it’s supposed to expand to the size where there is still space for the auto-complete menu, aka the menu that shows if you type @ or :

@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@hoangzinh
Copy link
Contributor

@greg-schroeder actually, I think we're still fine with the current size of the composer when it's expanded. The compose box in the recording is not extra big, it's the current size of the composer when the keyboard is hidden. What do you think?

Screenshot 2023-10-04 at 00 00 44

@omergr8
Copy link

omergr8 commented Oct 3, 2023

@hoangzinh
I believe it appears unattractive. Having a textarea with that height isn't aesthetically pleasing.

@hoangzinh
Copy link
Contributor

@hoangzinh I believe it appears unattractive. Having a textarea with that height isn't aesthetically pleasing.

Because the composer is in the expand mode. Having extra space is expected behavior.

Current Expand mode with keyboard Current Expand mode without keyboard
Screenshot 2023-10-04 at 06 51 55 Screenshot 2023-10-04 at 06 51 38

I just wanna confirm it's worth to fix this issue

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

@hoangzinh, @greg-schroeder Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

@hoangzinh @greg-schroeder this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@hoangzinh
Copy link
Contributor

waiting on your input @greg-schroeder #28201 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@greg-schroeder
Copy link
Contributor

Sorry @hoangzinh been traveling/OOO

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
@greg-schroeder
Copy link
Contributor

Hmm. The fact that it's the same size as when the keyboard is hidden is compelling enough to me to say this isn't worth spending our focus on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants