Add support for inline code with space only characters#49038
Add support for inline code with space only characters#49038deetergp merged 6 commits intoExpensify:mainfrom
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.
Can you share what are contexts that the second condition would be used?
There was a problem hiding this comment.
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.
Thanks for the explanation.
| "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.
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.
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.
I think we should. @deetergp what do you think?
There was a problem hiding this comment.
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>
|
|
||
| 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.
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.
|
|
||
| // 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.
The sequenceNumber is still needed to check the deprecation of the reportAction.
hoangzinh
left a comment
There was a problem hiding this comment.
Overal looks good, just one minor feedback
| getNumberOfMoneyRequests, | ||
| getOneTransactionThreadReportID, | ||
| getOriginalMessage, | ||
| // eslint-disable-next-line |
There was a problem hiding this comment.
can you double check if we need this disabled line?
There was a problem hiding this comment.
@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 themwith spaceOffline 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 themwith spacePR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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