From 6d07b1a91506ac1a499e1abc118cbd30df4cfab4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 7 Apr 2026 00:36:41 +0800 Subject: [PATCH] refactor: simplify ai-cad workbench chrome --- components/ai-cad/ai-cad-workbench.tsx | 562 +++++++++++++------------ 1 file changed, 298 insertions(+), 264 deletions(-) diff --git a/components/ai-cad/ai-cad-workbench.tsx b/components/ai-cad/ai-cad-workbench.tsx index 5a86f0780..3f9b5cbfa 100644 --- a/components/ai-cad/ai-cad-workbench.tsx +++ b/components/ai-cad/ai-cad-workbench.tsx @@ -17,10 +17,14 @@ import { Grid3X3, History, Loader2, + MousePointer2, Orbit, + Pencil, + Plug, Plus, RotateCcw, Send, + Settings2, ThumbsDown, ThumbsUp, Trash2, @@ -57,6 +61,13 @@ import { CardTitle, } from "@/components/ui/card"; import { Collapsible, CollapsibleContent } from "@/components/ui/collapsible"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { ScrollArea } from "@/components/ui/scroll-area"; import { @@ -2336,6 +2347,8 @@ export function AiCadWorkbench() { const [modelingCutType, setModelingCutType] = useState("fillet"); const [isModelingBusy, setIsModelingBusy] = useState(false); + const [isModelingToolsDialogOpen, setIsModelingToolsDialogOpen] = + useState(false); const [messages, setMessages] = useState( createWelcomeMessages ); @@ -4269,10 +4282,23 @@ export function AiCadWorkbench() { : "Ready for first pass"} {generationProvider === "kittycad-cad" ? ( - + + - + ) : null} @@ -4627,234 +4662,6 @@ export function AiCadWorkbench() {
- {generationProvider === "kittycad-cad" ? ( -
-
-
-
- 官方建模工具 -
-

- 这一组直接走官方{" "} - - ws/modeling/commands - - ,不是前端假按钮。 -

-
- - {modelingConnectionState} - -
- -
- - setModelingWidth(event.target.value) - } - placeholder="宽度" - value={modelingWidth} - /> - - setModelingHeight(event.target.value) - } - placeholder="高度" - value={modelingHeight} - /> - - setModelingDepth(event.target.value) - } - placeholder="拉伸深度" - value={modelingDepth} - /> -
- -
- - setModelingEdgeIndices(event.target.value) - } - placeholder="边索引,例如 0,1,2,3" - value={modelingEdgeIndices} - /> - - - setModelingCutSize(event.target.value) - } - placeholder="半径 / 距离" - value={modelingCutSize} - /> -
- -
- - - - - -
- -
-

- 当前平面: - - {truncateIdentifier(modelingPlaneId, 16)} - -

-

- 当前草图: - - {truncateIdentifier(modelingSketchId, 16)} - - ,当前实体: - - {truncateIdentifier(modelingSolidId, 16)} - -

-

- 当前选择: - - {modelingSelectedEntityIds.length > 0 - ? modelingSelectedEntityIds - .map((item) => - truncateIdentifier(item, 10) - ) - .join(", ") - : "未选择"} - -

-
- - {modelingError ? ( -
- {modelingError} -
- ) : null} - - {modelingLogLines.length > 0 ? ( -
-
- session log -
-
- {modelingLogLines.slice(0, 3).map((line) => ( -

{line}

- ))} -
-
- ) : null} -
- ) : null} -