Skip to content

fix(scenes): drag-reorder with scene_number_start != 1, keep cards with moved scenes - #287

Merged
stultus merged 2 commits into
mainfrom
fix/scene-drag-reorder
Oct 28, 2026
Merged

stultus merged 2 commits into
mainfrom
fix/scene-drag-reorder

Conversation

@stultus

@stultus stultus commented Oct 25, 2026

Copy link
Copy Markdown
Owner

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 and reorderScene count 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.reorderScene didn't update scene_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 update SceneCardsView.reorderScene already does.

Testing

  • svelte-check: 0 errors, 0 warnings; eslint and prettier are clean.
  • Not tested by hand in the app yet. Suggested check:
    1. Set Scene numbering starts at to 41.
    2. Add descriptions to a few scene cards.
    3. Drag a scene in the sidebar and in the cards view.
    4. Confirm the right scene moves and its description moves with it.

🤖 Generated with Claude Code

stultus and others added 2 commits October 26, 2026 04:07
…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>
@stultus
stultus merged commit 8f28325 into main Oct 28, 2026
9 checks passed
@stultus
stultus deleted the fix/scene-drag-reorder branch October 28, 2026 05:32
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