@@ -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 (
-
-
-
+
+
+
返回首页
-
-
+
setActiveLeftPanelView("project")}
type="button"
>
@@ -3540,26 +3543,26 @@ export function AiCadWorkbench() {
Commands
Share
-
{(workspaceSyncError || workspaceOperationError) && (
-
+
{workspaceSyncError ? (
@@ -3578,7 +3581,7 @@ export function AiCadWorkbench() {
-
+
-
+
-
-
-
+
+
+
+ Start Design
+
+
+ {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() {
-
+
{
resultPanelRef.current?.expand();
@@ -3715,10 +3736,10 @@ export function AiCadWorkbench() {
{
resultPanelRef.current?.expand();
@@ -3734,10 +3755,10 @@ export function AiCadWorkbench() {
setViewerSettings((current) => ({
@@ -3752,10 +3773,10 @@ export function AiCadWorkbench() {
setViewerSettings((current) => ({
@@ -3770,10 +3791,10 @@ export function AiCadWorkbench() {
setViewerSettings((current) => ({
@@ -3806,18 +3827,18 @@ 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
-
-
-
-
-
- conversationPanelRef.current?.collapse()
- }
- type="button"
- >
-
-
-
+
+
+
+
+ AI-CAD Agent
+
+
+
+
+
+ conversationPanelRef.current?.collapse()
+ }
+ type="button"
+ >
+
+
+
+
- {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 ? (
+
+
+ setActiveVersionId(
+ linkedVersion.id
+ )
+ }
+ type="button"
+ >
+ V{linkedVersion.versionNumber}
+
+ {canIterateKittyCadVersion(
+ linkedVersion
+ ) ? (
+
+ handleFocusVersionForIteration(
+ linkedVersion
+ )
+ }
+ type="button"
+ >
+ 继续修改
+
+ ) : null}
+
+ ) : null}
+
);
})}
) : (
-
-
-
+
+
+ 9 seconds ago
+
+
+
+
+
+
Try requesting a model, ask engineering
questions, or let's explore ideas.
-
+
)}
-
+
+
-
- {activeVersion ? (
-
-
- 生成引擎
-
+
)}
@@ -4180,10 +4067,10 @@ export function AiCadWorkbench() {
setIsHistoryPanelCollapsed(true)}
onExpand={() => setIsHistoryPanelCollapsed(false)}
order={1}
@@ -4203,8 +4090,8 @@ export function AiCadWorkbench() {
}
/>
) : activeLeftPanelView === "project" ? (
-
-
+
+
Project Explorer
@@ -4438,8 +4325,8 @@ export function AiCadWorkbench() {
) : (
-
-
+
+
Feature Tree
@@ -4996,24 +4883,24 @@ export function AiCadWorkbench() {
title="建模画布"
/>
) : (
-
-
+
-
+
{activeVersion ? "建模画布" : "Canvas"}
-
-
+
+
{activeVersion
- ? "把中间区域收成更接近官方的大画布,预览优先,代码与对照放到下层。"
+ ? "Preview-first canvas for the active model."
: "The center canvas stays focused on the current model."}
-
+
{activeVersion ? (
@@ -5021,9 +4908,9 @@ export function AiCadWorkbench() {
) : null}
-
+
-
+
{activeVersion ? (
@@ -6000,125 +5887,48 @@ export function AiCadWorkbench() {
) : (
-
-
-
- Design Canvas
- Ready for first pass
-
-
-
- setViewerSettings((current) => ({
- ...current,
- showGrid: !current.showGrid,
- }))
- }
- title="切换网格"
- type="button"
- >
-
-
-
- setViewerSettings((current) => ({
- ...current,
- autoRotate: !current.autoRotate,
- }))
- }
- title="切换自动旋转"
- type="button"
- >
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
- Start a design to create geometry
-
-
- 从右侧直接描述零件、尺寸和约束,画布会在这里保持当前模型。
-
+
+
+ 从右侧输入设计意图,模型会直接出现在画布中。
)}
-
-
+
+
)}
-
+
-
-
-
-
-
-
-
+
+ {getProviderLabel(generationProvider)}
+
+ {activeVersion
+ ? `V${activeVersion.versionNumber} · ${getStatusLabel(activeVersion.status)}`
+ : "Ready for first pass"}
+
+
+ {hasPendingTasks
+ ? `${pendingTaskCount} active task`
+ : "Workspace stable"}
+
No selection