Skip to content

Rename the animation player's busy to currentStepCompletion, and fix two CodeQL findings - #279

Merged
mikemaccana merged 3 commits into
mainfrom
claude/peaceful-ptolemy-oh26c8-step-animation
Nov 6, 2026
Merged

mikemaccana merged 3 commits into
mainfrom
claude/peaceful-ptolemy-oh26c8-step-animation

Conversation

@mikemaccana

@mikemaccana mikemaccana commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • animations/engine.js: rename. Player.busy is now Player.currentStepCompletion. Deck's pass-through getter in animations/deck.js gets the same name.
  • animations/engine.js: next(). It no longer compares promises to decide whether to clear currentStepCompletion. Each animation gets a number from animationCount, and next() clears the field only if no newer animation has started.
  • animations/lending/scene.js: the unused note() line helper is removed.

Why

  • The name. busy held the promise that the current step's animation completes, or null when no step is animating. A name like busy reads as a boolean. currentStepCompletion names what the field holds.
  • CodeQL. It flagged two things on the Quicknode docs copy of these files (quiknode-labs/docs#3668):
    • this.busy === run read as a missing await, because it compared two promises.
    • note was defined and never called. It was the only scene helper like that; I checked every scene.

Testing

  • node --check passes on engine.js, deck.js and lending/scene.js.
  • npm run animation-frames -- escrow and -- lending play through every slide and diagram step, giving 37 and 67 frames. This runs next() and interrupt().
  • npm run lint passes ("Manuscript and figure lint clean").
  • Not run here: scripts/check-figure-geometry.mjs and npm run build-pdf-digital. This environment doesn't have the licensed Denim INK font files. The change touches neither figures nor the manuscript.

Docs copy

quiknode-labs/docs#3668 carries byte-for-byte copies of these files. I've synced it with this branch at 764bbba, so merge this PR first.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GZHin6BQpAqf7j2ucSZWkx

Player.busy held the running step's animation, the promise play() returns,
or null between steps. A name like "busy" reads as a boolean, so code that
used it had to know it was really a promise. stepAnimation says what it
holds, and a comment where the constructor sets it says when it resolves.
Deck's pass-through getter takes the same name.

Claude-Session: https://claude.ai/code/session_01GZHin6BQpAqf7j2ucSZWkx
- engine.js: next() cleared stepAnimation only if it still held the promise
  this call started, by comparing the two promises, which CodeQL reads as a
  missing await. Each animation now gets a number from animationCount, and
  next() clears stepAnimation only if no newer animation has started.
- lending/scene.js: the note() line helper was defined and never called.

Claude-Session: https://claude.ai/code/session_01GZHin6BQpAqf7j2ucSZWkx
The field holds the promise that the current step's animation completes, or
null when no step is animating. currentStepCompletion names that.

Claude-Session: https://claude.ai/code/session_01GZHin6BQpAqf7j2ucSZWkx
@mikemaccana mikemaccana changed the title Rename the animation player's busy to stepAnimation Rename the animation player's busy to currentStepCompletion, and fix two CodeQL findings Nov 6, 2026
@mikemaccana
mikemaccana merged commit d8068ba into main Nov 6, 2026
1 check passed
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