-
Notifications
You must be signed in to change notification settings - Fork 3k
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 2024-08-07] [$1000] Extra space around text in header of reply in thread if main message has 3 backtick code block #22832
Comments
Triggered auto assignment to @flaviadefaria ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Extra space around text in header of reply in thread if main message has 3 backtick code block. What is the root cause of that problem?The root cause of this issue is that we format header of report thread by replacing line break of Line 1125 in 754b6ed
So, there's will be an extra space added for What changes do you think we should make in order to solve the problem?To fix this issue, we can convert html To achieve it, we can change this line Line 1252 in ac74ab9
to const parser = new ExpensiMark();
const parentReportActionMessage = parser.htmlToMarkdown(lodashGet(parentReportAction, ['message', 0, 'html'], '')).trim().replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, ''); What alternative solutions did you explore? (Optional)If we don't want to show the Markdown in the title, then we can just get the first line of lodashGet(parentReportAction, ['message', 0, 'text'], '') by changing this line Line 1252 in ac74ab9
to const parentReportActionMessage = lodashGet(parentReportAction, ['message', 0, 'text'], '').trim().replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, ''); |
I'm discussing it in Slack here to confirm what would be the expected result. |
@flaviadefaria Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@flaviadefaria Still overdue 6 days?! Let's take care of this! |
After discussing in Slack we agreed that the intended outcome should be:
|
Job added to Upwork: https://www.upwork.com/jobs/~010cf4dbd8dbc4da67 |
Current assignee @flaviadefaria is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The problem we aim to solve in this issue is related to the formatting of the reply in thread header text. When a message with a 3 backtick code block is sent, it adds extra spaces around the text in the reply in thread header. What is the root cause of that problem?The root cause of the problem lies in the regular expression used to replace line breaks in the "parentReportActionMessage" variable. The current regular expression (/(\r\n|\n|\r)/gm, ' ') is replacing line breaks with spaces, which may lead to unintended formatting issues in the processed text. What changes do you think we should make in order to solve the problem?To address the problem, we propose the following changes to the code in the file "App/src/libs/ReportUtils.js": What alternative solutions did you explore? (Optional)While the proposed solution is straightforward and effective, we could also consider an alternative approach: In this alternative solution, we use a regular expression (/[\r\n]+/g) to directly replace consecutive line breaks with a single space. This approach achieves the same result as the proposed solution but retains the use of regular expressions. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Thread header is not displayed properly. We have the expected outcome here #22832 (comment).
What is the root cause of that problem?Our thread title logic here is not following the above expected outcome. Currently it's only replacing the line break. What changes do you think we should make in order to solve the problem?
For example, if the html is
What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.Markdown formatting is not being applied to the thread title even when the message contains markdown and only the first line of the message is not being displayed as the thread title. What is the root cause of that problem?The root cause of the problem is in the way the 'parentReportActionMessage' is obtained and processed. Line 1125 in 754b6ed
The code uses a regular expression to replace newline characters with spaces, but it does not handle markdown properly. What changes do you think we should make in order to solve the problem?As mentioned here the intended outcome should be Only the first line of the message should display on the thread title and the thread title should display as markdown if it is a md. To achive the intended outcome, we could change this to: const parentReportActionMessage = lodashGet(parentReportAction, ['message', 0, 'html'], ''); And then we can write a dedicated function like RenderHTML that can accept the const lines = this.props.fullTitle.split('<br />');
const firstLine = lines[0].trim(); And pass it to Result: scrnli_8_7_2023_4-18-08.AM.mp4What alternative solutions did you explore? (Optional)NA |
@sobitneupane @flaviadefaria 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! |
@flaviadefaria After going through the above proposals, I am pretty sure most of us are not clear about the expected output. So, bo be clear on the expected output: If we have highlighted text as the message, what will be the header.
If we have following code block as the message, what will be the header.
|
If the message contains the following code block:
The header of the reply in the thread will be:
Since the code block is surrounded by backticks, it will be treated as inline code and won't be affected by the regular expression If the message contains the following text:
The header of the reply in the thread will be:
The If the message contains the following code block:
The header of the reply in the thread will be:
The backtick code block is treated as inline code and won't be affected by the regular expression |
Hey @sobitneupane happy to clarify so I think we're aiming to fix 2 separate things here:
Exactly what's below though for number 2 I'd imagine we'd match the font size to the regular thread title size.
The header will be line1 only.
Let me know if this helps or if you still have any questions. |
Current assignee @robertjchen is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Waiting for @robertjchen's response on #22832 (comment) |
makes sense to me- let's try that |
@robertjchen - thanks, we need you to approve the proposal to carry on with the next steps. Thanks! |
Yep, already approved above! #22832 (comment) |
Whoops, I missed the automation ran many months ago. Ok, @tienifr keep us posted when the PR is ready for review. Thanks! |
@alexpensify PR was merged #45734. |
Thanks! We will wait for it to go through the automation process to production. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.14-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 2024-08-07. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
I'm working on the payment process and will complete it tomorrow. |
Payouts due: 2024-08-07
Upwork job is here. |
Closing - I've completed the process in Upwork. @sobitneupane, please submit a request in Chat. Thanks! |
$1000 approved for @sobitneupane based on this summary. |
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:
hello
testExpected Result:
Format of text should not affect reply in thread header text formatting
Actual Result:
3 backtick code blocks in text adds extra space around the text in reply in thread header
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.39-10
Reproducible in staging?: y
Reproducible in production?: y
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
2023-07-13.23-21-57.mp4
Recording.3603.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689183843669479
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @alexpensifyThe text was updated successfully, but these errors were encountered: