- {/* Export Chat Button */}
- {chatStarted && shouldShowButtons &&
}
-
- {/* Sync Button */}
- {shouldShowButtons && (
-
-
-
- {isSyncing ? 'Syncing...' : 'Sync'}
-
-
-
-
-
- {isSyncing ?
:
}
-
{isSyncing ? 'Syncing...' : 'Sync Files'}
-
-
-
-
-
- )}
-
{/* Deploy Button */}
{shouldShowButtons &&
}
diff --git a/app/components/workbench/Workbench.client.tsx b/app/components/workbench/Workbench.client.tsx
index 52194fc..3661c49 100644
--- a/app/components/workbench/Workbench.client.tsx
+++ b/app/components/workbench/Workbench.client.tsx
@@ -13,7 +13,6 @@ import {
type OnScrollCallback as OnEditorScroll,
} from '~/components/editor/codemirror/CodeMirrorEditor';
import { IconButton } from '~/components/ui/IconButton';
-import { PanelHeaderButton } from '~/components/ui/PanelHeaderButton';
import { Slider, type SliderOptions } from '~/components/ui/Slider';
import { workbenchStore, type WorkbenchViewType } from '~/lib/stores/workbench';
import { classNames } from '~/utils/classNames';
@@ -26,6 +25,10 @@ import useViewport from '~/lib/hooks';
import { usePreviewStore } from '~/lib/stores/previews';
import { chatStore } from '~/lib/stores/chat';
import type { ElementInfo } from './Inspector';
+import { ExportChatButton } from '~/components/chat/chatExportAndImport/ExportChatButton';
+import { useChatHistory } from '~/lib/persistence';
+import { streamingState } from '~/lib/stores/streaming';
+import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
interface WorkspaceProps {
chatStarted?: boolean;
@@ -302,6 +305,9 @@ export const Workbench = memo(
const canHideChat = showWorkbench || !showChat;
const isSmallViewport = useViewport(1024);
+ const streaming = useStore(streamingState);
+ const { exportChat } = useChatHistory();
+ const [isSyncing, setIsSyncing] = useState(false);
const setSelectedView = (view: WorkbenchViewType) => {
workbenchStore.currentView.set(view);
@@ -351,6 +357,21 @@ export const Workbench = memo(
workbenchStore.currentView.set('diff');
}, []);
+ const handleSyncFiles = useCallback(async () => {
+ setIsSyncing(true);
+
+ try {
+ const directoryHandle = await window.showDirectoryPicker();
+ await workbenchStore.syncFiles(directoryHandle);
+ toast.success('Files synced successfully');
+ } catch (error) {
+ console.error('Error syncing files:', error);
+ toast.error('Failed to sync files');
+ } finally {
+ setIsSyncing(false);
+ }
+ }, []);
+
return (
chatStarted && (
{selectedView === 'code' && (
-
{
- workbenchStore.toggleTerminal(!workbenchStore.showTerminal.get());
- }}
- >
-
- Toggle Terminal
-
+ {/* Export Chat Button */}
+
+
+ {/* Sync Button */}
+
+
+
+ {isSyncing ? 'Syncing...' : 'Sync'}
+
+
+
+
+
+ {isSyncing ? (
+
+ ) : (
+
+ )}
+
{isSyncing ? 'Syncing...' : 'Sync Files'}
+
+
+
+
+
+
+ {/* Toggle Terminal Button */}
+
+
+
)}