-
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
(2/2) Add support for all reportAction types in ChatListItem - use PureReportActionItem in ChatListItem #54228
base: main
Are you sure you want to change the base?
(2/2) Add support for all reportAction types in ChatListItem - use PureReportActionItem in ChatListItem #54228
Conversation
…x/51296-chat-list-item
…x/51296-chat-list-item
@luacmartins @allgandalf this is draft PR for the second part. Will the logic to show icons the same between reportactionitem and chatlistitem? PureReportActionItem might render ReportActionItemSingle and use getReportActionActorAccountID, to determine the icons from personalDetails, but SearchReportAction doesn't have ownerAccountID, actorAccountID, etc to fullfill the logic. will |
@wildan-m Search already returns |
PR to add |
…x/51296-chat-list-item
@luacmartins @allgandalf There is a new ESLint rule that enforces the use of a default value of '0' or undefined instead of '-1'. I am concerned that this change could potentially cause regressions, especially because there are numerous occurrences in the PureReportActionItem, ReportActionItemSingle and their subcomponents. Should this be addressed in this pull request?
|
Let's open a separate PR for that and get it merged first, so if there are regressions it's isolated to that one PR and it's easy to revert |
@wildan-m can you please fix the workflows |
…x/51296-chat-list-item
…x/51296-chat-list-item
…x/51296-chat-list-item
…x/51296-chat-list-item
@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] |
…x/51296-chat-list-item
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.
Nice, things are looking good when the data is available, although it seems like we're still getting the data from Onyx somehow. I did a quick test tweaking the API to return all reportAction types and we can see that the actions are rendered, but since the linked data, e.g. transactions, parentReport, etc is not yet returned in search, it doesn't display anything until we click into it. This part is expected, but once we click into the action, we open the report and load the linked data and ChatListItem is updated and displays the action. I'm not sure this last part is expected since it means we're still reading data from live Onyx, instead of the snapshot key.
Screen.Recording.2024-12-30.at.1.20.53.PM.mov
…x/51296-chat-list-item
@@ -241,6 +241,12 @@ type PureReportActionItemProps = { | |||
|
|||
/** A message related to a report action that has been automatically forwarded */ | |||
reportAutomaticallyForwardedMessage?: 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 can't comment on the line, but ReportPreview
in line 736 is still directly connected to Onyx, which means it doesn't show correct report data, e.g.
Screen.Recording.2024-12-31.at.3.21.29.PM.mov
Ok, I have a PR to filter out other types of reportActions #54690 so that we can make the backend return data and control the release a bit better. I also have a BE draft PR to return additional data to Search. |
@wildan-m App PR filtering out other types of actions was merged. Let's update main to reflect that. Meanwhile, I'm still working on the backend PR to send additional data to the client. I expect the PR to be ready today and hopefully deployed next Monday |
@wildan-m BE PR was merged, it should be deployed on Monday so you can continue testing |
Oops just realized that we got a bit ahead of ourselves and the BE PR was merged and will likely be deployed before we filter other action types out in the frontend. I just tested locally and things seem OK since all actions have html/text to be displayed we still show something to the user with a correct link to the report/reportAction so I don't think we need to worry about that in the next deploy cycle. |
…x/51296-chat-list-item
@luacmartins In order to show all data, do we need to update the API parameter for the backend change? Is it currently in development, or has it already been deployed to the staging server? |
@wildan-m the additional data should be sent automatically. The PR was only merged, but not yet deployed. I believe it should be deployed and available some time today. |
@wildan-m when can this PR be ready for final review ? |
@allgandalf I need to ensure this bug resolved #54228 (review). I think we need to wait until the BE part deployed #54228 (comment) to make re-testing effort efficient |
@wildan-m backend PR is deployed. Please re-test! |
@luacmartins @allgandalf it seems that we will have to ensure that all pureReportAction subcomponents are pure. I will attempt to make these subcomponents pure without having to create a new file like we did for ReportActionItem. Please inform me if you have any better suggestions. |
@luacmartins @allgandalf when we move up most onxy data from subcomponents to ReportActionItem, a ReportActionItem might contain many onyx data that not actually needed, do you think it will significantly affect performance? |
Yea, I think that this is true, but it also concerns me because we have no way to enforce that future components added to it are pure and we'll run into regressions.
Hard to say without measuring it. I think it'll only really impact performance if we trigger more re-renders, which we might since the whole tree might get updated. Given the two issues above, I wonder if maybe we could update the |
Asked for more input here |
Explanation of Change
Second PR to add support for all reportAction types in ChatListItem, this part replace chatlistItem inner component with pureReportAction
Fixed Issues
$ #51296
PROPOSAL: #51296 (comment)
Tests
Pre-condition: Login to account with various chat types
Offline tests
Same as test
QA Steps
Same as test
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
Kapture.2024-12-28.at.11.16.37.mp4
Android: mWeb Chrome
Kapture.2024-12-28.at.11.20.10.mp4
iOS: Native
Kapture.2024-12-28.at.09.19.43.mp4
iOS: mWeb Safari
Kapture.2024-12-28.at.09.40.09.mp4
MacOS: Chrome / Safari
Kapture.2024-12-28.at.09.11.12.mp4
MacOS: Desktop
Kapture.2024-12-28.at.11.11.31.mp4