[Constraint 2.0 / D] Project-wide shared-variable table (.scadforge.json) #12
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_openscad_parametric_gui#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Project-wide shared-variable table (depends on sub-issues #B #C)
Why:
// @sf:paramand// @sf:equaltoday operate by string name within and across files, but there's no central registry — names are resolved by lookup at solve time. To support// @sf:equal to=motor.bore_dia(a dotted path to a deeper shared) and to make cross-file links provable in CI, we need a real table.Spec:
.scadforge.json(already the project manifest) gains a"shared_params"array:// @sf:exportannotation (new) marks a local assignment for inclusion in this table: On first parse of the file, the parser adds an entry to.scadforge.jsonif missing. On re-parse, the comment presence keeps the entry (refresh default from current value).// @sf:equal to=plate_lengthnow resolves via the table first, falling back to local-symbol lookup (back-compat).ConstraintPanel.tsx, not a hard error (so legacy constraints with stale defaults still render).Files to change:
src/lib/vfs.ts(the merge seam) — addSharedParamto the project manifest schema, export fromProject.src/lib/scad/constraints.ts— newexportkind case + table lookup inequal.src/lib/scad/parser.ts— capture@sf:exportcomment position.src/lib/scad/solver.ts— table-fed scope.src/pages/SettingsModal.tsx— add a Shared-Parameters tab to view/edit the table, with min/max validation.Acceptance:
.scadforge.jsonwith two shared params round-trips: create via UI, save, reload project, params still there.// @sf:equal to=plate_lengthfrom any file resolves correctly.plate_lengthdefault in the UI updates dependent parts in the viewport within one frame.Out of scope: imports from external
.scadforge.jsonpackages, versioned shared-param namespaces.Labels: enhancement
Part of epic #8.