-
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
Fix object mutation causes the WS item in search shows last message instead of WS name #54351
base: main
Are you sure you want to change the base?
Fix object mutation causes the WS item in search shows last message instead of WS name #54351
Conversation
@bernhardoj Can you please resolve the conflicts here? Also, please merge with the latest main as I am running into build issues due to another offending PR that was reverted. Will take this up for review today. Thanks. |
@rojiphil 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.
Thanks @bernhardoj for the PR. I also left some NAB comments. Please have a look.
Apart from that, I am not sure if the expected behaviour is to display the Workspace name
all the time. When there is an available message in the report, displaying the last message
text may be correct. And the workspace name
can be displayed if there are no messages yet in the chat. Here is a test video comparing the staging
and dev
version. Let us confirm this though with the design team.
@Expensify/design What do you think?
54351-validate.mp4
@@ -6386,7 +6386,7 @@ function isReportNotFound(report: OnyxEntry<Report>): boolean { | |||
/** | |||
* Check if the report is the parent report of the currently viewed report or at least one child report has report action | |||
*/ | |||
function shouldHideReport(report: OnyxEntry<Report>, currentReportId: string): boolean { | |||
function shouldHideReport(report: OnyxEntry<Report>, currentReportId: string | undefined): boolean { |
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 we do an early return here when currentReportId
is undefined?
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 don't think we should do it because the logic depends on isChildReportHasComment
. I would prefer to just let it go through the code since the parentReport will be undefined when currentReportID is undefined.
@@ -1631,7 +1631,7 @@ function isPolicyExpenseChatAdmin(report: OnyxEntry<Report>, policies: OnyxColle | |||
/** | |||
* Checks if the current user is the admin of the policy. | |||
*/ | |||
function isPolicyAdmin(policyID: string, policies: OnyxCollection<Policy>): boolean { | |||
function isPolicyAdmin(policyID: string | undefined, policies: OnyxCollection<Policy>): boolean { |
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, same here. Can we do an early return here when policyID
is undefined?
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 don't think it's necessary to add more code (3 lines) to this. If policyID is undefined, the policy object should be undefined too and the result will be false.
Interesting, I think this is my general understanding as well that if there is a message preview to be displayed on a chat row when searching for chats, we would display the preview message cc @Expensify/design @trjExpensify @JmillsExpensify for gut check too |
Explanation of Change
Fixed Issues
$ #53361
PROPOSAL: #53361 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisite:
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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: mWeb Chrome
android.mweb.mp4
iOS: Native
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
MacOS: Desktop
desktop.mp4