App icon indicating copy to clipboard operation
App copied to clipboard

[$1000] Android - Copy icon is missing in Profile/Contact method

Open kbecciv opened this issue 1 year ago • 26 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open NewDot app
  2. Go to profile \ contact method

Expected Result:

Copy icon should be displayed near [email protected] email

Actual Result:

Updated copy icon is missing in Profile/Contact method

Workaround:

Unknown

Platforms:

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

  • [x] Android / native
  • [ ] Android / Chrome
  • [ ] iOS / native
  • [ ] iOS / Safari
  • [ ] MacOS / Chrome / Safari
  • [ ] MacOS / Desktop

Version Number: 1.2.99.4

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

https://user-images.githubusercontent.com/93399543/231621215-5a52fd49-070f-47df-9f58-5c862fa3b290.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/~0129c789975d0ac1e3
  • Upwork Job ID: 1646595570154647552
  • Last Price Increase: 2023-04-20

kbecciv avatar Apr 13 '23 01:04 kbecciv

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

MelvinBot avatar Apr 13 '23 01:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 01:04 MelvinBot

Confirmed, the copy option isn't there on Android, but it is on iOS.

lschurr avatar Apr 13 '23 18:04 lschurr

Triggered auto assignment to @iwiznia (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Apr 13 '23 18:04 MelvinBot

Should this be internal or external @iwiznia?

lschurr avatar Apr 13 '23 18:04 lschurr

Job added to Upwork: https://www.upwork.com/jobs/~0129c789975d0ac1e3

MelvinBot avatar Apr 13 '23 19:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 19:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 19:04 MelvinBot

Triggered auto assignment to @NikkiWines (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Apr 13 '23 19:04 MelvinBot

📣 @Balabhadrad! 📣

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. 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.
  2. 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.
  3. 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>

MelvinBot avatar Apr 16 '23 06:04 MelvinBot

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01c26bfaba14c42f76

Balabhadrad avatar Apr 16 '23 07:04 Balabhadrad

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

MelvinBot avatar Apr 16 '23 07:04 MelvinBot

@NikkiWines, @lschurr, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

MelvinBot avatar Apr 17 '23 10:04 MelvinBot

Not overdue. Awaiting proposals

aimane-chnaif avatar Apr 17 '23 10:04 aimane-chnaif

F

huzaifa-99 avatar Apr 18 '23 11:04 huzaifa-99

Proposal

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

Android - Copy icon is missing in Profile/Contact method

What is the root cause of that problem?

I suspect this behavior is unique to Android and is caused by nesting a View inside a Text component, as is done so here in CopyTextToClipboard.js.

https://github.com/Expensify/App/blob/c144663fcad41a69344311a27dd6a147a28e7191/src/components/CopyTextToClipboard.js#L56-L71

The Tooltip component has a condition which renders its children whenever the device doesn't support hovering, therefore, the Icon component is rendered which wraps the svg inside a View.

https://github.com/Expensify/App/blob/c144663fcad41a69344311a27dd6a147a28e7191/src/components/Tooltip/index.js#L145-L149

https://github.com/Expensify/App/blob/c144663fcad41a69344311a27dd6a147a28e7191/src/components/Icon/index.js#L54-L65

Interestingly enough, the Copy icon isn't missing - it's rendered in the wrong place.

Screenshot of 'copy to clipboard' icon location

expensify-copy-to-clipboard-icon-location

However, in order to see it, you'll first need to save while in the CopyTextToClipboard.js file to trigger a re-render of the component. This leverages React Native's fast refresh feature to re-render just the default-exported component, otherwise, saving in a file higher in the component hierarchy might not re-render the component of interest.

The icon even responds to click events like it's supposed to whether visible (after it's re-rendered) or invisible (current behavior when app is loaded).

Invisible 'copy to clipboard' icon click interaction

https://user-images.githubusercontent.com/79470910/233067383-ec1147f0-2c39-40ce-97cb-5746ee394804.mov

Visible 'copy to clipboard' icon click interaction

https://user-images.githubusercontent.com/79470910/233067541-c9175fa6-b6a7-4d93-a656-385968ed651f.mov

To demonstrate further, I tried nesting a different View inside a Text component in ContactMethodsPage.js and got similar behavior to the current bug.

Here's the code I used.

//...
{loginMenuItems}
<View>
    <Text>
       Hello, there 
           <View>
               <Text>I'm nested in a View</Text>
           </View>
    </Text>
</View>
//...
My result after nesting a View inside a Text component

expensify-nested-view-android

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

This looks like a bug in React Native that may or may not be related to this currently open React Native Android bug discussing nested Views in Android.

I'd suggest not including the 'copy to clipboard' icon on Android devices for the time being, however, the docs forbid contributors from writing platform-specific code, so I think it would be best to leave implementing this at the discretion of Expensify's internal team.

Opening an issue with React Native also sounded like a good idea to me.

What alternative solutions did you explore?

I noticed one of the Views wrapping the svg was absolutely positioned, so I tried to play around with left and right style values to see what I could find.

One of the things I did was add a backgroundColor and adjust height & width of both Views wrapping the svg and noticed the outermost wrapper's color i.e. red, doesn't show on Android but shows on web (presumably on the other platforms where everything is working too).

Web result

expnsify-copy-icon-with-background

Android result

expensify-highlighted-copy-icon-wrapper

Hopefully, this provides more insight on Android's tricky behavior.

Victor-Nyagudi avatar Apr 19 '23 12:04 Victor-Nyagudi

@Victor-Nyagudi are you able to reproduce same in the snack? I am not facing this there, so doubt of bug is with forked RN repo.

Pujan92 avatar Apr 19 '23 13:04 Pujan92

@Victor-Nyagudi you can chime in discussion here if you really think this is bug in RN, not only our forked repo.

aimane-chnaif avatar Apr 19 '23 14:04 aimane-chnaif

@Victor-Nyagudi are you able to reproduce same in the snack? I am not facing this there, so doubt of bug is with forked RN repo.

Take a look at this Snack I made on Android and compare it to iOS and Web. @Pujan92

The text in the nested View is misaligned.

Do you think it could be some default View behavior I'm not aware of?

EDIT: Tagged @Pujan92

Victor-Nyagudi avatar Apr 19 '23 16:04 Victor-Nyagudi

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

MelvinBot avatar Apr 20 '23 16:04 MelvinBot

Still looking for solution

aimane-chnaif avatar Apr 20 '23 16:04 aimane-chnaif

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

Android - Copy icon is missing in Profile/Contact method

What is the root cause of that problem?

In React native CLI, android you can not render <View> component inside the <Text> components, this behavior is unique to Android and is caused by nesting a View inside a Text component, You can check inside CopyTextToClipboard.js file, The Tooltip component has the condition to render Icon inside the Text components, but Icon has wrapped inside View components. Check below file: https://github.com/Expensify/App/blob/c144663fcad41a69344311a27dd6a147a28e7191/src/components/Icon/index.js#L54-L65

not working code like below:

<Text>
    Hello, there 
    <View>
        <Text>I'm nested in a View</Text>
    </View>
</Text>

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

There is only one solution I tested and seems appropriate. You need to render <View> component outside from <Text> Components otherwise Copy Icon will not render in android.

"Add more ways for people to find you, and forward receipts to [email protected] + <copy icon>"

kaushiktd avatar Apr 21 '23 07:04 kaushiktd

@NikkiWines, @lschurr, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

MelvinBot avatar Apr 24 '23 10:04 MelvinBot

@aimane-chnaif can you review the recent proposal?

lschurr avatar Apr 24 '23 14:04 lschurr

@aimane-chnaif can you review the recent proposal?

That's still not acceptable.

aimane-chnaif avatar Apr 24 '23 14:04 aimane-chnaif

@lschurr no acceptable proposal yet. And please remove Reviewing label which was added accidentally.

aimane-chnaif avatar Apr 27 '23 16:04 aimane-chnaif

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

MelvinBot avatar Apr 28 '23 16:04 MelvinBot

Still no acceptable proposals, right @aimane-chnaif?

lschurr avatar May 01 '23 14:05 lschurr

right @lschurr

aimane-chnaif avatar May 01 '23 17:05 aimane-chnaif

This has the same root cause with this https://github.com/Expensify/App/issues/17509

bernhardoj avatar May 02 '23 12:05 bernhardoj