Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7798853
editor i18n: the Chinese UI names things the way SolidWorks does
lizaixi01 Nov 29, 2026
824608e
docs(design): record why the editor's Chinese wording follows SolidWorks
lizaixi01 Nov 29, 2026
97522cb
editor i18n: an assembly component is 零部件, as in SolidWorks
lizaixi01 Dec 1, 2026
8989e25
editor: manual mode can be switched on for development with VITE_MANU…
lizaixi01 Nov 29, 2026
be3760e
fix(editor): redo keeps a cell's id after an undo renamed it
lizaixi01 Nov 29, 2026
5284f9d
fix(editor): a slider value kept into its params cell no longer break…
lizaixi01 Nov 29, 2026
4b3556b
fix(editor): the left panel never scrolls sideways
lizaixi01 Nov 29, 2026
654594a
feat(editor): export says where the files went, writes STEP and STL, …
lizaixi01 Nov 29, 2026
71a9d66
editor: the feature tree and notices speak a person's words (step num…
lizaixi01 Nov 29, 2026
ccb0231
editor: clicking the picked tree row again or the empty list clears t…
lizaixi01 Nov 29, 2026
4992fae
editor: every slider has a box to type its value in
lizaixi01 Nov 29, 2026
437950b
editor: the inspector measures what is picked (sizes, and between two…
lizaixi01 Nov 29, 2026
5ec3006
editor: the floating cards can be dragged out of each other's way and…
lizaixi01 Nov 29, 2026
c4d1193
editor: the feature tree's name and note tags are matched without Chi…
lizaixi01 Nov 30, 2026
061f1d9
editor i18n: the inspector's word for an assembly component is 零部件 too
lizaixi01 Dec 1, 2026
1ef7c83
fix(editor): an exported file with a non-ASCII name downloads (RFC 59…
lizaixi01 Dec 1, 2026
791bdfe
fix(editor): a long export error keeps its beginning ("STEP export fa…
lizaixi01 Dec 1, 2026
04e7668
fix(editor): closing the export dialog by its button forgets what was…
lizaixi01 Dec 1, 2026
761b316
editor: the inspector says whether the pick reached the AI
lizaixi01 Nov 29, 2026
e20385e
feat(editor): leave the AI a request on picked geometry; a headless c…
lizaixi01 Nov 29, 2026
d83e1b5
docs(design): record how the editor hands a request on picked geometr…
lizaixi01 Nov 29, 2026
9ec1265
fix(editor): `sca` imports os where it reads the agent's request id
lizaixi01 Nov 29, 2026
97e769b
editor: Ask AI's progress and reasons are English in the library and …
lizaixi01 Nov 30, 2026
dcbdc2a
editor: Ask AI counts picked assembly components as 零部件
lizaixi01 Dec 1, 2026
9f0a6fb
fix(editor): Ask AI's agent run works on Windows and survives a close…
lizaixi01 Dec 1, 2026
96689a6
editor i18n: Ask AI counts what is picked through the translation tab…
lizaixi01 Dec 1, 2026
5602d4c
fix(editor): undo and redo bring a cell back next to its nearest neig…
lizaixi01 Nov 29, 2026
6ece81e
editor: the notes above the feature tree put their words on top and t…
lizaixi01 Nov 29, 2026
ccdc1bd
feat(editor): pointing at a step in the feature tree lights up the fa…
lizaixi01 Nov 29, 2026
89386bb
fix(editor): a step's faces are found from the recorded history, so c…
lizaixi01 Nov 29, 2026
c043947
editor: a step's second line says what it does (its code's first comm…
lizaixi01 Nov 29, 2026
495c873
editor: the step clicked in the feature tree shows its whole description
lizaixi01 Nov 29, 2026
e6fdc74
fix(editor): hovering a step only lights up the model; the clicked st…
lizaixi01 Nov 29, 2026
727df84
editor: the pencil of a step written as code tunes its numbers in pla…
lizaixi01 Nov 29, 2026
5c90a03
editor: the note fallback's docstring is English
lizaixi01 Nov 30, 2026
f1f3d2e
editor: a step's faces are asked once the pointer rests on its row (1…
lizaixi01 Dec 1, 2026
3a7c2b8
feat(editor sketch): a rectangle tool (corner to corner, four lines k…
lizaixi01 Nov 29, 2026
fe91096
editor: "Sketch on this face" puts the sketch on a workplane made fro…
lizaixi01 Nov 29, 2026
fb86a1c
editor i18n: the Chinese sketch tooltips no longer name SDK functions
lizaixi01 Nov 29, 2026
37cdceb
editor sketch: a grey constraint button says what to pick first
lizaixi01 Nov 29, 2026
ac321c2
editor sketch: the outline and the holes are named by their shapes, o…
lizaixi01 Nov 29, 2026
b2536c7
editor sketch: a click beside a point is a miss, and a click that cha…
lizaixi01 Nov 29, 2026
4400961
editor sketch: a dimension's slider says what it measures ("Width", "…
lizaixi01 Nov 29, 2026
6358a68
editor: a sketch is drawn with its dimensions' slider values, so its …
lizaixi01 Nov 29, 2026
5565b6a
editor: a sketch on a face that is cancelled takes its workplane back
lizaixi01 Dec 1, 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 | …约束 | …配合(铰链、滑块、齿轮、齿条小齿轮、皮带/链、锁定) |
| A part or sub-assembly placed in an assembly | 组件 | 零部件 |

Not changed on purpose:

- **基本体** (box, cylinder, …): SolidWorks has no primitives (it sketches and extrudes), so there is no word to copy.
- 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