Repository navigation
feat(core): a light show's shows, and the whole file, as operations that take themselves back - #824
Merged
Merged
Conversation
…hat take themselves back insert_show and remove_show add a show and take one out, the removal's inverse putting it back between the items it was between. set_document puts the whole file, as its text reads, and says any place may have moved. Claude-Session: https://claude.ai/code/session_01VEZZN4nU1eVZwV4ekT2St9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
mtrack-corecan now add and remove a show in a.lightfile and put the whole file, each as an undoable operation like the light show's other edits. The catalogue has 19 now.Operations
light_show.insert_show { at, show, item }puts a show at placeatamong the file's shows.itemis where among the file's items it goes; the inverse of a removal gives it, so the show comes back between the items it was between.light_show.remove_show { show }takes a show out, its cues and comments with it.light_show.set_document { document }puts the whole file as its text reads (an editor reads it bydocument(), against the file's own path, soincludes resolve). Its inverse is the file as it was. It reports a newMoved::Everything, because any place may have moved, for whoever keeps names for them.LightShow::named(name)(andedit::light_show::new_show) is a show with no cues, as an editor adds one.insert_lined,remove_lined,nth_line) is now generic over the kind of line, so a file's items use it too. Cue behaviour is unchanged; its tests pass as they were.Not done here: the player keeps the last of two shows with one name (
shows.insertby name), andcheckeddoesn't refuse that. An editor adding a show is expected to refuse a name that's taken.Tests
a_show_taken_out_comes_back_between_the_items_it_was_between: a file with a sequence between two shows. The first show is taken out and put back, verbatim. A new show goes after the show before it, ahead of the sequence, and the file plays. The test fails if the item's place is ignored.a_files_first_show_goes_last: a palette-only file gets its first show after the palette.a_file_put_whole_is_taken_back_whole_and_says_everything_moved.cargo test -p mtrack-core -p mtrack-rules-wasm(all pass),cargo fmt --check,make lint-rust(only the existingmvr_corpuswarning), andmake build-ui+make lint-ui.🤖 Generated with Claude Code
https://claude.ai/code/session_01VEZZN4nU1eVZwV4ekT2St9