-
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
Add support for inline code with space only characters #49038
Conversation
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
@hoangzinh, the rest of the changes, aside from the package update, are to display the correct last message in the LHN. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-09-13.at.17.33.47.android.movAndroid: mWeb ChromeScreen.Recording.2024-09-13.at.17.35.54.android.chrome.moviOS: NativeScreen.Recording.2024-09-13.at.17.29.39.ios.moviOS: mWeb SafariScreen.Recording.2024-09-13.at.17.32.00.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-09-13.at.17.18.31.web.movMacOS: DesktopScreen.Recording.2024-09-13.at.17.21.41.desktop.mov |
|
||
// Add support for inline code containing only space characters | ||
// The message will appear as a blank space in the LHN | ||
if ((trimmedMessage === '' && lastMessageText.length > 0) || (trimmedMessage === '?\u2026' && lastMessageText.length > CONST.REPORT.MIN_LENGTH_LAST_MESSAGE_WITH_ELLIPSIS)) { |
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.
Can you share what are contexts that the second condition would be used?
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 test: try sending an inline code with many spaces inside it, for example:
The lastMessageText
of the report from the back end is a lot of spaces, with an ellipsis at the end.
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.
Thanks for the explanation.
@@ -113,7 +113,7 @@ | |||
"date-fns-tz": "^2.0.0", | |||
"dom-serializer": "^0.2.2", | |||
"domhandler": "^4.3.0", | |||
"expensify-common": "2.0.84", | |||
"expensify-common": "2.0.88", |
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.
Just double-check, are you available to check if there are no breaking changes when we bump from 2.0.84 to 2.0.88?
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.
I believe there are no breaking changes. However, I have noticed another issue that also wants updating the expensify-common
package (to version 2.0.87): #46117. Should we wait for a PR to be raised for that issue? or should we proceed with this PR?
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.
I think we should. @deetergp what do you think?
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.
I've asked them in that PR if they want us to wait or not.
Can you also add this test to the test steps?
|
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
@hoangzinh, based on the reply in the other issue, we can continue bumping the expensify-common package in this PR. |
Cool, can you fix eslint? |
@hoangzinh, the check errors are from main |
Can you help to report in Slack then someone will pick and fix it, then we can merge in this PR to fix? |
@hoangzinh There is already a Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1726169039084589. I’m not sure if this PR is categorized as:
Should I try to fix it? I’m concerned that it might cause a regression. |
@tsa321 It looks like you'd just be updating getters, so I think the likelihood of introducing a regression is pretty low. Let's go ahead and update the deprecated methods. |
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
@@ -215,8 +215,11 @@ function isActionOfType<T extends ReportActionName[]>( | |||
|
|||
function getOriginalMessage<T extends ReportActionName>(reportAction: OnyxInputOrEntry<ReportAction<T>>): OriginalMessage<T> | undefined { | |||
if (!Array.isArray(reportAction?.message)) { | |||
// eslint-disable-next-line |
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.
The reportAction?.originalMessage
is still needed here.
Previously, I was using eslint-disable-next-line deprecation/deprecation
. This fixed the lint error for npm run lint-changed
, but it caused a lint error for npm run lint
because the deprecation/deprecation
rule is not available in npm run lint; it only exists in npm run lint-changed
.
Therefore, I am now using eslint-disable-next-line
following the discussion in this comment.
@@ -593,6 +596,7 @@ function isReportActionDeprecated(reportAction: OnyxEntry<ReportAction>, key: st | |||
|
|||
// HACK ALERT: We're temporarily filtering out any reportActions keyed by sequenceNumber | |||
// to prevent bugs during the migration from sequenceNumber -> reportActionID | |||
// eslint-disable-next-line |
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.
The sequenceNumber
is still needed to check the deprecation of the reportAction
.
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.
Overal looks good, just one minor feedback
@@ -1754,6 +1771,7 @@ export { | |||
getNumberOfMoneyRequests, | |||
getOneTransactionThreadReportID, | |||
getOriginalMessage, | |||
// eslint-disable-next-line |
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.
can you double check if we need this disabled line?
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.
@hoangzinh Yes, we need this. Removing this line will cause errors when I run npm run lint-changed
.
cc @deetergp for review |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/deetergp in version: 9.0.41-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
Details
Fixed Issues
$ #48101
PROPOSAL: #48101 (comment)
Tests
Test example:
` `
` `
it uses`;`separated fields because the line number column could have`:`in them ` ` with space
;
separated fields because the line number column could have:
in themOffline tests
QA Steps
Test example:
` `
` `
it uses`;`separated fields because the line number column could have`:`in them ` ` with space
;
separated fields because the line number column could have:
in themPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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
android-native-d.mp4
Android: mWeb Chrome
android-mweb_d.mp4
iOS: Native
ios-native_d.mp4
iOS: mWeb Safari
ios-msfari_d.mp4
MacOS: Chrome / Safari
macos-web-d.mp4
MacOS: Desktop
macos-desktop_d.mp4