Skip to content

fix(pat-contentbrowser): preserve dragged selection order - #1670

Open
MrTango wants to merge 1 commit into
masterfrom
pr/contentbrowser-sort-order
Open

MrTango wants to merge 1 commit into
masterfrom
pr/contentbrowser-sort-order

Conversation

@MrTango

@MrTango MrTango commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep dragged selections in order when items are added or removed. Reuse one Sortable instance.

 onDrop
-  update the DOM and input only
+  restore Svelte's DOM order
+  reorder selectedItems and selectedUids

Evidence

  • Before (code path): Dragging leaves the selection store in its original order, which the next add/remove restores.
    After: The store owns the dragged order.
  • pnpm test --runInBand: 59 suites passed; 512 tests passed, 15 skipped.
  • pnpm build:webpack: passed with size/performance warnings.
  • No dedicated drag-order regression test or browser verification in this pass.

Merge Danger

Door: two-way

Blast Radius: contentbrowser

Changes multi-selection drag ordering; single-selection sorting remains disabled.

Assisted-by: GPT 6.1 Sol

… removed

Dragging a selected item only moved its node and wrote the new order to
the input; the selectedItems store kept the old one. The next add or
remove wrote the store's order back, so the reorder was lost while the
list still showed it.

Put the dragged node back and reorder the store instead, and let Svelte
move it. Create the Sortable instance once instead of on every change.
@MrTango
MrTango marked this pull request as ready for review November 13, 2026 08:08
@MrTango
MrTango requested a review from petschki November 13, 2026 08:08

This branch has not been deployed

No deployments
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