Fix archived workspace session routing\n\nCloses #128

This commit is contained in:
Mohamed Boudra
2026-03-20 12:17:50 +07:00
parent c9f2e01131
commit 26c07b671f
7 changed files with 152 additions and 29 deletions
+2 -5
View File
@@ -14,7 +14,6 @@ import {
import {
buildHostWorkspaceAgentRoute,
buildHostSettingsRoute,
parseHostAgentRouteFromPathname,
parseServerIdFromPathname,
} from "@/utils/host-routes";
import type { ShortcutKey } from "@/utils/format-shortcut";
@@ -196,8 +195,6 @@ export function useCommandCenter() {
const handleSelectAgent = useCallback(
(agent: AggregatedAgent) => {
didNavigateRef.current = true;
const shouldReplace = Boolean(parseHostAgentRouteFromPathname(pathname));
const navigate = shouldReplace ? router.replace : router.push;
// Don't restore focus back to the prior element after we navigate.
clearCommandCenterFocusRestoreElement();
@@ -207,9 +204,9 @@ export function useCommandCenter() {
agent.cwd,
agent.id
) as Href;
navigate(route);
router.navigate(route);
},
[pathname, setOpen]
[setOpen]
);
const openProjectPicker = useOpenProjectPicker(activeServerId);