refactor(workspace): rename replaceUrlToWorkspace to replaceUrlToRoot

URL sync is now handled by the centralized effect, not callers.
This commit is contained in:
kumarabhirup 2026-03-05 22:54:18 -08:00
parent e3eb86c531
commit 7dd38c185c
No known key found for this signature in database
GPG Key ID: DB7CA2289CAB0167
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ describe("resetWorkspaceStateOnSwitch", () => {
setActiveSessionId: vi.fn(),
setActiveSubagentKey: vi.fn(),
resetMainChat: vi.fn(),
replaceUrlToWorkspace: vi.fn(),
replaceUrlToRoot: vi.fn(),
reconnectWorkspaceWatcher: vi.fn(),
refreshSessions: vi.fn(),
refreshContext: vi.fn(),
@ -28,7 +28,7 @@ describe("resetWorkspaceStateOnSwitch", () => {
expect(deps.setActiveSessionId).toHaveBeenCalledWith(null);
expect(deps.setActiveSubagentKey).toHaveBeenCalledWith(null);
expect(deps.resetMainChat).toHaveBeenCalledTimes(1);
expect(deps.replaceUrlToWorkspace).toHaveBeenCalledTimes(1);
expect(deps.replaceUrlToRoot).toHaveBeenCalledTimes(1);
expect(deps.reconnectWorkspaceWatcher).toHaveBeenCalledTimes(1);
expect(deps.refreshSessions).toHaveBeenCalledTimes(1);
expect(deps.refreshContext).toHaveBeenCalledTimes(1);

View File

@ -9,7 +9,7 @@ type WorkspaceSwitchDeps = {
setActiveSessionId: (sessionId: string | null) => void;
setActiveSubagentKey: (sessionKey: string | null) => void;
resetMainChat: () => void;
replaceUrlToWorkspace: () => void;
replaceUrlToRoot: () => void;
reconnectWorkspaceWatcher: () => void;
refreshSessions: () => void;
refreshContext: () => void;
@ -29,7 +29,7 @@ export function resetWorkspaceStateOnSwitch(deps: WorkspaceSwitchDeps): void {
deps.setActiveSessionId(null);
deps.setActiveSubagentKey(null);
deps.resetMainChat();
deps.replaceUrlToWorkspace();
deps.replaceUrlToRoot();
deps.reconnectWorkspaceWatcher();
deps.refreshSessions();
deps.refreshContext();