App
App copied to clipboard
[$1000] Android - Copy icon is missing in Profile/Contact method
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:
- Open NewDot app
- 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:
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~0129c789975d0ac1e3
- Upwork Job ID: 1646595570154647552
- Last Price Increase: 2023-04-20
Triggered auto assignment to @lschurr (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
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
Confirmed, the copy option isn't there on Android, but it is on iOS.
Triggered auto assignment to @iwiznia (Engineering
), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Should this be internal or external @iwiznia?
Job added to Upwork: https://www.upwork.com/jobs/~0129c789975d0ac1e3
Current assignee @lschurr is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External
)
Triggered auto assignment to @NikkiWines (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
📣 @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:
- 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.
- 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.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01c26bfaba14c42f76
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@NikkiWines, @lschurr, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue. Awaiting proposals
F
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
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
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 View
s 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 View
s 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 View
s 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
Android result
Hopefully, this provides more insight on Android's tricky behavior.
@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.
@Victor-Nyagudi you can chime in discussion here if you really think this is bug in RN, not only our forked repo.
@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
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Still looking for solution
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>
"
@NikkiWines, @lschurr, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@aimane-chnaif can you review the recent proposal?
@aimane-chnaif can you review the recent proposal?
That's still not acceptable.
@lschurr no acceptable proposal yet. And please remove Reviewing
label which was added accidentally.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Still no acceptable proposals, right @aimane-chnaif?
right @lschurr
This has the same root cause with this https://github.com/Expensify/App/issues/17509