Skip to content

Collections: Add drag-and-drop row ordering#192

Merged
priethor merged 14 commits into
mainfrom
priethor/add/rows-bulk-reorder-v2
May 18, 2026
Merged

Collections: Add drag-and-drop row ordering#192
priethor merged 14 commits into
mainfrom
priethor/add/rows-bulk-reorder-v2

Conversation

@priethor
Copy link
Copy Markdown
Collaborator

@priethor priethor commented May 14, 2026

What

Adds drag-and-drop ordering to collection rows. The saved order works in full-screen collections and embedded data-view blocks, and it survives reloads. If the view is sorted by a field, dragging a row prompts confirmation before clearing the sort and keeping the dropped order.

Why

Some collections need a hand-picked order. This gives users that without making them add a throwaway sort field.

How

  • Saving the order in menu_order.
  • Seeding a collection’s first manual order from the order the user is looking at.
  • Giving new rows the next available order value, so they append.
  • Treating manual order as the default row order in REST and client query planning.
  • Adding a DataViews row-drag adapter until DataViews has a native row reorder API.

Testing Instructions

  1. Open a collection with at least three rows in table view.
  2. Sort by a field, drag a row, click “Keep this order,” and confirm the sort clears.
  3. Reload the page and confirm the dropped order is still there.
  4. Add a new row and confirm it appears at the end.
  5. In an embedded data-view block, drag a row while sorted, cancel the confirmation, and confirm the sorted order stays put.

Screen recording

Grabacion.de.pantalla.2026-05-18.a.las.15.10.32.mov

priethor added 3 commits May 14, 2026 22:04
…k-reorder-v2

# Conflicts:
#	docs/tech-debt.md
#	includes/Rest/RowsController.php
#	src/components/CollectionDataViews.js
#	tests/js/components/fields/ColumnHeaderActions.test.js
…k-reorder-v2

# Conflicts:
#	docs/tech-debt.md
#	tests/e2e/specs/data-view-block.spec.js
@priethor priethor marked this pull request as ready for review May 15, 2026 10:12
@priethor priethor marked this pull request as draft May 15, 2026 12:38
@priethor priethor marked this pull request as ready for review May 15, 2026 14:39
@priethor priethor force-pushed the priethor/add/rows-bulk-reorder-v2 branch from 7dafab1 to 8bca3e6 Compare May 18, 2026 10:58
@priethor priethor merged commit 05c183e into main May 18, 2026
11 checks passed
@priethor priethor deleted the priethor/add/rows-bulk-reorder-v2 branch May 18, 2026 13:12
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