Repository navigation
fix(scenes): drag-reorder with scene_number_start != 1, keep cards with moved scenes - #287
Merged
Merged
Conversation
…th moved scenes Two bugs in scene drag-reorder: 1. Navigator and cards view started the drag with the *displayed* scene number (offset by scene_number_start), while drop detection and reorderScene work in 1-based positional order. For any file not numbered from 1 — e.g. a co-writer's range starting at 41 — drag silently did nothing or moved the wrong scene. Drag state now uses the positional ordinal throughout. 2. Navigator's reorderScene didn't remap scene_cards[].scene_index, so a scene moved from the sidebar picked up its old slot's description, shoot notes and schedule. Applies the same remap SceneCardsView already does. 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.
Summary
Fixes two bugs in scene drag-reorder.
1. Drag broken when numbering doesn't start at 1. The scene navigator and the cards view started a drag using the displayed scene number, which is offset by
scene_number_start. Drop detection andreorderScenecount scenes by position, starting at 1. For a file whose numbering starts at, say, 41, the drag either did nothing or moved the wrong scene. Both views now use the position throughout. This affects co-writing files that are each assigned a scene range.2. Navigator drag left scene card data behind.
SceneNavigator.reorderScenedidn't updatescene_cards[].scene_index. A scene dragged in the sidebar ended up showing its old slot's description, shoot notes and schedule. It now applies the same updateSceneCardsView.reorderScenealready does.Testing
svelte-check: 0 errors, 0 warnings; eslint and prettier are clean.🤖 Generated with Claude Code