Repository navigation
BT Migrate Report Core 1 - #90113
BT Migrate Report Core 1#90113
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02ea918c8f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Screen.Recording.2026-05-11.at.10.09.46.movBUG: Cannot go back from the report detail page. Becasue the url is |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-05-27.at.10.04.02.mov |
This comment was marked as outdated.
This comment was marked as outdated.
|
@huult Although I've fixed the issue about details not opening. I've raised a comment for @collectioneur's help. Can you review the other parts meanwhile? |
|
@huult All the checks passed. |
|
@mananjadhav please resolve the conflict and we're good to merge |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.3.84-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR and no help site updates are required. This PR is an internal navigation refactoring — migrating report-scoped routes from legacy
There are no user-facing changes — no UI labels, features, or behaviors were modified. The existing help site articles that reference these features (e.g., Understanding Report Statuses and Actions, Expense and Report Actions) remain accurate as-is. @mananjadhav, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.3.86-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. This is a purely internal navigation refactoring — migrating report-scoped routes from legacy No help site changes are required. The user-facing behavior remains identical; only internal routing mechanics changed. The help site articles under @mananjadhav, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.3.88-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. This is a purely internal navigation refactoring — it migrates report-scoped navigation from legacy The changes are limited to:
No user-facing behavior, features, UI text, or workflows are changing, so no help site updates are needed for this PR. @mananjadhav, no help site PR was created since there are no user-facing changes requiring documentation updates. If you believe any docs should be updated, please let me know and I can revisit. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.88-2 🚀
|
|
|
||
| if (report?.reportID) { | ||
| Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report?.reportID, backTo)); | ||
| Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path)); |
There was a problem hiding this comment.
@mananjadhav, I believe this part of the change caused #94977, because the helper falls back to the active route, which may not contain the target reportID.
Could you share the reason for removing the explicit report base path? Was there a navigation case this was intended to address, or was this unintentional?
Thanks.
There was a problem hiding this comment.
I wanna add my 2 cents, @mananjadhav did you update this logic due to REPORT_DETAILS.entryScreens explicitly permits SEARCH.ROOT, SEARCH_REPORT, SEARCH_MONEY_REQUEST_REPORT, EXPENSE_REPORT and WORKSPACE.ROOMS as entry points, and getStateFromPath merges the underlying screen's params into the details screen. The active-route fallback is what makes details open within the user's current context?
Context: I'm propose a solution to fix a related issue #94977 (comment)
Besides, I try to test your changes here, and it looks like the change above is required
import Navigation from '@libs/Navigation/Navigation';
import {navigateToDetailsPage} from '@libs/ReportUtils';
import CONST from '@src/CONST';
import type {Report} from '@src/types/onyx';
jest.mock('@libs/Navigation/Navigation', () => ({
navigate: jest.fn(),
getActiveRoute: jest.fn(),
setNavigationActionToMicrotaskQueue: jest.fn(),
}));
jest.mock('@libs/Permissions');
const REPORT_ID = '4139850258346598';
const POLICY_ID = 'D5C313FD8FDF2B3F';
const adminsRoom: Report = {
reportID: REPORT_ID,
policyID: POLICY_ID,
chatType: CONST.REPORT.CHAT_TYPE.POLICY_ADMINS,
type: CONST.REPORT.TYPE.CHAT,
};
describe('navigateToDetailsPage', () => {
const mockNavigate = jest.mocked(Navigation.navigate);
const mockGetActiveRoute = jest.mocked(Navigation.getActiveRoute);
beforeEach(() => {
jest.clearAllMocks();
});
describe('outside the Side Panel', () => {
it('opens details in the context of the active route', () => {
mockGetActiveRoute.mockReturnValue(`r/${REPORT_ID}`);
navigateToDetailsPage(adminsRoom);
expect(mockNavigate).toHaveBeenCalledWith(`r/${REPORT_ID}/details`);
});
it('keeps the Search context so details does not jump to the report', () => {
// PR #90113 dropped the hardcoded report base path on purpose: `REPORT_DETAILS.entryScreens` allows
// Search and workspace rooms as entry points, and details is meant to open within whichever of those
// the user is currently in. Re-anchoring to `r/<reportID>` here would regress that.
mockGetActiveRoute.mockReturnValue('search/all/12345');
navigateToDetailsPage(adminsRoom);
expect(mockNavigate).toHaveBeenCalledWith('search/all/12345/details');
});
});
describe('inside the Side Panel', () => {
it('anchors details to the report instead of the screen behind the panel', () => {
// Regression test for https://github.com/Expensify/App/issues/94977.
// `SidePanelReport` renders `ReportScreen` with a synthetic route, so the report is never part of the
// navigation state. After onboarding the RHP variant experiment leaves the workspace overview as the
// active route, and falling back to it built `/workspaces/<policyID>/overview/details`, which fails the
// `REPORT_DETAILS` entryScreens check and rendered the Not found page.
mockGetActiveRoute.mockReturnValue(`/workspaces/${POLICY_ID}/overview`);
navigateToDetailsPage(adminsRoom, true);
expect(mockNavigate).toHaveBeenCalledWith(`r/${REPORT_ID}/details`);
expect(mockGetActiveRoute).not.toHaveBeenCalled();
});
});
it('does not navigate when the report has no reportID', () => {
navigateToDetailsPage(undefined);
expect(mockNavigate).not.toHaveBeenCalled();
});
});
Explanation of Change
Fixed Issues
$ #83365
PROPOSAL:
Tests
This PR migrates report-scoped navigation off legacy
REPORT_WITH_ID_*helpers toDYNAMIC_ROUTESfor report details, share code, export, and change workspace. Other call sites that were updated to usecreateDynamicRoute/ new screen keys should be covered by targeted smoke checks rather than a file-by-file checklist. For instance:1. Report details (dynamic root)
r/<reportID>/details(no duplicatedetails, no unexpectedbackTo).2. Change workspace
r/<reportID>/change-workspace.3. Share code (report details + referral)
r/<reportID>/details/shareCode.backTo/ prior screen).4. Export (report details export modal)
details/export/<connectionName>on web when applicable).r/<reportID>/details/export/<connectionName>(use a validconnectionNamefor the policy, e.g.quickbooksOnline,xero,netsuite,intacctper policy setup).Offline tests
Same as test steps
QA Steps
Same as test steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web-bt-report-core-1.mov
web-bt-report-profile-regression-1.mov