-
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
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:
|
@luacmartins What do you think the expected of this case? It seems @zfurtak is trying to simplified the report name for thread
Screen.Recording.2025-02-04.at.18.10.34.mov |
@luacmartins What do you think the expected of this case? This logic isn't updated in this PR, I just want to confirm it again
Screen.Recording.2025-02-04.at.21.36.41.mov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-02-04.at.21.46.46.movAndroid: mWeb ChromeScreen.Recording.2025-02-04.at.21.46.09.moviOS: NativeScreen.Recording.2025-02-04.at.21.46.26.moviOS: mWeb SafariScreen.Recording.2025-02-04.at.21.45.18.movMacOS: Chrome / SafariScreen.Recording.2025-02-04.at.21.42.22.mov |
@DylanDylann I think we can treat those as NAB. We can address them in a follow up if we decide to. |
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.
The rest looks fine
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
@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 🚀
|
Details
Fixed Issues
$ #48897
PROPOSAL:
Tests
Reports
tabChats
In ....
Offline tests
As above
QA Steps
As above
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