Skip to content

fix(gui): unify helical-layer defaults via shared HELICAL_DEFAULTS - #129

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/unify-helical-defaults
Jun 25, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
fix/unify-helical-defaults

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #126.

converters.ts applied helical fallback defaults of lockDegrees 5 / leadInMM 10 / leadOutDegrees 5 (in both directions), while createLayer uses 540 / 25 / 60. A latent footgun: a helical layer reaching the converter with a missing field would get lockDegrees=5, which fails helical coverage validation.

Fix: one canonical HELICAL_DEFAULTS const in project.ts, referenced by createLayer and both converter directions — they can no longer drift. createLayer's helical block collapses to { ...HELICAL_DEFAULTS }.

Tests: an existing test asserted the wrong 5/10/5 — corrected to canonical values; added a GUI→schema→GUI round-trip regression test. tsc clean; full vitest 615 passed.

converters.ts used different fallback defaults (lockDegrees 5 / leadInMM 10 /
leadOutDegrees 5) than createLayer (540 / 25 / 60). The mismatch was a latent
footgun: a helical layer reaching the converter with a missing field would get
lockDegrees=5 — a value that fails helical coverage validation.

Add a single canonical HELICAL_DEFAULTS const in project.ts and reference it
from createLayer and both converter directions, so the two can never drift.

An existing test asserted the wrong 5/10/5 defaults — corrected to the canonical
values. Adds a GUI->schema->GUI round-trip test guarding that a freshly created
helical layer survives unchanged (lock_degrees stays 540).

Closes #126
@CameronBrooks11 CameronBrooks11 added the gui Pull requests that update GUI components label Jun 25, 2026
@CameronBrooks11
CameronBrooks11 merged commit 0775e62 into main Jun 25, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/unify-helical-defaults branch June 25, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gui Pull requests that update GUI components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify helical-layer defaults between converters.ts and project.ts

1 participant