From 44d2b7e91283a113d0f96df609ff437b44442a4b Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Wed, 5 Feb 2025 12:23:42 +0530 Subject: [PATCH] fix: Refresh breaks open tabs (#39021) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fixes a focus retention issue where on refresh, the tabs are lost EE Shadow: https://github.com/appsmithorg/appsmith-ee/pull/6106 ## Automation /ok-to-test tags="@tag.IDE" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: e7ed2c3c16b1673b46a3bec68a7317e51bfbd575 > Cypress dashboard. > Tags: `@tag.IDE` > Spec: >
Wed, 05 Feb 2025 06:53:31 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit This update delivers enhanced navigation stability and focus management for a smoother browsing experience. - **Bug Fixes** - Improved focus handling during navigation transitions by ensuring adjustments occur only when returning from a valid page. This refinement minimizes unintended focus shifts, providing a more consistent and user-friendly interface. --- app/client/src/ce/sagas/NavigationSagas.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/client/src/ce/sagas/NavigationSagas.ts b/app/client/src/ce/sagas/NavigationSagas.ts index 6bf02fbea8..88d84e26a4 100644 --- a/app/client/src/ce/sagas/NavigationSagas.ts +++ b/app/client/src/ce/sagas/NavigationSagas.ts @@ -38,12 +38,14 @@ export function* handleRouteChange( yield fork(watchForTrackableUrl, action.payload); const IDEType = getIDETypeByUrl(pathname); - yield fork( - FocusRetention.onRouteChange.bind(FocusRetention), - pathname, - previousPath, - state, - ); + if (previousPath) { + yield fork( + FocusRetention.onRouteChange.bind(FocusRetention), + pathname, + previousPath, + state, + ); + } if (IDEType === IDE_TYPE.App) { yield fork(logNavigationAnalytics, action.payload);