Skip to content

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

Closed

Description

@CameronBrooks11

What

types/converters.ts and types/project.ts use different default values for helical-layer fields. Unify them on one shared HELICAL_DEFAULTS constant.

Why

convertLayerToWindSchema (converters.ts ~L31-37) applies these ?? fallbacks:

  • lockDegrees ?? 5
  • leadInMM ?? 10
  • leadOutDegrees ?? 5

…but createLayer (project.ts ~L139-141) creates helical layers with 540 / 25 / 60.

Today this is a latent footgun, not an active bug: the GUI always populates these fields (so the ?? fallbacks never fire). But if a layer ever reached the converter with a missing field, it would inject lockDegrees: 5 — a nonsensical value that fails helical coverage validation. The two sources of truth should not disagree.

Where

  • fiberpath_gui/src/types/converters.ts (helical ?? fallbacks)
  • fiberpath_gui/src/types/project.ts (createLayer defaults)

Acceptance criteria

  • One shared HELICAL_DEFAULTS constant is the single source of truth, referenced by both createLayer and the converter fallbacks.
  • An export→import round-trip of a freshly-created helical layer is value-preserving (add a converters.test.ts case).
  • tsc + vitest green.

Activity

  1. added
    gui
    on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions