Repository navigation
Fix workspace chat opening with wrong UI when accessed from Reports - #73884
abzokhattab wants to merge 5 commits into
Conversation
|
@Krishna2323 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| if (!reportID) { | ||
| return `${environmentURL}/r/`; | ||
| } | ||
| const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; |
There was a problem hiding this comment.
@abzokhattab we should avoid using allReports as mentioned here. You should try passing the report object to the function.
There was a problem hiding this comment.
@abzokhattab I don’t think we should use allReports, as it will add more work for the team. We should consider making the change here itself. I also don’t think it would be very complex, because from what I can see, everywhere we use getReportURLForCurrentContext already has access to the report object. So we can simply pass it directly.
The only exception is in buildOptimisticMovedReportAction, where we need to get the report and then pass it to getReportURLForCurrentContext. And in places where buildOptimisticMovedReportAction is used, we already have the report as well — we just need to pass it two levels down.
Monosnap.screencast.2025-11-01.22-21-14.mp4
There was a problem hiding this comment.
the problem is in the getMovedActionMessage... using the report in the two urls is wrong, they are two different reports ... this function is used by other functions that are used extensively,s uch as get report name, so what is the way to handle that
There was a problem hiding this comment.
Sorry, I missed this. Using allReports could significantly increase the team’s workload.
@neil-marcellini, could you please share your thoughts?
@abzokhattab, have you looked for any other solutions? Or do you think this is doable but requires significant effort?
There was a problem hiding this comment.
no i have tried but it doesnt work .. the changes are complex. especially for the getMovedActionMessage and all the functions above it .. were u able to make it work using this way?
There was a problem hiding this comment.
@abzokhattab I think we can do this instead:
-
Update the
getReportURLForCurrentContextfunction to accept anoptionsparameter instead of areport:type GetReportURLForCurrentContextOptions = { report?: OnyxEntry<Report> | Report; /** * Explicitly indicate that the target is a workspace chat (policy expense chat). * Useful when the caller knows the destination report type but does not have the report object available. */ isPolicyExpenseChat?: boolean; };
-
Since
newParentReportUrlwill always be a policy expense chat, we can pass{isPolicyExpenseChat: true}from there. -
Pass the
reportobject whenever it is available.
There was a problem hiding this comment.
I've implemented it, but it adds more complexity, and tbh I don't prefer to always hardcode the isPolicyExpenseChat: true , but I agree we don't have other options here
Please review and let me know if you have any comments
b240dbc to
c22a13e
Compare
f85fa29 to
c22a13e
Compare
|
This PR is interesting, in that I think we need to decide if we should be taking you between the Inbox and Reports page based on the link that you click. @Expensify/product-pr I'm curious for other's thoughts on this PR, though the basic case is this:
My feeling is that if you're on the Reports page, then you should stay on the Reports page. If you are alternatively on the Inbox then you stay on the Inbox. This PR makes it such that the user will always be taken to the Inbox though. |
|
I agree with your @JmillsExpensify . I think you should stay in whatever area of the product you already are in |
@JmillsExpensify Workspace expense chats are not designed to work in the Reports/Search context, which causes UI abnormalities.
|
|
Yes, thanks. I understand that, though why does this link take you to a workspace chat? I wouldn't expect it to, and I don't think our users would expect the same either. |
|
I'm not sure if should. In fact, I guess I'm questioning why we hyperlink the workspace name? Like what is the value to the user. They just want to submit the report on the right workspace. That doesn't mean they need to go into the workspace chat. |
|
@neil-marcellini could you please check the discussion above? |
|
In my opinion if we want to keep the workspace hyperlinked, the hyperlink should redirect to the workspace settings not the expense In general its a good practice to keep the hyperlink for the ease of navigation for users |
That makes sense for admins, though I think it's a confusing paradigm for employees and individuals. |
I agree, but I thought that was done here after a PR @puneetlath created? #70509 |
|
Actually, it looks like this hyperlink on the Reports page is going away altogether with the update to add columns for Reports. So I think actually these changes are no longer relevant. So I'm going to go ahead and close this PR and we can pay out @Krishna2323 and @abzokhattab for their time. Thanks everyone and sorry for the confusion! |
|
Sounds good to me. I'll comment on the issue so that BZ is in the loop. |



Explanation of Change
Fixed Issues
$ #72792
PROPOSAL: #72792 (comment)
Tests
Precondition:
Account has a workspace
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))npm run compress-svg)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
Screen.Recording.2025-10-30.at.20.36.44.mov
Android: mWeb Chrome
Screen.Recording.2025-10-30.at.19.22.27.mov
iOS: Native
Screen.Recording.2025-10-30.at.19.26.01.mov
iOS: mWeb Safari
Screen.Recording.2025-10-30.at.19.23.57.mov
MacOS: Chrome / Safari
Screen.Recording.2025-10-30.at.16.26.51.mov
MacOS: Desktop
Screen.Recording.2025-10-30.at.19.27.06.mov