Skip to content

fix: allow named spritesheet animation frames - #368

Merged
han4wluc merged 8 commits into
mainfrom
fix/spritesheet-frame-names
Oct 10, 2026
Merged

han4wluc merged 8 commits into
mainfrom
fix/spritesheet-frame-names

Conversation

@han4wluc

@han4wluc han4wluc commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Spritesheet clips addressed by numeric index depend on JavaScript key enumeration. Numeric-looking atlas keys such as "10", "2", and "1" are reordered ascending, so an index can select a different frame than the author expects. Accept frame names as well as numeric indexes so authors can choose frames explicitly. The renderer already resolves named frames; the project schema rejected them. Numeric-index semantics are unchanged.

Schema tests accept frame names, numeric indexes, and mixed lists, and reject boolean, null, object, and array frames at the offending index. Each of three wrong schemas fails them: accepting any item, strings only, or numbers only. A render test checks that named frames pass through unchanged.

Visual coverage: the new visual-spritesheet-named-frames CI scenario uses a high-contrast atlas with numeric-looking names and stationary frames for deterministic capture. Named frames pass with zero mismatches. The same scenario using numeric indexes fails at 73.9% similarity, beyond the 0.8% threshold. The existing visual-spritesheet-default scenario, an animated trimmed atlas using numeric indexes, is unchanged. Fixture-only assets require explicit opt-in.

Validation on current main (6bcde38): all 2,366 tests pass. Build, lint, test markers, formatting, and the regenerated ESM validators are clean. The named-frame, default spritesheet, and media-continuity browser scenarios pass with zero mismatches.

Follow-up: the creator currently converts frame names to indexes on export, so it should emit names after this lands.

…tesheet-frame-names

# Conflicts:
#	src/generated/l10nPayloadValidators.js
…-names

# Conflicts:
#	src/generated/l10nPayloadValidators.js
#	vt/static/main.js
Restore visual-spritesheet-default, the only screenshot coverage of an
animated trimmed atlas addressed by numeric indexes, and move the
named-frame scenario to visual-spritesheet-named-frames.

Schema tests now accept names, numeric indexes, and mixed lists, and
reject boolean, null, object, and array frames.
@han4wluc
han4wluc merged commit 7380072 into main Oct 10, 2026
40 checks 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