-
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
Add room name to the top of searched chats #50135
base: main
Are you sure you want to change the base?
Add room name to the top of searched chats #50135
Conversation
In
to chat search 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.
Left you some comments with small code tweaks
src/libs/ReportUtils.ts
Outdated
draftReports?: OnyxCollection<Report>, | ||
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>, | ||
policyTagLists?: OnyxCollection<PolicyTagLists>, | ||
policies?: OnyxCollection<Policy>, |
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
By this you mean the keys that were meant to be used to calculate the report name? 🤔
Are we waiting with this for the other PR to be merged? 😊 |
Yes, we'll need to send those keys to the client in order to compute the report name.
Yea, I think we need to map out the necessary keys to compute the report name. Then I'd implement the necessary changes in the API to send this data to the client and finally, we can use it to compute the name. |
5f346f6
to
86bfff4
Compare
@zfurtak I started working on the backend PR to return the necessary data to display the room names. Here's a preliminary result: Screen.Recording.2024-12-19.at.2.26.14.PM.movI think we need to add some more keys to make it work for some cases like Workspace chats, etc. But I think we could start with this as v1 |
I needed to make some small changes to the solution you have in this PR, you can see a rough draft here. Please incorporate those changes to your PR. The main idea is:
|
@zfurtak backend PR is merged. Let's resume work on this one taking my comment above into account. |
@zfurtak let me know when you are ready to resume work on this issue |
@zfurtak how's work going on this one? |
I used the code from your draft PR and right now I'm adjusting it and fixing lint mistakes connected to the new eslint rule. |
Nice! Thanks for the update! |
Ok, so update from me: the code is ready 🎉 As I have been tested, it all works! About the failing check |
This is awesome @zfurtak! I did some testing and things look really good. Do you think we can already open the PR for reviews from C+ too? It'd be a big win to wrap this one up soon.
I'm ok handling them in a follow up since they are all unrelated and I agree that we'd get a lot of conflicts and potential issues by tackling them here. |
Details
Fixed Issues
$ #48897
PROPOSAL:
Tests
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop