Repository navigation
fix(gui): unify helical-layer defaults via shared HELICAL_DEFAULTS - #129
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #126.
converters.tsapplied helical fallback defaults oflockDegrees 5 / leadInMM 10 / leadOutDegrees 5(in both directions), whilecreateLayeruses540 / 25 / 60. A latent footgun: a helical layer reaching the converter with a missing field would getlockDegrees=5, which fails helical coverage validation.Fix: one canonical
HELICAL_DEFAULTSconst inproject.ts, referenced bycreateLayerand 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 aGUI→schema→GUIround-trip regression test. tsc clean; full vitest 615 passed.