feat: Add Diff View and File History Tracking

- Implemented a new Diff View in the Workbench to visualize file changes
- Added file history tracking with detailed change information
- Enhanced FileTree and FileModifiedDropdown to show line additions and deletions
- Integrated file history saving and retrieval in ActionRunner
- Updated Workbench view types to include 'diff' option
- Added support for inline and side-by-side diff view modes
This commit is contained in:
Toddyclipsgg
2025-02-23 07:55:38 -03:00
parent 8c72ed76b3
commit ab6f5328b4
17 changed files with 1192 additions and 77 deletions

View File

@@ -12,6 +12,7 @@ import {
import { PanelHeader } from '~/components/ui/PanelHeader';
import { PanelHeaderButton } from '~/components/ui/PanelHeaderButton';
import type { FileMap } from '~/lib/stores/files';
import type { FileHistory } from '~/types/actions';
import { themeStore } from '~/lib/stores/theme';
import { WORK_DIR } from '~/utils/constants';
import { renderLogger } from '~/utils/logger';
@@ -27,6 +28,7 @@ interface EditorPanelProps {
editorDocument?: EditorDocument;
selectedFile?: string | undefined;
isStreaming?: boolean;
fileHistory?: Record<string, FileHistory>;
onEditorChange?: OnEditorChange;
onEditorScroll?: OnEditorScroll;
onFileSelect?: (value?: string) => void;
@@ -45,6 +47,7 @@ export const EditorPanel = memo(
editorDocument,
selectedFile,
isStreaming,
fileHistory,
onFileSelect,
onEditorChange,
onEditorScroll,
@@ -83,6 +86,7 @@ export const EditorPanel = memo(
files={files}
hideRoot
unsavedFiles={unsavedFiles}
fileHistory={fileHistory}
rootFolder={WORK_DIR}
selectedFile={selectedFile}
onFileSelect={onFileSelect}