Skip to content

cq-viewer 1.4.0: white-model render, conversation folders, orbit around the pressed point - #59

Merged
HanZijie merged 1 commit into
mainfrom
feat/cq_viewer_v2
Oct 22, 2026
Merged

HanZijie merged 1 commit into
mainfrom
feat/cq_viewer_v2

Conversation

@HanZijie

@HanZijie HanZijie commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

CadQuery Viewer 1.4.0

White-model render

  • 渲染 captures the visible models as a clay-white picture, cropped to the model, and a background Agent turn renders it with MiniMax image generation (image-to-image).
  • Four styles, aspect ratio, optional part colours, and the user's own description. The description goes only into the image prompt, never into the Agent's instructions.
  • Progress, approvals, and results stay in the panel. Approvals the Agent asks for are shown with the command and sent only on the user's click. Results can be compared with the white model, copied, downloaded, or retried.
  • The result is accepted only as a real JPEG / PNG / WebP with the job's file name.

Conversation folders

  • The page reads the conversation it is open in through agent.session() (agentAccess: "session.read").
  • The files panel lists models by folder: the conversation folder, folders added to it, and ~/.cqview/scene. Each group folds, and nothing opens until a model is ticked. Outside a conversation nothing is listed.
  • Annotations, renders, and AI open requests are kept per conversation folder.
  • The MCP tools take a workspace argument, so an AI opens models only in its own conversation's viewer. The bundled skill now passes it.

Navigation

  • Pressing on the model makes that point the orbit centre without moving the picture; a ring marks it while dragging.
  • Trackpad mapping: two fingers pan, pinch zooms. Mouse mapping: the wheel zooms, right or middle drag pans. Shift + drag pans on both.
  • The mapping is detected on each scroll, or can be fixed in the new 操作方式 popover.

Other

  • The page shows the plugin icon instead of the old cube logo.

Repository contract

agentAccess may now also contain "session.read", with minimum MiniMax Code 3.1.4. This covers the validator, the minimum-version table, docs/agent.md, docs/package-contract.md, and the corresponding test.

The capability is not documented yet. It was observed on 3.1.4-preview.4773: with the grant, the page's agent.session() returns the current conversation, including workspaceDir.

Checks

  • npm run check: no errors; plugins/hanzijie/cq-viewer: OK with no warnings; 69/69 tests pass.
  • node --test plugins/hanzijie/cq-viewer/tests/*.test.mjs: 35/35 pass, including render.test.mjs (10 tests) and workspace.test.mjs (6 tests).
  • Headless Chromium against the real Node entry, light and dark:
    • render panel flow;
    • conversation and no-conversation modes;
    • folder groups;
    • orbit pivot (pixel diff on press is anti-aliasing noise only);
    • wheel routing.
  • On MiniMax Code 3.1.4-preview: published and opened in a conversation. The page registered that conversation's folder by itself, and viewer_connected: true. A cold Agent session ran the exact render instructions end to end and produced a 2048² PNG that passed the Viewer's own checks.

Not verified

  • A render started from the page inside MiniMax Code.
  • A real trackpad inside the Electron tab.
  • The MCP workspace argument through the Host from a new conversation.
  • 下载, 复制图片, and 查看过程 in Electron.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…nd the pressed point

CadQuery Viewer
- White-model render: capture the visible models as a clay-white picture
  cropped to the model; a background Agent turn renders it with MiniMax
  image generation (image-to-image). Styles, aspect ratio, part colours,
  the user's own description; progress, approvals relayed to the page
  (never auto-allowed), compare / copy / download / retry.
- Conversation folders: the page reads the conversation it is open in
  (agent.session(), agentAccess "session.read") and lists every model in
  that folder, grouped by folder with the extra folders and
  ~/.cqview/scene; nothing opens until ticked; nothing is listed outside a
  conversation. Annotations, renders, and AI open requests are kept per
  conversation folder; MCP tools take a `workspace` argument.
- Navigation: pressing on the model makes that point the orbit centre
  without moving the picture; trackpad (two-finger pan, pinch zoom) and
  mouse (wheel zoom, right/middle pan) mappings, detected per scroll or
  fixed in the new 操作方式 popover.
- The page shows the plugin icon instead of the old cube logo.
- Tests: render.test.mjs (10), workspace.test.mjs (6); 35 in total.

Repository contract
- agentAccess may also contain "session.read" (MiniMax Code 3.1.4 or
  later, observed on 3.1.4-preview): validator, minimum-version table,
  docs/agent.md, docs/package-contract.md, and the test updated.
@HanZijie
HanZijie merged commit 55c13bd into main Oct 22, 2026
1 check passed
@HanZijie
HanZijie deleted the feat/cq_viewer_v2 branch October 22, 2026 14:53
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