Skip to content

Bug fixes: JIF page, propPermutation length, Movement curve scan#28

Open
wikkyrose wants to merge 4 commits into
helbling:mainfrom
wikkyrose:fix/core-jif-bugs
Open

Bug fixes: JIF page, propPermutation length, Movement curve scan#28
wikkyrose wants to merge 4 commits into
helbling:mainfrom
wikkyrose:fix/core-jif-bugs

Conversation

@wikkyrose

Copy link
Copy Markdown

Four small, independent fixes (each its own commit, based on main):

  1. jif-page: guard against null localStorage 'jif' on first load (page froze on first visit / incognito)
  2. jif-page: make parse error/warning text selectable
  3. jif: validate propPermutation length against props, not limbs
  4. animation: only advance Movement.lastIndex on a match (the scan skipped curves → a prop/hand could freeze for a span)

Your test suite passes (35/35). Generated with Claude/Codex assistance; commits carry Co-authored-by: trailers.

wikkyrose and others added 4 commits July 4, 2026 18:18
localStorage.getItem('jif') returns null when the key is unset — first visit,
incognito, or after clearing site data. The value was assigned unconditionally to
jifString, so Jif.complete(null) threw "Cannot read properties of null (reading
'meta')" and the page froze with no visible error. Only override the default when a
non-empty value is actually stored. Also drops the no-op second argument to getItem.

Co-authored-by: Claude (Anthropic) <noreply@anthropic.com>
Parse errors and warnings couldn't be selected/copied, which makes it awkward to
quote a message when filing a bug or asking for help. Re-enable text selection on
the .error and .warnings blocks.

Co-authored-by: Claude (Anthropic) <noreply@anthropic.com>
_completeRepetition() checked rep.propPermutation.length against jif.limbs.length,
but a propPermutation indexes props — so any pattern where the prop count differs
from the limb count (nearly all of them) had a valid propPermutation wrongly reset
to identity, with a spurious "invalid size of repetition.propPermutation" warning.
Compare against jif.props.length. (limbPermutation just above already, correctly,
checks jif.limbs.length.)

Co-authored-by: Claude (Anthropic) <noreply@anthropic.com>
getCurveAndFraction() reassigned this.lastIndex on every loop iteration, so the
search-start hint grew while scanning and the modular probe index
`(lastIndex + i) % nCurves` skipped curves — from lastIndex 0 with 6 curves it
visited 0,1,3,0,4,3 and never 2 or 5. The period-wrapping curve could be one of the
skipped indices, so the affected prop/hand froze for that span and then snapped to
the next curve. Advance lastIndex only when a curve actually matches.

Co-authored-by: Claude (Anthropic) <noreply@anthropic.com>
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