Skip to content

feat(editor): create a notebook from the workspace tab - #41

Merged
NiJingzhe merged 2 commits into
devfrom
feat/editor-new-entry
Oct 13, 2026
Merged

NiJingzhe merged 2 commits into
devfrom
feat/editor-new-entry

Conversation

@NiJingzhe

Copy link
Copy Markdown
Collaborator

Why

The editor could not create a notebook: the "new" button was removed from the header earlier, and the backend endpoint (POST /api/workspace/new, which writes the SDK's template) had no caller. sca edit on an empty directory started and showed nothing.

What

  • A new action in the workspace tab's notebooks header opens an inline form: a name, part or assembly, create.
    • The name is checked as you type against the template's rule and the files that exist (bracket.py already exists.); the server's reason is shown if it refuses.
    • An assembly starts with the first two parts of the workspace (the form says which); it is disabled until there is a part.
    • After a successful create the server opens the notebook and the editor shows its cells. After choosing the kind, focus returns to the name field so Enter creates.
  • An empty workspace lands on the workspace tab with the form already open, instead of "waiting for the kernel"; the header says what to do.
  • The new notebook is the template: PEP 723 header, with app.setup: import simplecadapi as scad (hidden in the editor), a params cell, one feature, the product.

Checked (real editor, browser)

Empty directory: form shown; 9bad name refused; bracket (part) created and opened, tab switched to the notebook; rig (assembly) created, list shows rig ASSEMBLY uses bracket; creating bracket again is refused inline. npm run build passes; the template and creation logic were already covered by test_editor.py.

Not in this PR

sca new <name> [DIR] on the command line (creating the workspace directory and a first notebook without opening the editor).

NiJingzhe and others added 2 commits October 14, 2026 00:24
A 'new' action in the notebooks header: a name (checked against the template's rule and the
existing files), part or assembly (assembly starts with the first two parts of the workspace),
create. An empty workspace opens on the workspace tab with the form shown. Server errors (a
taken name) are shown in the form.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The completion entry (#40) had landed in the 2.2.1 section; both entries are under
Unreleased now, with the editor-configuration fix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@NiJingzhe
NiJingzhe merged commit cf791cd into dev Oct 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant