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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user