Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aae247b
editor i18n: the Chinese UI names things the way SolidWorks does
lizaixi01 Nov 29, 2026
39daa86
docs(design): record why the editor's Chinese wording follows SolidWorks
lizaixi01 Nov 29, 2026
c7bf0bd
editor: manual mode can be switched on for development with VITE_MANU…
lizaixi01 Nov 29, 2026
565b8f8
fix(editor): redo keeps a cell's id after an undo renamed it
lizaixi01 Nov 29, 2026
094f73f
fix(editor): a slider value kept into its params cell no longer break…
lizaixi01 Nov 29, 2026
92d0763
fix(editor): the left panel never scrolls sideways
lizaixi01 Nov 29, 2026
c2810d6
feat(editor sketch): a rectangle tool (corner to corner, four lines k…
lizaixi01 Nov 29, 2026
72d3d34
feat(editor): export says where the files went, writes STEP and STL, …
lizaixi01 Nov 29, 2026
2c7a11a
editor: the feature tree and notices speak a person's words (step num…
lizaixi01 Nov 29, 2026
bbb7446
editor: clicking the picked tree row again or the empty list clears t…
lizaixi01 Nov 29, 2026
4cbf0b2
editor: every slider has a box to type its value in
lizaixi01 Nov 29, 2026
d00011e
editor: the inspector measures what is picked (sizes, and between two…
lizaixi01 Nov 29, 2026
93fde68
editor: the floating cards can be dragged out of each other's way and…
lizaixi01 Nov 29, 2026
99fa862
editor: the inspector says whether the pick reached the AI
lizaixi01 Nov 29, 2026
b098c8b
feat(editor): leave the AI a request on picked geometry; a headless c…
lizaixi01 Nov 29, 2026
7461b99
docs(design): record how the editor hands a request on picked geometr…
lizaixi01 Nov 29, 2026
94c9b0c
fix(editor): `sca` imports os where it reads the agent's request id
lizaixi01 Nov 29, 2026
c7f512a
fix(editor): undo and redo bring a cell back next to its nearest neig…
lizaixi01 Nov 29, 2026
a0d1926
editor: the notes above the feature tree put their words on top and t…
lizaixi01 Nov 29, 2026
c6c54ca
feat(editor): pointing at a step in the feature tree lights up the fa…
lizaixi01 Nov 29, 2026
2a305b7
fix(editor): a step's faces are found from the recorded history, so c…
lizaixi01 Nov 29, 2026
0410997
editor: a step's second line says what it does (its code's first comm…
lizaixi01 Nov 29, 2026
165a893
editor: the step clicked in the feature tree shows its whole description
lizaixi01 Nov 29, 2026
e247375
fix(editor): hovering a step only lights up the model; the clicked st…
lizaixi01 Nov 29, 2026
e5f008f
editor: "Sketch on this face" puts the sketch on a workplane made fro…
lizaixi01 Nov 29, 2026
2b2b7b5
editor i18n: the Chinese sketch tooltips no longer name SDK functions
lizaixi01 Nov 29, 2026
fddb5c6
editor sketch: a grey constraint button says what to pick first
lizaixi01 Nov 29, 2026
4bc586f
editor sketch: the outline and the holes are named by their shapes, o…
lizaixi01 Nov 29, 2026
3710ee0
editor sketch: a click beside a point is a miss, and a click that cha…
lizaixi01 Nov 29, 2026
1cb1ddd
editor sketch: a dimension's slider says what it measures ("Width", "…
lizaixi01 Nov 29, 2026
ed64d33
editor: when the background service is unreachable, a banner says so …
lizaixi01 Nov 29, 2026
698fc64
editor: a sketch is drawn with its dimensions' slider values, so its …
lizaixi01 Nov 29, 2026
c4c02f5
editor: numbers tried in the editor and not in the code are said at t…
lizaixi01 Nov 29, 2026
88b25e3
fix(editor): keeping a number writes the number just sent, not the on…
lizaixi01 Nov 29, 2026
af9a57c
editor: the pencil of a step written as code tunes its numbers in pla…
lizaixi01 Nov 29, 2026
2ca14aa
editor: the undo history is kept beside the notebook, so a restart of…
lizaixi01 Nov 29, 2026
e416cd1
editor: the undo and redo buttons say what they would change, and wha…
lizaixi01 Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions design-docs/editor-ask-ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Ask AI: a request on picked geometry, done by a coding agent

Status: built on branch `feat/editor-manual-mode-ux` (2026-11-29), manual mode only.

## The need

A person modelling in the editor's manual mode often knows what they want ("a boss around this hole, 20 mm across") but not
the operations that make it. They asked to write that sentence right on the picked geometry.

## What was tried

Three clickable prototypes (2026-11-28):

1. **Stored comments.** The note is kept on the geometry; an agent reads them later. Rejected by the user: "还不如不加留言功能".
A person wants the change, not a note waiting for someone.
2. **Comment thread with replies.** Too heavy for one sentence.
3. **Request run at once.** Chosen: the note starts an agent right away and the page shows the result.

## How it works

- The person picks faces, edges, solids or components and opens "Ask AI" (in the context bar or the command bar).
- `POST /api/requests {note, items}` makes a request. `AgentRequests` (`src/simplecadapi/editor/agent_requests.py`) starts
`claude -p` in the workspace. The prompt holds the note, the picks as `ql` selectors (the code the selection cell holds),
the notebook's steps and the instruction to name a new step with `# 名称:` / `# 说明:` lines (the feature tree shows them).
- **What the agent may use:** `sca cell`, `sca snapshot`, `sca ops`, Read/Glob/Grep, and the SDK skill. Edit, Write, web
access and other shell commands are denied. So the running editor stays the one writer of the notebook, and the page
shows each edit live.
- **Progress:** the agent's stream (`--output-format stream-json`) is turned into stages (理解需求 → 查看零件 → 修改模型 → 检查结果 →
完成) and steps in plain words. They reach the pages as `request` messages.
- **One undo step:** the agent's cell commands carry its request id (`SCA_AGENT_REQUEST` in its environment, sent as the
header `X-Sca-Agent-Request` by `sca`). The server notes the cells each one touched. When the request ends, only those
cells' changes are recorded as one history entry (`FeatureService.record_changes(..., only=...)`). Edits the person made
meanwhile are not taken back by undoing the agent.
- **Kept across restarts:** requests are stored in `.sca-editor/requests.json` and ids go on from the last one. A request
cut off by a restart is marked failed.
- **Choosing an agent:** `SCA_AGENT_CMD` replaces the executable (the tests use a stand-in). `SCA_AGENT_MODEL` picks the
model, otherwise the CLI's default.

## Open

- **Cost:** a request is a full agent run. The user raised this. There is no budget or per-request limit yet.
- **Other agents:** another coding agent would need the same contract: edit only through `sca cell`, and pass the request id.
- **No cancel button:** a request ends by itself, after 10 minutes at most.
32 changes: 32 additions & 0 deletions design-docs/editor-sw-terms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Editor wording follows SolidWorks (Chinese UI)

The editor's manual mode is used by people who learned CAD on SolidWorks. Where the editor named a thing differently, they
looked for the SolidWorks word and did not find it. The Chinese translation table (`editor-web/src/i18n/locales/zh-CN.json`)
now uses the SolidWorks Chinese terms. Only words a person reads changed: the SDK, the notebook code, the keys of the table and
everything an agent reads stay as they were, so the kernel stays agent-friendly.

| Thing | Was | Now (SolidWorks) |
|---|---|---|
| A plane to sketch on | 工作平面 | 基准面 |
| Sketch fully determined | 已求解 | 完全定义 |
| Sketch still free to move | 欠约束 N 自由度 | 欠定义(还有 N 个自由度) |
| Sketch over-determined | 冲突 | 过定义 |
| Sketch constraints (as a group) | 约束 | 几何关系/尺寸 |
| Automatic horizontal/vertical | 自动约束 | 自动添加几何关系 |
| Construction geometry | 构造线 | 构造几何线 |
| Mirror | 镜像 | 镜向 |
| Extrude that adds | 拉伸(合并) | 拉伸凸台 |
| Extrude that removes | 拉伸(切除) | 拉伸切除 |
| Push or pull a face | 推拉 | 移动面 |
| Hole on a face | 在此打孔 | 简单直孔 |
| An edge to pick | 边 | 边线 |
| Assembly joints | …约束 | …配合(铰链、滑块、齿轮、齿条小齿轮、皮带/链、锁定) |

Not changed on purpose:

- **基本体** (box, cylinder, …): SolidWorks has no primitives (it sketches and extrudes), so there is no word to copy.
- **组件** for an assembly component: SolidWorks says 零部件 or 组件; both are understood.
- Behaviour that differs from SolidWorks (pick-kind chips instead of hover selection, connectors instead of face mates, no
rollback bar) is not a wording question; it is listed with the editor's open issues.

The SolidWorks terms are the ones its Chinese releases commonly use; a few may differ slightly between versions.
Loading
Loading