Skip to content

fix(gui): suppress geometry hint while pattern number is mid-edit - #172

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/geometry-hint-nan
Jun 25, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
fix/geometry-hint-nan

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Bug F1 from the latent-bug audit (same shape as the helical crash, but cosmetic).

Problem

getHelicalGeometryHint runs on every keystroke with the live (non-debounced) helical. Emptying the Pattern Number field makes it NaN, and circuitCount % NaN is NaN (!== 0), so the UI rendered: "Estimated circuits (N) are not divisible by pattern number (NaN)…".

Fix

Guard the divisibility branch on Number.isInteger(pattern_number) && pattern_number > 0; otherwise emit no hint (the field already surfaces its own validation error).

TDD

  • RED: does not emit a '(NaN)' hint while pattern_number is mid-edit returned the NaN string before the fix.
  • GREEN: passes after. helicalValidation 25 pass; full GUI suite 620 passed, tsc clean.

getHelicalGeometryHint computed circuitCount % pattern_number using the live
(non-debounced) value, so emptying the Pattern Number field (NaN) rendered
'not divisible by pattern number (NaN)'. Guard the divisibility branch on a
valid positive-integer pattern number; the field reports its own error.
Adds a regression test.
@CameronBrooks11
CameronBrooks11 merged commit 9e012da into main Jun 25, 2026
15 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/geometry-hint-nan branch June 25, 2026 21:45
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.

1 participant