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

Web - Line breaks & Text from code editor do not appear correctly within chat #10086

Closed
kavimuru opened this issue Jul 25, 2022 · 6 comments
Closed
Assignees
Labels
DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jul 25, 2022

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. Access staging.new.expensify.com
  2. Sign into any valid account
  3. Proceed to any chat
  4. Copy and Paste "Text with Line breaks" and send in chat
  5. Copy and paste "Text from a code editor" and send in chat

Expected Result:

The user expects the text in chat preview to be exactly as copied.

Actual Result:

The text does not comply with the correct format for either case

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.1.86-0
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): [email protected] / Emilio98 or (Any email)
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Bug5662750_PROD.mp4
Bug5662750_Code_editor_text_does_not_display_correctly.mp4
Bug5662750_Line_break_issue_in_chat_preview.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

View all open jobs on GitHub

@kavimuru kavimuru added the DeployBlockerCash This issue or pull request should block deployment label Jul 25, 2022
@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2022

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

@ahmdshrif
Copy link
Contributor

ahmdshrif commented Jul 26, 2022

@ctkochan22 to fix this we should replace this line

{StyleUtils.convertToLTR(Str.htmlDecode(props.fragment.text))}

with this

      {StyleUtils.convertToLTR(Str.htmlDecode(text))}

because we map br to a new line and save it on text variable in this lines
but props.fragment.text does not have `\n' by default .

const differByLineBreaksOnly = Str.replaceAll(props.fragment.html, '<br />', ' ') === props.fragment.text;
if (differByLineBreaksOnly) {
const textWithLineBreaks = Str.replaceAll(props.fragment.html, '<br />', '\n');
html = textWithLineBreaks;
text = textWithLineBreaks;
}

this change start in this pr https://github.com/Expensify/App/pull/9834/files

@luacmartins
Copy link
Contributor

@ctkochan22 any updates here?

@ctkochan22
Copy link
Contributor

The recommendation by @ahmdshrif looks good. Just making sure it doesn't conflict with the PR that introduced it

@ctkochan22
Copy link
Contributor

ctkochan22 commented Jul 26, 2022

So the original issue was that when editing a message for a language written left to right, the (edited) splices the text right in half.

Issue: #9709
PR Fix: #9834

I don't know why they would replace text with props.fragment.text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants