feat(KB-175): move file browser to header with workspace support

- Add workspace file APIs and hooks for session-scoped file browsing
- Create WorkspaceSelector component for switching between workspaces
- Update FileBrowserModal with workspace mode and improved UX
- Add files button to header with workspace-aware file browsing
- Add session files indicator to task cards for quick file access
- Include comprehensive tests for all new components and hooks
This commit is contained in:
gsxdsm
2026-03-31 01:26:57 -07:00
parent 18c4f0cb25
commit 9e03c47b91
30 changed files with 1779 additions and 829 deletions

View File

@@ -1,6 +1,6 @@
import { useState, useEffect, useCallback } from "react";
import type { FileContentResponse, SaveFileResponse } from "../api";
import { fetchProjectFileContent, saveProjectFileContent } from "../api";
import { fetchWorkspaceFileContent, saveWorkspaceFileContent } from "../api";
interface UseProjectFileEditorReturn {
content: string;
@@ -56,7 +56,7 @@ export function useProjectFileEditor(
setError(null);
try {
const response: FileContentResponse = await fetchProjectFileContent(filePath!);
const response: FileContentResponse = await fetchWorkspaceFileContent("project", filePath!);
if (!cancelled) {
setContentState(response.content);
@@ -95,7 +95,7 @@ export function useProjectFileEditor(
setError(null);
try {
const response: SaveFileResponse = await saveProjectFileContent(filePath, content);
const response: SaveFileResponse = await saveWorkspaceFileContent("project", filePath, content);
setOriginalContent(content);
setMtime(response.mtime);
} catch (err: any) {