diff --git a/components/ai-cad/ai-cad-workbench.tsx b/components/ai-cad/ai-cad-workbench.tsx index a29aa4373..c3b9517cf 100644 --- a/components/ai-cad/ai-cad-workbench.tsx +++ b/components/ai-cad/ai-cad-workbench.tsx @@ -1998,11 +1998,11 @@ function AiCadPanelResizeHandle({ className }: { className?: string }) { return ( -
+
); } @@ -2022,10 +2022,10 @@ function AiCadCollapsedPanel({
- -
{title}
+ +
{title}
); @@ -2105,7 +2103,7 @@ function AiCadToolbarGroup({ return (
@@ -2118,7 +2116,7 @@ function AiCadToolbarGroup({ ); } -function AiCadMessageActionButton({ +function _AiCadMessageActionButton({ icon: Icon, label, onClick, @@ -2139,7 +2137,7 @@ function AiCadMessageActionButton({ ); } -function AiCadStatusChip({ +function _AiCadStatusChip({ label, tone = "neutral", value, @@ -2405,21 +2403,26 @@ export function AiCadWorkbench() { }, [activeWorkspaceId]); useEffect(() => { + const hasActiveVersion = Boolean(activeVersionId || versions.length > 0); + if ( - hasAutoCollapsedExplorerRef.current || panelDirection !== "horizontal" || isLoadingWorkspaceList || !hasHydratedFromStorage || - versions.length > 0 || !historyPanelRef.current ) { return; } - hasAutoCollapsedExplorerRef.current = true; - historyPanelRef.current.collapse(); - setIsHistoryPanelCollapsed(true); + if (!hasActiveVersion) { + hasAutoCollapsedExplorerRef.current = true; + historyPanelRef.current.collapse(); + setIsHistoryPanelCollapsed(true); + } else if (versions.length > 0 && hasAutoCollapsedExplorerRef.current) { + hasAutoCollapsedExplorerRef.current = false; + } }, [ + activeVersionId, hasHydratedFromStorage, isLoadingWorkspaceList, panelDirection, @@ -2684,7 +2687,7 @@ export function AiCadWorkbench() { semanticCodeDiffInsights.length > 0 ? semanticCodeDiffInsights : activeVersionSemanticInsights; - const followUpSuggestions = buildFollowUpSuggestions({ + const _followUpSuggestions = buildFollowUpSuggestions({ activeVersion, activeParentVersion, previewSourceVersion, @@ -2705,7 +2708,7 @@ export function AiCadWorkbench() { const activeWorkspaceName = activeWorkspace?.name || "AI-CAD 工作台"; const normalizedWorkspaceName = normalizeWorkspaceTitle(activeWorkspaceName); const shouldForceTreeCollapsed = - !activeVersion && activeLeftPanelView === "tree"; + panelDirection === "horizontal" && !activeVersion; const isWorkspaceActionDisabled = isSubmitting || isCreatingWorkspace || isDeletingWorkspace; const canDeleteActiveWorkspace = @@ -3511,26 +3514,26 @@ export function AiCadWorkbench() { } return ( -
-
-
+
+
+
返回首页 -
-
+
+
AI
- + AI-CAD Studio
-
+
AI
{(workspaceSyncError || workspaceOperationError) && ( -
+
{workspaceSyncError ? (

@@ -3578,7 +3581,7 @@ export function AiCadWorkbench() {

-
+
{primaryDownloadEntry ? ( - - Export - + Export ) : ( )}
-
+
-
-
- +
+ + + {generationProvider === "kittycad-cad" + ? "KittyCAD / Zoo CAD" + : "Tripo3D"} + + {activeVersion ? `Focus V${activeVersion.versionNumber}` : "Ready for first pass"} - + + + {workspaceSyncState === "synced" ? "Synced" : "Syncing"} + +
+
{versions.length} versions + {completedCount} done {hasPendingTasks ? `${pendingTaskCount} task active` @@ -3695,14 +3716,14 @@ export function AiCadWorkbench() {
-
+
-
+
setIsConversationPanelCollapsed(true)} onExpand={() => setIsConversationPanelCollapsed(false)} order={3} @@ -3831,78 +3852,35 @@ export function AiCadWorkbench() { title="AI-CAD Agent" /> ) : ( - - -
-
- - - AI-CAD Agent - - - Continuous design thread for the active version. - -
-
- - Agent - - - -
+
+
+
+ + AI-CAD Agent
+
+ + +
+
- {activeVersion ? ( -
-
-
- - Session Context - - - Focus V{activeVersion.versionNumber} - -
-
- - {getProviderLabel(activeVersion.provider)} - - - {getStatusLabel(activeVersion.status)} - - - {activeVersion.generationMode === "iterate" - ? "Iterative" - : "Initial"} - -
-
-

- {activeVersion.generationMode === "iterate" - ? `当前已经沿着 V${activeVersion.versionNumber} 进入连续修改模式。` - : `当前焦点在 V${activeVersion.versionNumber}。`} -

-
- ) : null} - - - - + +
{activeVersion || messages.length > 1 ? ( -
+
{messages.map((message) => { const linkedVersion = message.versionId ? findVersionById(versions, message.versionId) @@ -3911,106 +3889,113 @@ export function AiCadWorkbench() { return (
-
-
+
+
{message.role === "user" ? ( - <> - - 你 - + 你 ) : ( - <> - - AI-CAD Agent - + AI-CAD )} {formatClockTime(message.createdAt)} -
- {message.role !== "user" && - message.state ? ( - - {getMessageStateLabel(message.state)} - - ) : null} -
- - {linkedVersion ? ( -
- - V{linkedVersion.versionNumber} - - - {getStatusLabel(linkedVersion.status)} - -
- ) : null} - -
- {message.content} -
- - {linkedVersion ? ( -
- - setActiveVersionId(linkedVersion.id) - } - /> - {canIterateKittyCadVersion( - linkedVersion - ) ? ( - - handleFocusVersionForIteration( - linkedVersion - ) - } - /> + {message.role !== "user" && + message.state ? ( + + {getMessageStateLabel( + message.state + )} + ) : null}
- ) : null} +
+ {message.content} +
+ {linkedVersion ? ( +
+ + {canIterateKittyCadVersion( + linkedVersion + ) ? ( + + ) : null} +
+ ) : null} +
); })}
) : ( -
-
-

+

+
+ 9 seconds ago +
+
+
+ +
+
Try requesting a model, ask engineering questions, or let's explore ideas. -

+
)} - +
+ -
- {activeVersion ? ( -
- - 生成引擎 - +
+
+