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

[HOLD for payment 2023-05-16] [$2000] Android - Composer input overlaps with attachment separator #16848

Closed
1 of 6 tasks
kavimuru opened this issue Apr 1, 2023 · 90 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Apr 1, 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. Launch the app -> Login in account
  2. Navigate any chat conversation
  3. Notice composer input (from left side it overlaps)

Expected Result:

Composer input should not be overlaps with attachment separator

Actual Result:

Composer input overlaps with attachment separator

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.2.93-4
Reproducible in staging?: y
Reproducible in production?: y
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

Expensify/Expensify Issue URL:
Issue reported by: @dhairyasenjaliya
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680359256103449

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0160683cfa6e9f3593
  • Upwork Job ID: 1643312444077060096
  • Last Price Increase: 2023-04-11
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 1, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Overdue label Apr 4, 2023
@puneetlath
Copy link
Contributor

Wow @dhairyasenjaliya you've got some good eyes.

@melvin-bot melvin-bot bot removed the Overdue label Apr 4, 2023
@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Apr 4, 2023
@melvin-bot melvin-bot bot changed the title Android - Composer input overlaps with attachment separator [$1000] Android - Composer input overlaps with attachment separator Apr 4, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~0160683cfa6e9f3593

@MelvinBot
Copy link

Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

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

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

Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new.

@ahmedGaber93
Copy link
Contributor

Proposal

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

composer input overlaps with attachment separator in android

What is the root cause of that problem?

the root case is ButtonAttachment borderRightWidth: 1 shown blurry on some screen density.

react native use dp for dimensions and round it to px, so if value 1dp = 2.5 pixels, some devices show it blurely because physical screens have only a fixed number of pixels.

to know how many pixels in 1dp in any device use PixelRatio.get().
in my emulator 1dp = 2.5px so the last .5px show blurely.

and in the app the current style for footer is :

Untitled22

<ButtonAttachment style={{borderRightWidth: 1}} />
// view paddingVertical: 5, and no backgroundColor let border to show blurely
<View>
    // Composer has backgroundColor: themeColors.componentBG
    <Composer />
</View>

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

apply the same background color for <Composer /> and <View> wrap it, or clear it from both, or set it in the wraper.

my sugguest is to add backgroundColor: themeColors.componentBG for the wraper <View> here.

and also if we found the ButtonAttachment borderRightWidth: 1 is very thin, we may increase it.

    textInputComposeSpacing: {
        paddingVertical: 5,
        ...flex.flexRow,
        flex: 1,
        backgroundColor: themeColors.componentBG,
    },

What alternative solutions did you explore? (Optional)

@Mabroorkhan
Copy link

Proposal

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

composer input overlaps with attachment separator in android

What is the root cause of that problem?

The root case may be the fixed width provided in the styling.

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

the issue can be solved by not providing fixed width of composer and add a bit margin to it so it could have a safe space from separator and send button

@UzairHKhan
Copy link

Proposal

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

composer input overlaps with attachment separator in android

What is the root cause of that problem?

The root cause of this problem is styling.

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

This issue can be fixed by adding min-width and max-width in the massage dialog div.

@s77rt
Copy link
Contributor

s77rt commented Apr 4, 2023

@ahmedGaber93 Thanks for the proposal. I'm not sure this is blur related. If you zoom the following screenshot https://user-images.githubusercontent.com/43996225/229310637-cf6becf7-ebc5-433f-9c6d-d73181242e12.png you will see that the separator is shown correctly on top and bottom parts and only the middle part where the input is rendered it's cut (overlapped).

Screenshot from 2023-04-04 23-56-29

@s77rt
Copy link
Contributor

s77rt commented Apr 4, 2023

@Mabroorkhan Thanks for the proposal. Your RCA is not clear, you need to pinpoint the exact root cause and not guess potential causes.

@s77rt
Copy link
Contributor

s77rt commented Apr 4, 2023

@UzairHKhan Thanks for the proposal. Your RCA is not clear, can you elaborate? And why this happens on Android only?

@UzairHKhan
Copy link

@s77rt some time it only happens in a single platform or in similar screen size phones and works fine in all others the main cause of these types of issues is the width of the boxes if it is taking the width more than it requires it will overlap or can displace another box the possible way to fix this is by adding

 width: -webkit-fit-content;
 width: -moz-fit-content;
 width: fit-content;

This similar issue occurred in my previous work history and was happening only in iOS.

@s77rt
Copy link
Contributor

s77rt commented Apr 4, 2023

@UzairHKhan If that's the case then we need to figure out why the input is taking more space than it requires.

@Mabroorkhan
Copy link

@s77rt I find the issue is due to flex: 4 1 0% in textArea styling which can be fixed byflex: 1 and margin: 0px 2px

@s77rt
Copy link
Contributor

s77rt commented Apr 5, 2023

@Mabroorkhan Thanks for checking. Can you elaborate why this happen only on Android?

@UzairHKhan
Copy link

@s77rt Yes I need to dive into the code to get more context on this possibly textarea has some width.

@UzairHKhan
Copy link

@s77rt Another possible way to fix the border issue is to make the textarea background transparent it won't affect the UI as div also have same bg color and if the text overlaps the border it will still be visible

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Apr 5, 2023

@s77rt i think this overlaps not related with width of any View in the component, because i trying simple example in expo snack and the overlaps is exist.

simple example code.
import * as React from 'react';
import { View } from 'react-native';

export default function App() {
  return (
    <View style={{flex: 1, justifyContent: 'center', backgroundColor: "black"}}>
      <View style={{
        borderWidth : 1,
        borderColor : "green",
        borderRadius : 15,
        overflow : 'hidden',
        flexDirection: "row",
        alignItems: "center",
      }}>
        <View style={{
          height: 30, 
          width: 30, 
          backgroundColor: "black",  
          borderRightWidth: 1, 
          borderRightColor: "green"
        }} />
        <View style={{backgroundColor: "black", flex:1, height: 20, borderWidth: 0}} />
      </View>
    </View>
  );
}
result.

Untitled7

you can try snack here but test it in a real device because i think emulators don't have the a real number of pixels.
and also result may be diffrent depond on sceen density.

@s77rt
Copy link
Contributor

s77rt commented Apr 5, 2023

@UzairHKhan Thanks for the proposed fix but I think we are not looking for solutions at this point. It's important to understand the root cause first.

@narefyev91
Copy link
Contributor

narefyev91 commented Apr 24, 2023

@narefyev91 Do you have an update for your proposal? Mainly about the root cause, do you think the bug is on RN or Android itself

Also @narefyev91 thanks a lot your collaboration here. Such tiny bugs are sometimes the hardest.

Yup - hope i'm trying to help here a little bit 😁.
In my view - the issue is coming from RN - that doing a lot of custom logic for borders and border radius.
Also this is old issue - but seems still has correct explanation why we see that issue with blurry border
https://stackoverflow.com/a/24712372

@narefyev91
Copy link
Contributor

narefyev91 commented Apr 24, 2023

@narefyev91 Do you have an update for your proposal? Mainly about the root cause, do you think the bug is on RN or Android itself
Also @narefyev91 thanks a lot your collaboration here. Such tiny bugs are sometimes the hardest.

Yup - hope i'm trying to help here a little bit 😁. In my view - the issue is coming from RN - that doing a lot of custom logic for borders and border radius. Also this is old issue - but seems still has correct explanation why we see that issue with blurry border https://stackoverflow.com/a/24712372

@s77rt but also interesting that in flatter they have the same issue with 1px border flutter/flutter#13675 (comment)
Screenshot 2023-04-24 at 18 01 37

And also seems difference is that android building layout based on dp and not in pixels. I think RN trying to convert and stick to following android paradigm - but seems it's not perfect even in android itself
https://www.reddit.com/r/css/comments/3biyya/how_to_get_consistent_1px_border_on_mobile/

@s77rt
Copy link
Contributor

s77rt commented Apr 24, 2023

@narefyev91 What do you propose to move forward?

@narefyev91
Copy link
Contributor

@narefyev91 What do you propose to move forward?

I will suggest to move away from custom calculation for border - because based on your discovering we already have inconsistency between platforms. As solution should be generic - i will suggest to add Separator View - with width 1, in case that width in Android renders correctly - and do not have any issues with styling.

@narefyev91
Copy link
Contributor

@s77rt This is an image from bare Android App
Issue still there - that's how Android renders it's own border
Screenshot 2023-04-25 at 14 15 16
Screenshot 2023-04-25 at 14 16 13

@s77rt
Copy link
Contributor

s77rt commented Apr 25, 2023

@narefyev91 Having blurry pixels is not an issue. As long as adjacent elements don't get drawn on those blurry pixels I'm okay with that.

@narefyev91
Copy link
Contributor

@narefyev91 Having blurry pixels is not an issue. As long as adjacent elements don't get drawn on those blurry pixels I'm okay with that.

But blurry pixels are not counting as a wall to prevent View of start drawing inside that area

@s77rt
Copy link
Contributor

s77rt commented Apr 25, 2023

But on a bare Android App will they act as a wall?

@narefyev91
Copy link
Contributor

But on a bare Android App will they act as a wall?

nope - it's doing the same as we already see

@s77rt
Copy link
Contributor

s77rt commented Apr 25, 2023

@narefyev91 Thank you! I have just asked on Slack on how we should move forward https://expensify.slack.com/archives/C01GTK53T8Q/p1682425579144149

cc @puneetlath

@m4rtag
Copy link

m4rtag commented Apr 28, 2023

RETESTS SUMMARY

This fix is verified on Branch PR Draft narefyev91:add-new-separator-for-action-composer 

Tests are conducted on the following devices:
Google Chrome Version 112.0.5615.121 (Official Build) (arm64) at Mac OS Ventura 13.3.1
Safari Version 16.4 (18615.1.26.11.23) at Mac OS Ventura 13.3.1
Expensify Desktop app - New Expensify Electron Version v1.3.1-0, Electron Version 22.3.6 (22.3.6)
iOS native app - iPhone Simulator Version 14.2 (986.5), iOS 16.2, SimulatorKit 627, CoreSimulator 885.2
Safari on iOS - iPhone Simulator 14 iOS 16.2
Android native app v1.3.1-0 - Android Emulator -Nexus_5X_API_TiramisuPrivacySandbox:5554
Chrome 101.0.4951.74, Operating system Android13; Build/TRA4.221021.001.B1 

The above tests are executed with a 100% pass value

@MelvinBot

This comment was marked as off-topic.

@MelvinBot
Copy link

@puneetlath, @s77rt, @narefyev91 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@puneetlath
Copy link
Contributor

This is on staging.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 9, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Android - Composer input overlaps with attachment separator [HOLD for payment 2023-05-16] [$2000] Android - Composer input overlaps with attachment separator May 9, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.12-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-05-16. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@s77rt] The PR that introduced the bug has been identified. Link to the PR: n/a, see below
  • [@s77rt] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: n/a, see below
  • [@s77rt] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: n/a, see below
  • [@s77rt] Determine if we should create a regression test for this bug. n/a, see below
  • [@s77rt] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. n/a, see below
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: n/a, see below

@s77rt
Copy link
Contributor

s77rt commented May 9, 2023

  • The PR that introduced the bug has been identified: This is mostly a bug on Android. No PR to pinpoint here.
  • The offending PR has been commented on: n/a
  • A discussion in #expensify-bugs has been started: I don't think this is applicable here (cc @puneetlath).
  • Determine if we should create a regression test for this bug: No, this is a very low priority bug.

@puneetlath
Copy link
Contributor

Thanks @s77rt. Checklist completed and contract offers sent.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 15, 2023
@puneetlath
Copy link
Contributor

All paid. Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants