Skip to content

feat(parametric): add design tree viewer#140

Draft
techfowl wants to merge 1 commit intoAdam-CAD:masterfrom
techfowl:feat-design-tree-viewer-pr
Draft

feat(parametric): add design tree viewer#140
techfowl wants to merge 1 commit intoAdam-CAD:masterfrom
techfowl:feat-design-tree-viewer-pr

Conversation

@techfowl
Copy link
Copy Markdown

@techfowl techfowl commented May 3, 2026

Summary

Adds a lightweight design tree for annotated parametric OpenSCAD artifacts.

The viewer now includes a collapsible design-tree drawer. Selecting a node filters linked parameter controls on desktop and mobile. Generated and edited artifacts also populate designTree metadata by parsing @cadam-node comments.

Closes #139
Related to #62

What changed

  • Added shared DesignNode artifact metadata.
  • Added @cadam-node comment parsing in shared/designTree.ts.
  • Added a reusable design tree panel.
  • Added a compact viewer drawer overlay.
  • Shared selected-node state between viewer, desktop parameters, and mobile parameters.
  • Added fallback parsing when older artifacts have annotated code but no populated tree.
  • Updated parametric code generation guidance to emit CADAM design-tree annotations for important parts, operations, and assemblies.

Out of scope

This PR does not implement mesh/viewport click selection. That requires node-to-geometry mapping from generated source to compiled mesh output and should be handled separately.

Test plan

  • npm run typecheck
  • npm run lint — passes with existing warnings in unrelated files
  • npm run build
  • npm run lint:supabase

Manual checks still needed before marking ready for review:

  • Annotated artifact shows viewer tree button with count.
  • Opening drawer shows nested tree rows.
  • Selecting a node filters desktop parameter controls.
  • Clearing selection restores all parameters.
  • Unannotated artifact opens drawer empty state.
  • Mobile preview drawer opens and node selection filters mobile controls.
  • Existing rendering, orbit controls, download controls, and compile loading overlay continue to work.

Summary by cubic

Adds a design tree viewer for annotated OpenSCAD models. Selecting a node filters parameters, and artifacts now include designTree metadata parsed from @cadam-node comments.

  • New Features
    • Parse @cadam-node comments into DesignNodes in @shared/designTree and attach designTree to artifacts.
    • Viewer gets a compact drawer with node count; selection is shared with desktop and mobile parameter panels.
    • Parameter panels add a Tree view and filter controls by the selected node; Clear restores all parameters.
    • Fallback parsing when older artifacts have annotations but no designTree.
    • Updated code-gen prompt to emit CADAM design-tree annotations for parts, operations, and assemblies.

Written for commit 4b3fbdc. Summary will update on new commits.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

@techfowl is attempting to deploy a commit to the Adam Team on Vercel.

A member of the Team first needs to authorize it.

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.

feat(parametric): add design tree viewer for annotated models

1 participant