-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix/35596: Last message text display incorrectly #37581
base: main
Are you sure you want to change the base?
Fix/35596: Last message text display incorrectly #37581
Conversation
@@ -502,6 +502,7 @@ function getLastVisibleMessage(reportID: string, actionsToMerge: OnyxCollection< | |||
} | |||
return { | |||
lastMessageText: messageText, | |||
lastMessageHtml: message?.html, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix the main issue, our solution is to display the LHN text based on the lastMessageHtml
. If we do not add lastMessageHtml: message?.html
like this, when we remove any message, the LHN text is still the removed message
return String(lastMessageText) | ||
.trim() | ||
.replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, ' '.repeat(CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH)) | ||
.substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure when we send a multiple lines message, for example:
Line 1
Line 2
the LHN display as Line 1 ...
(See issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dukenv0307 Please, always test and upload videos or screenshots for all platforms.
The ellipses at the end are not displayed on Android and iOS native (look for the Multitline
text in the LHN).
@dukenv0307 Lint faililng. |
Unit tests also failing. |
@akinwale I am fixing all the issues and will ping you once done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dukenv0307 On iOS native, the ellipses are not at the end of the line, but are right next to the text instead.
@akinwale Yeah, I see it. I am investigating that case and also, what do you think if we request the fix from BE side (the |
Based on my understanding, I think we generally want to avoid BE changes for things that can be fixed client-side, unless they're absolutely critical. @puneetlath Any thoughts on this? |
Sorry, I don't totally understand the issue. Mind explaining it to me in plain terms? |
@puneetlath
the data returned in API AddComment is:
What we need is something like, I planned to fix it only on FE side by using |
@puneetlath Can you help check comment once you have a chance? |
Ah yes, interesting. I agree with you in that case that a BE fix makes the most sense. |
@puneetlath Please ping me once BE is fixed. Thanks |
@puneetlath Please help check this comment if you have a chance in case you miss it. Thanks |
I agree that we should fix on the back-end. I can update the issue to reflect that. Will we need to do anything with this PR then? |
@puneetlath Yes. We need to fix the offline case after BE changes |
@puneetlath Do we have any update here? |
Not yet. Haven't had a chance to prioritize the back-end fix. |
@puneetlath Please ping me once you have any update. Thanks |
@puneetlath Do you have any update on this? |
@puneetlath Any updates? It has been delayed for a long time |
Details
Fixed Issues
$ #35596
PROPOSAL: #35596 (comment)
Tests
...
at the end...
at the end (similar to step 4)Offline tests
...
at the end...
at the end (similar to step 4)QA Steps
...
at the end...
at the end (similar to step 4)PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screencast.from.03-03-2024.23.26.03.webm
Android: mWeb Chrome
Screencast.from.01-03-2024.07.40.57.webm
iOS: Native
iOS: mWeb Safari
Screencast.from.01-03-2024.07.43.02.webm
MacOS: Chrome / Safari
Screencast.from.01-03-2024.07.34.27.webm
MacOS: Desktop