Skip to content

feat(core): a light show's tempo as an operation that takes itself back - #823

Merged
mdwn merged 1 commit into
mainfrom
tempo-op
Nov 28, 2026
Merged

mdwn merged 1 commit into
mainfrom
tempo-op

Conversation

@mdwn

@mdwn mdwn commented Nov 28, 2026

Copy link
Copy Markdown
Owner

mtrack-core can now set a .light file's tempo as an undoable operation, like the light show's other edits.

Operation: light_show.set_tempo { tempo, at } makes the file's tempo { } block another (start, BPM, time signature, changes) or, with tempo: None, takes it out. The catalogue has 16 now.

  • Its inverse puts the block back as it was, comments and all, at its place among the file's items. A block written after a show comes back after it.
  • A new block goes after the file's includes, where the writer puts one a file never had.
  • Whether the file still plays is checked's to say, as for every operation. Taking out the tempo of a show timed by bars, or a BPM of 0, is a document the check refuses.
  • Shared placing: the item placing set_palette had is now shared (place_item), with the same behaviour; its tests pass unchanged.

Tests

  • On every example: the tempo set to another, taken out, and added where there was none, each taken back text for text.

  • a_tempo_set_and_taken_back_keeps_its_place_and_is_checked:

    • a block written after its show, with a comment, is taken out (the file no longer plays) and put back where it was, verbatim;
    • another tempo with a change is written and plays;
    • a BPM of 0 is refused by checked.

    The test fails if the block's place is ignored.

  • Run: cargo test -p mtrack-core -p mtrack-rules-wasm (all pass), cargo fmt --check, make lint-rust (only the existing mvr_corpus warning), and make build-ui + make lint-ui (0 errors).

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEZZN4nU1eVZwV4ekT2St9

`set_tempo` makes a file's `tempo { }` block another or takes it out,
answering the block as it was, comments and its place among the file's
items included. The item placing `set_palette` had is shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEZZN4nU1eVZwV4ekT2St9
@mdwn
mdwn merged commit 7c9196f into main Nov 28, 2026
24 checks passed
@mdwn
mdwn deleted the tempo-op branch November 28, 2026 20:34
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