fix: unread chat is not bolded in the search router#69824
fix: unread chat is not bolded in the search router#69824nkdengineer wants to merge 2 commits intoExpensify:mainfrom
Conversation
Reviewer Checklist
Screenshots/Videos
Android: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
trjExpensify
left a comment
There was a problem hiding this comment.
I can see the argument that the router is just a list of recent chat results, and doesn't have unread/read logic or GBR/RBR. It sounds like from here we landed on having it for now - so this is fixing a regression. 👍
CC'ing @mountiny @sosek108 for vis though too as the regression came from this PR apparently.
mountiny
left a comment
There was a problem hiding this comment.
@srikarparsi can you please get a C+ to review this and also make sure @nkdengineer finds a solution that keeps the method pure (or at least does not make it less pure)
@sosek108 since this seems to be regression from your PR, do you have any suggestions on how to fix it?
| const chatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.chatReportID}`]; | ||
| const oneTransactionThreadReportID = getOneTransactionThreadReportID(report, chatReport, allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`]); | ||
| const oneTransactionThreadReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${oneTransactionThreadReportID}`]; | ||
| result.isUnread = isUnread(report, oneTransactionThreadReport); |
There was a problem hiding this comment.
This is making the method impure, or making it less pure...
|
Yes, just posted in contributor-plus |
|
@trjExpensify I would think that not having to add the unread logic here would simplify the logic a lot and the performance will be much better. Do you think we could change that decision taken from this perspective @sosek108 so weird it needs to know all three reports and also load the report actions |
|
@mountiny I've tested proposed solution (with accessing |
I'm open to it. I'd take performance over unread and GBR/RBRs in recent chats personally. CC: @Expensify/design |
|
Personally I'm on board with that as well. I'm of the mind that these are two different contexts and that showing the chat status in the Router isn't super duper critical. I think @shawnborton felt differently though, so I definitely want to get his thoughts before making any decisions. (Might be worth noting that in Slack's chat switcher, they do not display read vs. unread status AFAIK) |
|
My thinking was that the search router should feel identical to the LHN, since it displays chat rows the same way the LHN does more or less. I don't feel strongly though, I'm fine with defaulting to the default style where the chat name is always bold. |
Same. Though I see the consistency argument, I think the context is different and if we get performance gains from it, then I'd probably rather take that |
|
Seems like we are ok to remove the bold/ unread state from the Search router. @nkdengineer @sosek108 @allroundexperts can you make sure then the current code is as performant as possible given this? |
I think if this is the case, we can actually close this PR since this issue wouldn't be valid anymore |
|
Going to close it out since it seems like we've reached that consensus but please feel free to re-open if this is needed |


Explanation of Change
Fixed Issues
$ #69722
PROPOSAL: #69722 (comment)
Tests
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)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
a.mov
Android: mWeb Chrome
am.mov
iOS: Native
i.mov
iOS: mWeb Safari
im.mov
MacOS: Chrome / Safari
w.mov
MacOS: Desktop
dk.mov