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-06-23] [$2000] Android - Copy icon is missing in Profile/Contact method #17368

Closed
1 of 6 tasks
kbecciv opened this issue Apr 13, 2023 · 105 comments · Fixed by #20528
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 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@kbecciv
Copy link

kbecciv commented Apr 13, 2023

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?

  • 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

Bug6015417_video_44.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-05-05
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 13, 2023
@MelvinBot
Copy link

Triggered auto assignment to @lschurr (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

@lschurr
Copy link
Contributor

lschurr commented Apr 13, 2023

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

@MelvinBot
Copy link

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

@lschurr
Copy link
Contributor

lschurr commented Apr 13, 2023

Should this be internal or external @iwiznia?

@iwiznia iwiznia removed their assignment Apr 13, 2023
@iwiznia iwiznia added the External Added to denote the issue can be worked on by a contributor label Apr 13, 2023
@melvin-bot melvin-bot bot changed the title Android - Copy icon is missing in Profile/Contact method [$1000] Android - Copy icon is missing in Profile/Contact method Apr 13, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Current assignee @lschurr 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 - @aimane-chnaif (External)

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

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

@MelvinBot
Copy link

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

@Balabhadrad
Copy link

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

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@aimane-chnaif
Copy link
Contributor

Not overdue. Awaiting proposals

@melvin-bot melvin-bot bot removed the Overdue label Apr 17, 2023
@huzaifa-99

This comment was marked as off-topic.

@Victor-Nyagudi
Copy link
Contributor

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.

<Text
onPress={this.copyToClipboard}
style={[styles.flexRow, styles.cursorPointer]}
suppressHighlighting
>
<Text style={this.props.textStyles}>{this.props.text}</Text>
<Tooltip text={this.props.translate(`reportActionContextMenu.${this.state.showCheckmark ? 'copied' : 'copyToClipboard'}`)}>
<Icon
src={this.state.showCheckmark ? Expensicons.Checkmark : Expensicons.Copy}
fill={this.state.showCheckmark ? themeColors.iconSuccessFill : themeColors.icon}
width={variables.iconSizeSmall}
height={variables.iconSizeSmall}
inline
/>
</Tooltip>
</Text>

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.

// Skip the tooltip and return the children if the text is empty,
// we don't have a render function or the device does not support hovering
if ((_.isEmpty(this.props.text) && this.props.renderTooltipContent == null) || !this.hasHoverSupport) {
return this.props.children;
}

<View
testID={`${this.props.src.name} Icon`}
style={[StyleUtils.getWidthAndHeightStyle(width, height), styles.bgTransparent, styles.overflowVisible]}
>
<View style={iconStyles}>
<this.props.src
width={width}
height={height}
fill={this.props.fill}
/>
</View>
</View>

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
expensify-clicking-invisible-copy-icon.mov
Visible 'copy to clipboard' icon click interaction
expensify-clicking-visible-copy-icon-android.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.

@melvin-bot melvin-bot bot added the Overdue label Apr 19, 2023
@NikkiWines
Copy link
Contributor

Ok cool, thanks @s-alves10. In that case, let's move forward with your proposal.

@s-alves10
Copy link
Contributor

s-alves10 commented Jun 9, 2023

@aimane-chnaif @NikkiWines
PR is ready for review

@s-alves10
Copy link
Contributor

@NikkiWines
The upwork job link is no longer available.

@NikkiWines
Copy link
Contributor

@lschurr can we re-post the upwork job for this please 🙇

@lschurr
Copy link
Contributor

lschurr commented Jun 12, 2023

New open job posting is here: https://www.upwork.com/jobs/~01ac7e80f8af912eb4

@s-alves10
Copy link
Contributor

I submitted a proposal. Thank you

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 16, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Android - Copy icon is missing in Profile/Contact method [HOLD for payment 2023-06-23] [$2000] Android - Copy icon is missing in Profile/Contact method Jun 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.28-5 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-06-23. 🎊

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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 Jun 16, 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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] 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.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 22, 2023
@lschurr
Copy link
Contributor

lschurr commented Jun 22, 2023

@aimane-chnaif - please apply for the job here: https://www.upwork.com/jobs/~01ac7e80f8af912eb4

Do we need a regression test for this?

@lschurr
Copy link
Contributor

lschurr commented Jun 23, 2023

Payment sent to @s-alves10.

@s-alves10
Copy link
Contributor

Thank you

@aimane-chnaif
Copy link
Contributor

As we implemented workaround, no regression test needed for now.
We'll need full regression test after upgrading our RN version which includes this fix.

@lschurr
Copy link
Contributor

lschurr commented Jun 23, 2023

Be sure to apply for the job @aimane-chnaif - https://www.upwork.com/jobs/~01ac7e80f8af912eb4

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Jun 23, 2023

@lschurr applied thanks.

Here's timeline analysis: (GMT)

  • Contributor assigned on Jun 9, 14:12
  • final request of PR review on Jun 14, 02:54
  • PR merged without any changes on Jun 14, 17:24

PR merged within 3 business days

@lschurr
Copy link
Contributor

lschurr commented Jun 23, 2023

Paid with bonuses. Closing!

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 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

Successfully merging a pull request may close this issue.