-
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
fixes the "Room chat LHN preview displays "removed 0 user" after editing room description " #44300
Conversation
src/libs/SidebarUtils.ts
Outdated
@@ -352,6 +352,9 @@ function getOptionData({ | |||
: ` ${Localize.translate(preferredLocale, 'workspace.invite.from')}`; | |||
result.alternateText += `${preposition} ${roomName}`; | |||
} | |||
if (lastActionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { | |||
result.alternateText = `${lastActorDisplayName} set the room description to : ${lastActionOriginalMessage?.description}`; |
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 have no idea in what case lastActorDisplayName
is displayed, its used it all above actions but in all cases i tested its empty string.
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 that's fine yeah
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.
wait then this would cause a regression right? it would display empty string in the place of lastActorDisplayName @ishpaul777 ?
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.
Also, won't we also need a spanish copy of the same here?
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 am not sure if should translate becuase its not a translated message in chat
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 am not sure if should translate becuase its not a translated message in chat
Umm good point, won't look good on the UI, cool then i will proceed with the review
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.
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.
If it makes the product better and you are ready to take the extra effort, i would be more than happy to review it :))
just pinging @yuwenmemon so that he also knows this
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 will complete the review as this PR is technically complete, if we need to alter the text that is not a big game, thanks @ishpaul777 🚀
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.
haha i did think that the following was misinterpreted:
I have no idea in what case
lastActorDisplayName
is displayed, its used it all above actions but in all cases i tested its empty string.
I think that's fine yeah
@ishpaul777 can you have a look here once, we will discuss this further
@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] |
Reviewer Checklist
Screenshots/Videos |
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.
LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@@ -623,6 +623,9 @@ function ReportActionItem({ | |||
children = <ReportActionItemBasicMessage message={translate('iou.unheldExpense')} />; | |||
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION) { | |||
children = <ReportActionItemBasicMessage message={translate('systemMessage.mergedWithCashTransaction')} />; | |||
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { |
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.
@ishpaul777 check out all the is$ACTION_TYPEAction
utility functions in ReportActionUtils. You can use type predicates to narrow the type of a report action, and thus avoid having to do any type casting.
fixes the "Room chat LHN preview displays "removed 0 user" after editing room description " (cherry picked from commit 9ee8806)
🚀 Cherry-picked to staging by https://github.com/yuwenmemon in version: 9.0.1-14 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.1-19 🚀
|
@@ -352,6 +352,11 @@ function getOptionData({ | |||
: ` ${Localize.translate(preferredLocale, 'workspace.invite.from')}`; | |||
result.alternateText += `${preposition} ${roomName}`; | |||
} | |||
if (lastActionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { |
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 missed the case if the room description is markdown/html/emojis, this overlook caused #44448.
Never thought that i would have to comment on the PR that i myself reviewed 😆 . I agree that this should had been noticed during testing but it was missed, i will be more careful moving forward
result.alternateText = `${lastActorDisplayName} ${Localize.translate(preferredLocale, 'roomChangeLog.updateRoomDescription')} ${ | ||
lastActionOriginalMessage?.description | ||
}`.trim(); | ||
} |
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 always display set the room description to:
here and it caused this bug .
More detail in this comment: #45522 (comment)
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.
Opps, I was perhaps not in my best mind while reviewing this PR 😓 , thanks for pointing that out @hungvu193 🙌
Edit:
ahh now that i look at the original issue, i recall that this was the last deploy blocker and needed to be reviewed quickly hence the hurry to deploy caused the quality of the PR to come done, honest mistake 😅
Details
Fixed Issues
$ #44194
PROPOSAL: #44194 (comment)
Tests
Expected Result:
Room chat LHN preview will display room description edit system message
Offline tests
QA Steps
PR 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
Not able to build android , sorry : (
Android: mWeb Chrome
WhatsApp.Video.2024-06-25.at.12.36.34.AM.mp4
iOS: Native
Screen.Recording.2024-06-25.at.12.25.45.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-06-25.at.12.24.13.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-25.at.12.19.42.AM.mov
MacOS: Desktop