RFC 0068 — Columns the user picks: shown, hidden, in their order
Status: implemented (2026-11-28) · Target: 0.63.0 · builds on RFC 0012, RFC 0066 and RFC 0067 · see Decisions
Summary
A list of customers has twelve fields worth a column, and each user needs
five of them: sales wants the phone and the last order, accounting the
org number and the balance. Today the app picks the columns of Table,
once, for everyone; a user who wants another column asks for a release,
and a narrow window scrolls sideways through columns nobody reads. Every
desktop list (Finder, Outlook, a spreadsheet's hide) lets the user choose.
This RFC lets the user pick, and keeps what they picked:
<Table
rows={customers}
persist="customers"
columns={[
{ key: "name", required: true },
"email",
"phone",
{ key: "org_number", hidden: true },
{ key: "balance", align: "end", hidden: true, total: "sum" },
]}
choosable
/>
choosablegives the head a Columns button (and the header's context menu an item): a menu of checkboxes, one a column, to show or hide it, and a way back to the app's columns.- The order: in the same menu, each column moves up or down (by the keys too), or a header is dragged to its place.
hidden: truestarts a column hidden;required: truekeeps one shown (the name a row is known by).persistkeeps the choice with the widths, in the settings store, so the table opens as the user left it.- What's hidden is hidden everywhere: the search still finds it, but the export, the totals and print show the columns as the user sees them.
Motivation
- The user knows which columns matter to them, the app's author doesn't, and different users of one app want different ones.
- Width is scarce on a desktop window that shares the screen; hiding three columns is the difference between a list that fits and one that scrolls.
- The choice must last. A column hidden every morning again is a setting the app forgot.
- The export follows the screen (RFC 0066): "copy what I see" is what
a user means; the app's own
csv()with every column is one line away.
Current state (0.63, with RFCs 0066 and 0067)
columnsare the app's, in its order;resizablewithpersistkeeps the widths underelyra-ui.table.<persist>in the settings store.- The header's cells sort (a button) and resize (a grip); there's no menu on the head.
- The table's context menu (RFC 0066) is on its rows: copy and save.
Design
The menu
With choosable, the head's last cell (the actions' column, or one of its
own) holds a Columns button, a Dropdown of:
- a checkbox a column, by its label, in the table's order: checked when
shown; a
requiredcolumn's is checked and disabled; - for the focused item, Alt+↑ / Alt+↓ move the column (said: "Phone moved to 3 of 5"), as do up and down buttons on it for the pointer;
- Reset columns: the app's own columns, order and widths.
A right click on the head opens the same menu. Hiding the last column that isn't required is refused (the item is disabled): a table shows at least one.
Dragging a header
A header's label is dragged left or right to its place (the pointer only; the keys have the menu). The grip still resizes; a drag that starts on it isn't a move.
What's kept
persist keeps { widths, hidden, order } under the same key, as one
value: the widths as today (a key's old value, widths alone, is still read
as them), the hidden keys, and the order as keys. A column the app adds
later is shown (unless it's hidden) at its place in the app's order; a
key the app took away is forgotten.
Everywhere else
- Search goes on searching every column, hidden ones too: the user hid it from view, not from the search. (A hidden match is the row; the cell isn't shown.)
- Sort by a column that's hidden goes on; its header isn't there to
say so, so the table's
aria-descriptiondoes ("Sorted by balance"). - Export (RFC 0066) and totals (RFC 0067) are the shown columns,
in their order;
csv({ all: true })is every column, in the app's order, for an app that wants it. - Print and
Report: the shown columns. In aReportthe table is as the app set it (a report is a document, not a view). - The assistant sees the shown columns, as the user does.
Words
elyra.table.columns ("Columns"), resetColumns, moveUp, moveDown,
moved (":column moved to :at of :count"), sortedBy, in English and
Norwegian.
Testing
- Hide, show, a required column, the last one refused; order by the menu and its keys, and by a drag.
persist: kept, read back, the old widths-only value, a column added and one taken away.- Search over a hidden column; sort by one; export, totals and print as
shown;
csv({ all: true }). - A
Report's table as the app set it. - The menu's roles and the live region's words.
- A browser check in the docs: hide two columns, move one, reload.
Implementation plan
internal/columns.js: the shown columns from the app's and the user's choice, and the kept value, held by tests without a DOM.Table's Columns menu, the head's context menu, the drag;persist.- Export, totals, print and the assistant on the shown columns;
csv({ all: true }). - Docs (
docs/ui/table.md, an example), CHANGELOG;make:resource --viewlistschoosable.
Open questions
- On with
choosable, or always? Recommendation: withchoosable. A table of three columns in a dialog has nothing to choose, and the button is in its head. - Export: the shown columns, or every one?
Recommendation: the shown ones, as the user sees them;
csv({ all: true })for the app's own export. - Kept under the widths' key, or one of its own? Recommendation: the same key, one value: a table's look is one thing to keep, and one key per table is what the app names. The widths-only value of 0.62 is read as it was.
- Dragging headers in this RFC? Recommendation: yes, as well as the menu: it's how every desktop list reorders, and the menu covers the keyboard.
make:resource --viewlistschoosable? Recommendation: yes: a resource's list is the kind of wide list this is for, and it haspersistalready.
As built
internal/columns.js:arrange(the shown columns and all of them in the user's order),toggled,moved,canHideandkeptOf, plain functions. A column the user has seen keeps their choice; one they haven't takes the app'shidden, at its place after the app's column before it.- The Columns button is over the table, on the right (beside the search when there is one), not in the head's last cell: a cell of its own would add a column to every row, the colgroup and the foot, and the actions' cell is the rows'. A right click on the head opens it.
- The menu is a
Dropdownwith items of its own,menuitemcheckbox(which the dropdown's keys walk), that don't close it; Reset columns is aMenuItem, which does. Alt+↑/↓ on an item moves its column and keeps the focus on it; the arrows beside it are for the pointer (aria-hidden, out of the tab order). - A drag starts on a header (not its grip) and moves once the pointer has gone 6 px; the column goes to the place of the shown header it's over, as it moves. The click that ends it is swallowed, so a sortable header isn't sorted.
- Kept: with
choosable,{ widths, hidden, order }; without it, the widths alone as 0.62 kept them, so aresizabletable's value doesn't change shape.keptOfreads both. hiddenwithoutchoosableisn't shown either: the app's way to keep a column for the search andcsv({ all: true })only.- Totals of hidden columns are kept for
csv({ all: true }); the foot shows while a shown column has a total. - In a
Report(.elyra-paperaround the table) the user's choice isn't used, and there's no menu. - The assistant reads the window as it's drawn, so it has the shown columns without a change of its own.
- Checked in Chromium: the docs' example: two columns picked, one moved by Alt+↑ ("Org. no. moved to 2 of 5"), a header dragged to the end.
Decisions
- With
choosable, not always. - The export is the shown columns;
csv({ all: true })is every one. - Kept under the widths' key, as one value; 0.62's widths-only value is read as it was.
- Headers are dragged to reorder, as well as the menu.
make:resource --viewlistschoosable.
Not in this RFC
- Columns the app doesn't list (every field of the row, picked by the user).
- Saved views (named sets of columns, filters and sort).
- Pinning a column to the left while the rest scrolls.
Alternatives considered
- The app's own settings page for columns: every app builds it, and none of them is where the table is.
- Only the menu, no drag: works, but the pointer user reaches for the header first.
- A key of its own for the choice: a second name per table to keep apart, for no gain.