Repository navigation
Rename the animation player's busy to currentStepCompletion, and fix two CodeQL findings - #279
Merged
Merged
Conversation
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
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.
What changes
animations/engine.js: rename.Player.busyis nowPlayer.currentStepCompletion. Deck's pass-through getter inanimations/deck.jsgets the same name.animations/engine.js:next(). It no longer compares promises to decide whether to clearcurrentStepCompletion. Each animation gets a number fromanimationCount, andnext()clears the field only if no newer animation has started.animations/lending/scene.js: the unusednote()line helper is removed.Why
busyheld the promise that the current step's animation completes, ornullwhen no step is animating. A name likebusyreads as a boolean.currentStepCompletionnames what the field holds.this.busy === runread as a missingawait, because it compared two promises.notewas defined and never called. It was the only scene helper like that; I checked every scene.Testing
node --checkpasses onengine.js,deck.jsandlending/scene.js.npm run animation-frames -- escrowand-- lendingplay through every slide and diagram step, giving 37 and 67 frames. This runsnext()andinterrupt().npm run lintpasses ("Manuscript and figure lint clean").scripts/check-figure-geometry.mjsandnpm 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