From 78af1e9402607850ab41f71ab3153985d9321e4e Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 17 Feb 2026 00:27:45 +0200 Subject: [PATCH 1/5] fix:82291: AI - Send button is unresponsive when post image in concierge RHP --- src/libs/Navigation/Navigation.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index d700e268ff647..d2db1aea056ad 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -185,10 +185,14 @@ const closeRHPFlow = (ref = navigationRef) => originalCloseRHPFlow(ref); /** * Close the side panel on narrow layout when navigating to a different screen. */ -function closeSidePanelOnNarrowScreen() { +function closeSidePanelOnNarrowScreen(route: Route) { const isExtraLargeScreenWidth = Dimensions.get('window').width > variables.sidePanelResponsiveWidthBreakpoint; + const isAttachmentPreviewRoute = route && /^r\/\d+\/attachment\/add/.test(route); - if (!sidePanelNVP?.openNarrowScreen || isExtraLargeScreenWidth) { + // If we have a side panel open on devices smaller than 1300px and the user wants to go to the REPORT_ADD_ATTACHMENT route, + // this means that the user clicked `Add Attachments` in the side panel, and in this case, + // there is no need to close the side panel, as we need to have access to the chat. + if (!sidePanelNVP?.openNarrowScreen || isExtraLargeScreenWidth || isAttachmentPreviewRoute) { return; } SidePanelActions.closeSidePanel(true); @@ -308,7 +312,7 @@ function navigate(route: Route, options?: LinkToOptions) { const targetRoute = route.startsWith(CONST.SAML_REDIRECT_URL) ? ROUTES.HOME : route; linkTo(navigationRef.current, targetRoute, options); - closeSidePanelOnNarrowScreen(); + closeSidePanelOnNarrowScreen(route); } /** * When routes are compared to determine whether the fallback route passed to the goUp function is in the state, From fc85f3c851c517fd7348111957967b2920c2cb90 Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 17 Feb 2026 00:50:02 +0200 Subject: [PATCH 2/5] chore: gh comment --- src/libs/Navigation/Navigation.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index d2db1aea056ad..4ab675e384e7a 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -187,7 +187,8 @@ const closeRHPFlow = (ref = navigationRef) => originalCloseRHPFlow(ref); */ function closeSidePanelOnNarrowScreen(route: Route) { const isExtraLargeScreenWidth = Dimensions.get('window').width > variables.sidePanelResponsiveWidthBreakpoint; - const isAttachmentPreviewRoute = route && /^r\/\d+\/attachment\/add/.test(route); + const attachmentRoutePrefix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(':').at(0) ?? ''; // "r/" + const isAttachmentPreviewRoute = typeof route === 'string' && route.includes('/attachment/add') && route.startsWith(attachmentRoutePrefix); // If we have a side panel open on devices smaller than 1300px and the user wants to go to the REPORT_ADD_ATTACHMENT route, // this means that the user clicked `Add Attachments` in the side panel, and in this case, From d25279846dd67bbd346fd32d6f703615810bc745 Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Wed, 18 Feb 2026 12:33:34 +0200 Subject: [PATCH 3/5] c+ comment --- src/libs/Navigation/Navigation.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 4ab675e384e7a..73f1f3433ec4d 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -187,13 +187,20 @@ const closeRHPFlow = (ref = navigationRef) => originalCloseRHPFlow(ref); */ function closeSidePanelOnNarrowScreen(route: Route) { const isExtraLargeScreenWidth = Dimensions.get('window').width > variables.sidePanelResponsiveWidthBreakpoint; - const attachmentRoutePrefix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(':').at(0) ?? ''; // "r/" - const isAttachmentPreviewRoute = typeof route === 'string' && route.includes('/attachment/add') && route.startsWith(attachmentRoutePrefix); - // If we have a side panel open on devices smaller than 1300px and the user wants to go to the REPORT_ADD_ATTACHMENT route, - // this means that the user clicked `Add Attachments` in the side panel, and in this case, - // there is no need to close the side panel, as we need to have access to the chat. - if (!sidePanelNVP?.openNarrowScreen || isExtraLargeScreenWidth || isAttachmentPreviewRoute) { + // Split "r/:reportID/attachment/add" by ":reportID" to get the prefix "r/" and suffix "/attachment/add" + const addAttachmentPrefix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(':reportID').at(0) ?? ''; + const addAttachmentSuffix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(':reportID').at(1) ?? ''; + const attachmentPreviewRoute = ROUTES.REPORT_ATTACHMENTS.route; + const isAddingAttachment = typeof route === 'string' && route.startsWith(addAttachmentPrefix) && route.includes(addAttachmentSuffix); + const isPreviewingAttachment = typeof route === 'string' && route.startsWith(attachmentPreviewRoute); + // If the user is navigating to an attachment route (previewing or adding), keep the side panel open + // so they still have access to the chat. + if (isAddingAttachment || isPreviewingAttachment) { + return; + } + + if (!sidePanelNVP?.openNarrowScreen || isExtraLargeScreenWidth) { return; } SidePanelActions.closeSidePanel(true); From 592e8e6f9525e60ecd2fa0533f459668235b6e8b Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Wed, 18 Feb 2026 12:48:14 +0200 Subject: [PATCH 4/5] c+ comment --- src/libs/Navigation/Navigation.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 73f1f3433ec4d..f820f27b98b7b 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -188,6 +188,10 @@ const closeRHPFlow = (ref = navigationRef) => originalCloseRHPFlow(ref); function closeSidePanelOnNarrowScreen(route: Route) { const isExtraLargeScreenWidth = Dimensions.get('window').width > variables.sidePanelResponsiveWidthBreakpoint; + if (!sidePanelNVP?.openNarrowScreen || isExtraLargeScreenWidth) { + return; + } + // Split "r/:reportID/attachment/add" by ":reportID" to get the prefix "r/" and suffix "/attachment/add" const addAttachmentPrefix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(':reportID').at(0) ?? ''; const addAttachmentSuffix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(':reportID').at(1) ?? ''; @@ -200,9 +204,6 @@ function closeSidePanelOnNarrowScreen(route: Route) { return; } - if (!sidePanelNVP?.openNarrowScreen || isExtraLargeScreenWidth) { - return; - } SidePanelActions.closeSidePanel(true); } From 0d8a10466bdf4eb1b814f98dd9afc2db1dfe388f Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Wed, 18 Feb 2026 13:33:04 +0200 Subject: [PATCH 5/5] fix:82291: added tests --- tests/navigation/NavigateTests.tsx | 94 ++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/tests/navigation/NavigateTests.tsx b/tests/navigation/NavigateTests.tsx index bcc56f8657409..636b5995178e2 100644 --- a/tests/navigation/NavigateTests.tsx +++ b/tests/navigation/NavigateTests.tsx @@ -1,6 +1,7 @@ import {act, render} from '@testing-library/react-native'; import React from 'react'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; +import SidePanelActions from '@libs/actions/SidePanel'; import getIsNarrowLayout from '@libs/getIsNarrowLayout'; import Navigation from '@libs/Navigation/Navigation'; import navigationRef from '@libs/Navigation/navigationRef'; @@ -9,6 +10,7 @@ import NAVIGATORS from '@src/NAVIGATORS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; import TestNavigationContainer from '../utils/TestNavigationContainer'; +import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; jest.mock('@hooks/useResponsiveLayout', () => jest.fn()); jest.mock('@libs/getIsNarrowLayout', () => jest.fn()); @@ -246,5 +248,97 @@ describe('Navigate', () => { expect(lastSplitAfterNavigate?.name).toBe(NAVIGATORS.RIGHT_MODAL_NAVIGATOR); expect(lastSplitAfterNavigate?.state?.routes.at(-1)?.name).toBe(SCREENS.RIGHT_MODAL.SETTINGS); }); + + it.each([ROUTES.REPORT_ADD_ATTACHMENT.getRoute('1'), ROUTES.REPORT_ATTACHMENTS.getRoute()])( + 'does not close the side panel when navigating to attachment routes (%s)', + async (route) => { + // Given the initialized navigation on the narrow layout with the reports split navigator + render( + , + ); + + const closeSidePanelSpy = jest.spyOn(SidePanelActions, 'closeSidePanel'); + + // Open side panel on narrow screen + act(() => { + SidePanelActions.openSidePanel(true); + }); + await waitForBatchedUpdates(); + + // When navigate to an attachment route + act(() => { + Navigation.navigate(route); + }); + + // Then side panel should remain open + expect(closeSidePanelSpy).not.toHaveBeenCalled(); + }, + ); + + it('closes the side panel when navigating to workspaces list', async () => { + // Given the initialized navigation on the narrow layout with the reports split navigator + render( + , + ); + + const closeSidePanelSpy = jest.spyOn(SidePanelActions, 'closeSidePanel'); + + // Open side panel on narrow screen + act(() => { + SidePanelActions.openSidePanel(true); + }); + await waitForBatchedUpdates(); + + // When navigate to a non-attachment route + act(() => { + Navigation.navigate(ROUTES.WORKSPACES_LIST.getRoute()); + }); + + // Then side panel should close on narrow screen + expect(closeSidePanelSpy).toHaveBeenCalledWith(true); + expect(closeSidePanelSpy).toHaveBeenCalledTimes(1); + }); }); });