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-08-07] [$1000] Chat - Word that follows after the multiline hyperlink is located between multiline hyperlink #22362

Closed
2 of 6 tasks
lanitochka17 opened this issue Jul 6, 2023 · 34 comments
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

@lanitochka17
Copy link

lanitochka17 commented Jul 6, 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 staging.new.expensify.com
  2. Go to any conversation
  3. Type the following message
    [Multiline
    text}(link) hello
  4. Send the message

Expected Result:

The word 'hello' after the multiline hyperlink is located after the multiline hyperlink

Actual Result:

The word 'hello' after the multiline hyperlink is located in the middle of multiline hyperlink

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.37.3

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

Bug6118738_Screen_Recording_20230707_013204_Chrome.mp4

Bug6118738_Screenshot_20230707_013402

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/~01ad0d167a3f25ee3b
  • Upwork Job ID: 1678480571176464384
  • 2023-07-17
  • Automatic offers:
    • aimane-chnaif | Reviewer | 25731139
    • | | 0
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 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

@bernhardoj
Copy link
Contributor

bernhardoj commented Jul 7, 2023

Proposal

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

Currently, having a multiline link and text next to it will show the text at the first line of the link. This only happen in Web/Desktop.

What is the root cause of that problem?

The link rendered in the chat is a BaseAnchorForCommentsOnly component which wraps the anchor text with PressableWithSecondaryInteraction.

<PressableWithSecondaryInteraction
inline
style={[styles.cursorDefault, StyleUtils.getFontSizeStyle(props.style.fontSize)]}
onSecondaryInteraction={(event) => {
ReportActionContextMenu.showContextMenu(
isEmail ? ContextMenuActions.CONTEXT_MENU_TYPES.EMAIL : ContextMenuActions.CONTEXT_MENU_TYPES.LINK,
event,
props.href,
lodashGet(linkRef, 'current'),
);
}}
onPress={linkProps.onPress}
onPressIn={props.onPressIn}
onPressOut={props.onPressOut}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.LINK}
accessibilityLabel={props.href}
>
<Tooltip text={props.href}>
<Text
ref={(el) => (linkRef = el)}
style={StyleSheet.flatten([props.style, defaultTextStyle])}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.LINK}
hrefAttrs={{
rel: props.rel,
target: isEmail ? '_self' : props.target,
}}
href={linkProps.href}
// Add testID so it gets selected as an anchor tag by SelectionScraper
testID="a"
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{props.children}
</Text>
</Tooltip>
</PressableWithSecondaryInteraction>

If we remove PressableWithSecondaryInteraction, the problem will be gone. Why? Let's take a look at an example

[Multi
link](google.com) test

This text will render this HTML:
image

The link itself is wrapped with 2 div, while the text test is the span at the bottom. The 2 div comes from PressableWithSecondaryInteraction. PressableWithSecondaryInteraction uses PressableWithFeedback which is composed of OpactiyView (1st div) and GenericPressable (2nd div).

<OpacityView
shouldDim={Boolean(!isDisabled && (isPressed || isHovered))}
dimmingValue={isPressed ? props.pressDimmingValue : props.hoverDimmingValue}
style={props.wrapperStyle}
>
<GenericPressable

div will have a block display by default, but actually, we already apply an inline props to PressableWithSecondaryInteraction.

<PressableWithSecondaryInteraction
inline

inline props will set the display inline style to PressableWithFeedback.

style={(state) => [StyleUtils.parseStyleFromFunction(this.props.style, state), ...[this.props.inline && styles.dInline]]}

The problem is, the style is only applied to GenericPressable, which is the 2nd div. The 1st div (OpacityView) somehow has an inline-flex style (if we remove the inline props, both div will have inline-flex display).

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

To apply the inline style to the 1st div (OpacityView), we should also set the style to wrapperStyle.

<PressableWithFeedback
wrapperStyle={StyleUtils.combineStyles(DeviceCapabilities.canUseTouchScreen() ? [styles.userSelectNone, styles.noSelect] : [])}

image

@MitchExpensify
Copy link
Contributor

Reproduced and do not see a dupe of this

@melvin-bot melvin-bot bot removed the Overdue label Jul 10, 2023
@MitchExpensify MitchExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 10, 2023
@melvin-bot melvin-bot bot changed the title Chat - Word that follows after the multiline hyperlink is located between multiline hyperlink [$1000] Chat - Word that follows after the multiline hyperlink is located between multiline hyperlink Jul 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01ad0d167a3f25ee3b

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

melvin-bot bot commented Jul 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jul 12, 2023
@MitchExpensify
Copy link
Contributor

@aimane-chnaif how does @bernhardoj 's proposal look to you?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@aimane-chnaif
Copy link
Contributor

I believe this is a recent regression. At the time of multiline hyperlink implementation, this issue was not happening.
@bernhardoj are you able to find offending PR? This way, we can guarantee that your solution doesn't revert any previous fix.

@melvin-bot melvin-bot bot removed the Overdue label Jul 18, 2023
@aimane-chnaif
Copy link
Contributor

I can confirm that this came from pressable migration in #20251.
Proposal looks good.
@bernhardoj let's make sure that adding inline doesn't break any style in components which use PressableWithSecondaryInteraction.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

@techievivek @MitchExpensify @aimane-chnaif 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!

@melvin-bot melvin-bot bot added the Overdue label Jul 20, 2023
@melvin-bot melvin-bot bot added the Weekly KSv2 label Jul 25, 2023
@bernhardoj
Copy link
Contributor

PR is ready

cc: @aimane-chnaif

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

🎯 ⚡️ Woah @aimane-chnaif / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-07-25 04:39:51 Z
  • when the PR got merged: 2023-07-27 09:21:56 UTC

On to the next one 🚀

@MitchExpensify
Copy link
Contributor

Summary of payments eventually due:

$250 - Reporting bonus: N/A Applause
$1500 - C: @aimane-chnaif
$1500 - C+: @bernhardoj

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 31, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - Word that follows after the multiline hyperlink is located between multiline hyperlink [HOLD for payment 2023-08-07] [$1000] Chat - Word that follows after the multiline hyperlink is located between multiline hyperlink Jul 31, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.47-6 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-08-07. 🎊

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

For reference, here are some details about the assignees on this issue:

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 Jul 31, 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.
  • [@MitchExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@MitchExpensify
Copy link
Contributor

Reminder added to call to pay on 8/7 🚀

Let's get the BZ steps complete in advance of that @aimane-chnaif 👍

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 6, 2023
@techievivek
Copy link
Contributor

Not overdue, waiting for the payment. @aimane-chnaif can you please fill the BZ steps, thanks.

@melvin-bot melvin-bot bot removed the Overdue label Aug 7, 2023
@MitchExpensify
Copy link
Contributor

Paid @aimane-chnaif

Just waiting on @bernhardoj to accept the offer to close this one out post payment

@bernhardoj
Copy link
Contributor

@MitchExpensify Accepted

@MitchExpensify
Copy link
Contributor

Thanks, Paid! Just waiting on Upwork to stop being buggy so I can end the contract.

Reminder on the BZ steps here @aimane-chnaif

@melvin-bot melvin-bot bot added the Overdue label Aug 9, 2023
@MitchExpensify
Copy link
Contributor

Contracts ended! Friendly bump on the BZ steps #22362 (comment) @aimane-chnaif - Thanks! Lets get this closed out

@aimane-chnaif
Copy link
Contributor

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:

As this came from pressable migration refactor, I don't think regression test is needed

@melvin-bot melvin-bot bot removed the Overdue label Aug 13, 2023
@MitchExpensify
Copy link
Contributor

Awesome, thanks @aimane-chnaif

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

5 participants