Repository navigation
combine logic for grouping messages in chats - #62210
Conversation
|
@allgandalf 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] |
|
Thanks for the PR, I will review it later today |
Reviewer Checklist
Screenshots/VideosiOS: HybridApp |
allgandalf
left a comment
There was a problem hiding this comment.
very minor nit picks, shouldn't block me from testing this one
| * Returns true when the report action immediately before the specified index is a comment made by the same actor who who is leaving a comment in the action at the specified index. | ||
| * Also checks to ensure that the comment is not too old to be shown as a grouped comment. | ||
| * | ||
| * @param reportActions - report actions ordered from newest |
There was a problem hiding this comment.
| * @param reportActions - report actions ordered from newest | |
| * @param reportActions - report actions ordered from latest |
There was a problem hiding this comment.
latest sounds more appropriate no? anyway not a blocker
| * @param actionIndex - index of the comment item in state to check | ||
| */ | ||
| function hasNextActionMadeBySameActor(reportActions: ReportAction[], actionIndex: number) { | ||
| const currentAction = reportActions.at(actionIndex); |
There was a problem hiding this comment.
| const currentAction = reportActions.at(actionIndex); | |
| const currentAction = reportActions?.at(actionIndex); |
again only if we are sure that reportActions is not null/undefined
There was a problem hiding this comment.
@allgandalf
How would this be null/undefined when the type declaration 2 lines up describes this as reportActions: ReportAction[]?
|
|
||
| // Comments are only grouped if they happen within 5 minutes of each other | ||
| if (new Date(currentAction.created).getTime() - new Date(nextAction.created).getTime() > 300000) { | ||
| if (new Date(currentAction?.created).getTime() - new Date(otherAction.created).getTime() > 5 * 60 * 1000) { |
There was a problem hiding this comment.
5 * 60 * 1000 if the purpose to do this was to make it visually aesthetic, then better to define this one in the CONST file,
allgandalf
left a comment
There was a problem hiding this comment.
let address the comments
…n-money-request-report-view
|
@allgandalf all done |
|
|
||
| // Todo combine with `isConsecutiveActionMadeByPreviousActor` so as to not duplicate logic (issue: https://github.com/Expensify/App/issues/58625) | ||
| /** | ||
| * Returns true when the report action immediately after the specified index is a comment made by the same actor who is leaving a comment in the action at the specified index. |
There was a problem hiding this comment.
I dont understand this full sentence:
a comment made by the same actor who is leaving a comment in the action at the specified index.
There was a problem hiding this comment.
Updated to be shorter and hopefully clearer
mountiny
left a comment
There was a problem hiding this comment.
Thanks for the tests, I am not sure about some docs, could you make then clearer if possible please?
mountiny
left a comment
There was a problem hiding this comment.
Great, thanks Jan and Gandalf!
|
✋ 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/mountiny in version: 9.1.51-0 🚀
|
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.1.51-6 🚀
|





Explanation of Change
Fixed Issues
$ #58625
PROPOSAL:
N/A
Tests
Offline tests
Same as test
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)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
native_android.mov
Android: mWeb Chrome
web_android.mov
iOS: Native
native_ios.mp4
iOS: mWeb Safari
web_ios.mp4
MacOS: Chrome / Safari
web_desktop.mov
MacOS: Desktop