Add room name to the top of searched chats - #50135
luacmartins merged 50 commits into
Conversation
In to chat search
Kicu
left a comment
There was a problem hiding this comment.
Left you some comments with small code tweaks
| draftReports?: OnyxCollection<Report>, | ||
| reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>, | ||
| policyTagLists?: OnyxCollection<PolicyTagLists>, | ||
| policies?: OnyxCollection<Policy>, |
There was a problem hiding this comment.
@luacmartins What do you think about this? that kinda messy :/ Frankly I'm surprised that we need some many arguments to generate the name.
I'm Afraid we are making the code very complex, perhaps it's a good moment to take a step back and redesign this a bit?
If we have to compute the reportName in the frontend codebase, then maybe temporary could somehow split this function for reports and for Search?
Clearly this was written specifically for the ReportUtils with the assumption that a lot of local values will be used. We are now breaking this assumption, I wonder if we can develop the "getReportForSearch" part somehow smarter 🤔
There was a problem hiding this comment.
Frankly I'm surprised that we need some many arguments to generate the name.
Me too 😄
If we have to compute the reportName in the frontend codebase, then maybe temporary could somehow split this function for reports and for Search?
I raised this in Slack with the team and didn't get much support since that'd create another fork in the logic. How exactly would you propose the split? Maybe I can bring this up again because I also agree with a separate approach since the refactor might get out of hand.
There was a problem hiding this comment.
One thing that I was thinking, is that even after this refactor, there's nothing stopping others from directly connecting these methods to Onyx in the future and the whole logic breaking for Search. We should probably think of a way to enforce that once the refactor is done.
|
@zfurtak great job on this PR so far. I audited the child function calls that connect directly to Onyx and it seems like we'd also need to refactor the following so that we can pass the data in instead of retrieving it directly from the "live" Onyx data:
I'm still mapping all the different objects and keys that we'll need to send back from the API. |
|
The only functions that left to refactor is |
|
Never mind! The function |
|
Nice! That's awesome. The team is still discussing if we can simplify the report names for the Search page only (especially for threads since those add a lot of extra data). I'll report back once we land on a solution. |
|
@luacmartins how is the discussion going? 😊 |
|
There hasn't been any movement, but last I checked the decision was to:
Additionally, we started returning additional data for Search > Expenses. I'm hoping to do the same and include report and policy data in the Search results for chats. This + the simplification above might solve a lot of the naming issues 🤞 |
|
So I think next steps here:
|
|
@DylanDylann I think we can treat those as NAB. We can address them in a follow up if we decide to. |
|
@zfurtak it seems like the last 2 commits were not signed/verified. Could you please look into that? Otherwise, we're good to merge |
a7fc6fb to
a2c62e9
Compare
|
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
We decided to not address ESLint errors in this PR since it was a pretty large PR and addressing the failures was not trivial |
|
✋ 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/luacmartins in version: 9.0.95-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.95-6 🚀
|
| fontSize={variables.fontSizeSmall} | ||
| onPress={() => onSelectRow(item)} | ||
| > | ||
| {reportActionItem.reportName} |
There was a problem hiding this comment.
You forgot to handle the invoice room name case when displaying room name, which caused #58581
| return allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; | ||
| function getReport(reportID: string, reports: SearchReport[] | OnyxCollection<Report>): OnyxEntry<Report> | SearchReport { | ||
| if (isSearchReportArray(reports)) { | ||
| reports?.find((report) => report.reportID === reportID); |
There was a problem hiding this comment.
@zfurtak @DylanDylann this seems to be missing a return?
Details
Fixed Issues
$ #48897
PROPOSAL:
Tests
ReportstabChatsIn ....Offline tests
As above
QA Steps
As above
PR 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop