feat: schema-driven Qt form for new item creation #174
Reference in New Issue
Block a user
Delete Branch "feat/schema-driven-new-item-form"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the hardcoded 3-dialog chain in
Silo_New(category → description → projects) with a singleSchemaFormDialogthat fetches schema data from the Silo REST API and builds the UI dynamically at runtime.New File:
mods/silo/freecad/schema_form.pySchemaFormDialog
A
QDialogthat mirrors the ReactCreateItemPane.tsxlayout:Identity Section:
Sourcing Section (collapsible):
Details Section (collapsible):
Dynamic Property Sections (appear on category change):
Live Part Number Preview:
POST /api/generate-part-number(debounced 500ms) when category changesAPI Endpoints Used (same as React frontend)
GET /api/schemas/kindred-rd— category enum valuesGET /api/schemas/kindred-rd/properties?category={code}— merged property definitionsGET /api/projects— project list for taggingPOST /api/generate-part-number— part number previewPOST /api/items— item creation (via existing_client.create_item())Modified:
silo_commands.py—Silo_New.Activated()Replaced ~90 lines of hardcoded dialogs with ~30 lines that:
SchemaFormDialogwith the existing_clientdlg.exec_and_create()Acceptance Criteria
Submodule Note
mods/silosubmodule points to branchfeat/schema-driven-new-item-formonsilo-mod.f7152d65aetocbf8796cc2