Skip to content

feat(generate): mesh edit panel driven by the mesh-ops registry - #431

Merged
lightningpixel merged 2 commits into
devfrom
feat/306-mesh-edit-panel
Nov 12, 2026
Merged

lightningpixel merged 2 commits into
devfrom
feat/306-mesh-edit-panel

Conversation

@lightningpixel

Copy link
Copy Markdown
Owner

Closes #306

What

A new Edit button (wrench icon) at the right end of the Tools bar on the Generate page opens a side panel next to the 3D viewer that lists every mesh-ops registry op (GET /optimize/ops), so anything the chat agent can do is one click away.

  • Grouped by category, data-driven: Repair, Transform, Topology, Optimize, Presets, Analysis, then any unknown category alphabetically. The presets from T-A5 — Intent-driven presets #299 appear by themselves.
  • Controls generated from params_schema: slider + number field for bounded numbers (log scale for wide ranges like target_faces), switch for booleans, dropdown for select, text otherwise. Defaults pre-filled, "Reset to defaults".
  • Apply runs POST /optimize/op/{id} and hands the new mesh to applyMeshEdit, the same action the chat agent uses, so every edit goes onto the multi-level undo stack (T-B5 — Multi-level undo #304). If the viewer moved to another mesh while the op ran, the result is discarded instead of overwriting that change.
  • Mesh health: inspect_mesh as an inline report with ✓/✗ badges (printable, watertight, manifold, consistent winding, normals outward), stats and issues, flagged as stale once the mesh changes. suggest_fixes lists its fixes with one-click Apply.
  • Composite ops (presets) show their steps as a numbered list.
  • Destructive / non-undoable ops ask for confirmation inside the panel (no browser dialog). No current op sets these flags.
  • Disabled state with no mesh or while generating; loading, error and retry states.

To check in the running app

  • Layout with the panel open (viewer resizes) and scrolling of long reports.
  • Apply → undo → redo, and Inspect → Suggest fixes → Apply fix.
  • Runs have no progress reporting from the backend, only a spinner.
  • Known: the W/R/S gizmo shortcuts are not filtered for <select> elements, so typing in a dropdown can switch the transform tool.

Tests

  • New src/areas/generate/meshEditPanel.test.ts (23 tests): schema → control mapping, log slider, clamping, grouping/order, badges, result helpers, preset step summaries.
  • npm run test: Python 366 OK (5 skipped), Node 148 + 212 pass. npm run lint clean, npm run build OK.

Every op the chat agent can run is now runnable with a click, no LLM
involved. A new Edit button in the Tools bar opens a side panel next to
the viewer that lists the ops served by GET /optimize/ops:

- Ops are grouped by category in a fixed order (repair, transform,
  topology, optimize, presets, analysis); unknown categories still
  appear, after the known ones.
- Controls are generated from params_schema with defaults pre-filled:
  bounded numbers get a slider plus a number field (log scale when the
  range spans 1000x, e.g. face counts), booleans a switch, selects a
  dropdown.
- Apply runs POST /optimize/op/{id}; a response with a url goes through
  applyMeshEdit, so it lands on the per-model undo stack like an agent
  edit. A result is dropped if the viewer moved to another mesh while
  the op ran.
- inspect_mesh renders as an inline Mesh health report (watertight,
  manifold, winding, printable badges, counts, issues); suggest_fixes
  lists its fixes with one-click Apply. Other report-only results show
  their fields inline.
- Destructive or non-undoable ops ask for confirmation inside the panel.
- Empty state without a mesh, loading and retryable error states.

The schema mapping, grouping and result helpers live in a pure module
with node tests; the workspace path helper moves there from GeneratePage.

Closes #306
The prepare_for_* presets report one summary per step; the panel now shows
them as a numbered list above the detail rows.
@lightningpixel
lightningpixel merged commit 276eb96 into dev Nov 12, 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