Skip to content

Column reordering in DataViews #84376

Open

Description

@keoshi

What problem does this address?

DataViews can already reorder columns from each table header menu, but only one step at a time. Moving a column six places means opening six menus, while both the table and the controls shift under the pointer every time. Insert left/right helps place a hidden column, but it's still an indirect way of reordering: you have to work out which column to place it next to, and then which side.

The Properties panel (behind the cog) already lists every column, visible or hidden, as an item you can manipulate directly. Today it can only toggle visibility, and it has a couple of quirks of its own:

  • It lists fields in the order the consumer declared them, which stops describing the table the moment anybody moves a column.
  • Ticking a hidden column back on appends it to the end, so the arrangement you had is lost.
reorder-columns-before.mp4

What is your proposed solution?

Extend each item in the Properties panel beyond visibility, and let people reorder columns by dragging and dropping them. Columns would be listed in the same order as the table, and a hidden column would come back where it was when ticked on again.

reorder-columns-after.mp4

Column order is purely view state: it writes nothing to records, has no hierarchy, and isn't affected by filtering or pagination. It's also what people already expect from similar tools (Shopify, Wix, Notion…), which all let you reorder columns directly in the panel.

Prototype

Here's a demo on a plain posts list: https://dataviews-field-order.view.fast/

The panel is DataViews' own, unpatched. The only additions are a drag handle on each row of the Properties list and a hidden column keeping its place. A switch turns both off so you can compare with the panel as it ships today.

Specs

  • The special fields (title, description, and media/preview) can't be reordered, because they're combined into a single group in most layouts. They can still be shown and hidden, but they don't get drag handles or the keyboard interaction. This matches the existing constraint where, for example, a date can't be placed before the title.
  • The Properties list follows the table's order rather than the order the fields were declared in.
  • To restore a hidden column to its previous position, DataViews needs to remember the position of columns that aren't currently shown. view.fields only holds the visible columns, so hiding one throws its place away. This could be an order that includes hidden columns, or a remembered position per field. That's the main change in Core; the drag handle is the easy part.
  • Drag and drop needs a keyboard-accessible equivalent. The header menu's Move left/right options already cover this, but the panel should be operable from the keyboard too.

Prior art

Something similar existed before and was removed in #73064 to simplify the properties config, partly because of confusion around the special fields. This proposal keeps those fields fixed in place, which should avoid that problem while bringing back a more direct way to reorder.

Happy to open a PR if the direction looks right. Here's the repo I'm using in case it's helpful: https://github.com/keoshi/dataviews-field-order

Would love thoughts from anyone who has worked on DataViews. Thanks in advance!

Activity

  1. added
    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Package] DataViews/packages/dataviews[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions