refactor(file-explorer): centralize navigation state in session context and optimize initialization

This commit is contained in:
Mohamed Boudra
2025-11-11 18:15:46 +01:00
parent c5b30ed878
commit f766a18d7b
2 changed files with 69 additions and 53 deletions
@@ -119,6 +119,7 @@ export interface AgentFileExplorerState {
isLoading: boolean;
lastError: string | null;
pendingRequest: ExplorerRequestState | null;
currentPath: string;
}
const createExplorerState = (): AgentFileExplorerState => ({
@@ -127,6 +128,7 @@ const createExplorerState = (): AgentFileExplorerState => ({
isLoading: false,
lastError: null,
pendingRequest: null,
currentPath: ".",
});
@@ -923,6 +925,7 @@ export function SessionProvider({ children, serverUrl }: SessionProviderProps) {
isLoading: true,
lastError: null,
pendingRequest: { path: normalizedPath, mode: "list" },
currentPath: normalizedPath,
}));
const msg: WSInboundMessage = {