Skip to content

feat(gui): surface helical circuit count + bind the divisibility mismatch (#145) - #291

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/pattern-explainability
Jun 28, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/pattern-explainability

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Addresses the circuit-mismatch clarity + pattern-docs halves of #145.

The gap

The helical editor already had per-field tooltips and computed the circuit count internally — but only surfaced it inside a transient warning right before planning failed, so users couldn't see where the planner's circuit count not divisible by patternNumber number came from. And planner-math.md only documented the axial pass count (length/(w·cos α)), never the circumferential circuit count (π·d·cos(α)/w) that the validation actually uses.

Changes

  • Always-on derived readout in the helical editor: ≈ N circuits per layer · the pattern number must divide this evenly (warning-styled when it doesn't), via a new getHelicalGeometry() that mirrors the Python compute_helical_kinematics.
  • Inline field binding: the divisibility mismatch now reads as an error on the Pattern Number field (suppressed when the field already has its own validation error, so existing coprime/range errors win).
  • Slimmed getHelicalGeometryHint to just the skip-index routing warning; moved its circuit tests to getHelicalGeometry.
  • Docs: documented the circuit-count derivation + the three pattern constraints (divisibility, coprimality, lock alignment) with a worked example (150 mm / 50 mm / 45° → 7 circuits) in planner-math.md.

Scope note

This is the explainability/docs slice. Not included (deferred): binding the backend LayerValidationError strings (esp. the detailed lock-degrees Condition 1/2 messages) to specific UI fields — that needs validation-plumbing work and is a reasonable follow-up. The client-side circuit clarity here is computed from the same formula, so it surfaces proactively without it.

GUI gate green: tsc, svelte-check, 322 vitest, stylelint + css-vars. Closes #145.

…atch

Addresses the "circuit-mismatch clarity" half of #145. The helical layer editor
already had per-field tooltips and computed the circuit count internally, but
only showed it inside a transient warning when planning was about to fail — so
users couldn't see where the planner's "circuit count not divisible by
patternNumber" number came from.

- Add `getHelicalGeometry()` (structured circuit count + divisibility), mirroring
  the Python `compute_helical_kinematics`, and render an always-on readout
  (`≈ N circuits per layer · the pattern number must divide this evenly`) under
  the editor.
- Bind the divisibility mismatch to the Pattern Number field as an inline error
  (suppressed when the field already has its own validation error).
- Slim `getHelicalGeometryHint` to the skip-index routing warning (the circuit
  relationship now lives in the readout); move its tests to `getHelicalGeometry`.
- Document the circumferential circuit-count derivation + pattern constraints
  (divisibility / coprimality / lock alignment) with a worked example in
  planner-math.md — previously only the axial pass count was documented, never
  the circuit count the validation actually uses.

GUI gate green: tsc, svelte-check, 322 vitest, stylelint (+ css-vars).

Closes #145.
@CameronBrooks11
CameronBrooks11 merged commit ee6d19b into main Jun 28, 2026
18 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/pattern-explainability branch June 28, 2026 17:46
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.

Pattern parameter explainability: GUI aids + reference docs + circuit-mismatch clarity

1 participant