Skip to content

Add standalone parts manager and shared UI library - #3

Merged
nilres merged 1 commit into
masterfrom
feature/parts-manager
Oct 20, 2026
Merged

nilres merged 1 commit into
masterfrom
feature/parts-manager

Conversation

@nilres

@nilres nilres commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • New app, openecraft-parts-manager (parts-manager/): a standalone application for maintaining the parts of an openecraft-server. It runs on Windows, Linux, macOS and in the browser.
    • Connect with the server URL and access token. The token is kept in memory only; the URL is persisted.
    • The same product-group tree and tabbed part editor as in the editor, including the Graphics tab (SVG / STL / OBJ import).
    • Parts can be created, copied, saved (Ctrl+S), reverted and deleted. Renaming saves the part under the new number and then deletes the old number.
    • It asks before discarding unsaved changes and before deleting. It blocks saving a part with an empty or already used number.
    • CSV / JSON parts files can be uploaded, and all parts exported as CSV / JSON.
    • On a read-only server, the buttons that change data are disabled.
  • New library, openecraft-ui (crates/openecraft-ui): egui code shared by the editor and the manager, moved out of the editor:
    • part tree, part editor, part summary and model import;
    • the 2D and 3D previews;
    • the parts server client (gains save = PUT and delete);
    • file dialogs and downloads, now generic over the application's file kinds.
  • openecraft-parts:
    • new vec3 module (vector math and the Orbit camera), used by the panel 3D view and the mesh preview;
    • new PartsDb::merge.
  • Editor: parts_ui.rs, io.rs and panel_ui.rs now use the libraries, parts_server.rs is removed, and unused direct dependencies are dropped. Net −530 lines in the editor.
  • The manager's editing rules live in parts-manager/src/session.rs. That module contains no UI code and is unit tested.
  • Conventions, docs and CI:
    • The test-layout and glyph checks now also cover crates/openecraft-ui and parts-manager.
    • README and AGENTS.md are updated.
    • CI builds the manager for desktop and web and uploads both as artifacts.
    • The web build has its own parts-manager/index.html and Trunk.toml (port 8082).

Note for reviewers

  • The editor's 2D model preview is now drawn directly with egui theme colours instead of through render::Draw with the editor palette, so it may look slightly different. The page / SVG rendering of models is unchanged.

Test plan

  • cargo test --workspace: 72 tests
  • cargo clippy --workspace --all-targets and cargo clippy -p openecraft -p openecraft-parts-manager --target wasm32-unknown-unknown are clean
  • trunk build from parts-manager/
  • Web build against a local server:
    • connect: 41 parts loaded;
    • create TEST.RELAY-1 (checked on the server with curl);
    • rename it to TEST.RELAY-1B (old number deleted on the server);
    • delete it via the confirmation dialog;
    • the Graphics tab shows the 2D and 3D previews.
  • Desktop manager window and the editor's parts management dialog after the refactor (not checked visually)

🤖 Generated with Claude Code

- Add openecraft-parts-manager: standalone app (desktop + web) to create,
  edit, rename and delete the parts of a parts server, upload CSV/JSON
  parts files and export all parts
- Add the openecraft-ui crate with the part tree, part editor, 2D/3D model
  previews, parts server client (now with save and delete) and file I/O,
  moved out of the editor
- Move the 3D vector math / orbit camera and PartsDb::merge into
  openecraft-parts
- Extend the test layout and glyph checks to the new crates
- Update README, AGENTS.md, CI and the launch configurations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nilres
nilres merged commit b47c8cd into master Oct 20, 2026
8 checks passed
@nilres
nilres deleted the feature/parts-manager branch October 25, 2026 17:30
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