Skip to content

Document inline drag-and-drop sorting for lists and relations#260

Merged
LukeTowers merged 2 commits into
developfrom
wip/inline-list-reordering
Jun 19, 2026
Merged

Document inline drag-and-drop sorting for lists and relations#260
LukeTowers merged 2 commits into
developfrom
wip/inline-list-reordering

Conversation

@LukeTowers

@LukeTowers LukeTowers commented Jun 19, 2026

Copy link
Copy Markdown
Member

Documents the inline list & relation reordering feature.

Companion PRs: wintercms/winter#1491 (backend implementation) and wintercms/storm#235 (HasSortableRelations trait). Tracking issue: wintercms/winter#1472.

Changes

  • database/traits.md — completes the HasSortableRelations section, which was previously an incomplete stub with an unclosed code fence and no method docs. Now covers $sortableRelations, the required pivot column, the automatic pivot/order injection, auto-append on attach, and the setRelationOrder() / isSortableRelation() methods.
  • backend/lists.md — adds the sortable list option to the options table and a Reordering records section.
  • backend/relations.md — adds the view-only sortable option and a Reordering relations section (including reordering on a not-yet-saved parent via deferred binding).
  • backend/reorder.md — adds a note pointing to the new inline alternatives to the standalone Reorder page.

Cross-links between the three backend pages and the trait section use existing anchors (#sortable, #hassortablerelations, #reordering-records, #reordering-relations).

Should be merged alongside wintercms/winter#1491.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added documentation for drag-and-drop reordering in lists and relation managers with new configuration options.
    • Enhanced implementation guides with detailed usage examples and prerequisites for sortable records and relations.
    • Clarified inline reordering capabilities in management interfaces alongside dedicated reorder pages.

Documents the inline reordering feature added in wintercms/winter#1491
(issue wintercms/winter#1472):

- database/traits.md: complete the HasSortableRelations section (it was an
  unclosed, incomplete stub) — usage, pivot setup, automatic ordering,
  setRelationOrder() and isSortableRelation()
- backend/lists.md: add the `sortable` list option and a "Reordering
  records" section
- backend/relations.md: add the view-only `sortable` option and a
  "Reordering relations" section (incl. deferred/unsaved parent support)
- backend/reorder.md: note the inline alternatives to the standalone
  Reorder page

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

- Make clear the sort order column must be created by the user (migration);
  the trait adds it to the relation's pivot data and applies the order clause,
  it does not create the database column.
- Fix the setRelationOrder parameter description ("third argument", not
  "second") and use distinct record ids in the explicit-orders example so the
  ids and sort order values aren't visually conflated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LukeTowers added a commit to wintercms/storm that referenced this pull request Jun 19, 2026
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Related: wintercms/winter#1491, wintercms/docs#260, wintercms/winter#1472
@LukeTowers LukeTowers merged commit 8dc3976 into develop Jun 19, 2026
2 checks passed
@LukeTowers LukeTowers deleted the wip/inline-list-reordering branch June 19, 2026 05:57
LukeTowers added a commit that referenced this pull request Jun 19, 2026
…defaultSort

Follow-up to #260: the inline `sortable` option for lists and relations now
raises a configuration error when combined with searching, filtering,
pagination, or a custom `defaultSort`, since drag-reordering requires the whole
list to be shown in a single fixed order. See wintercms/winter#1491.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LukeTowers added a commit to wintercms/winter that referenced this pull request Jun 19, 2026
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Closes: #1472
Related: wintercms/storm#235, wintercms/docs#260
bennothommo pushed a commit to wintercms/wn-backend-module that referenced this pull request Jun 19, 2026
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Closes: wintercms/winter#1472
Related: wintercms/storm#235, wintercms/docs#260
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