Reported by @viktor_s_r (macOS): "если упорядочить колонки, то после запуска терминала упорядоченный список сбивается и включается по умолчанию. Хотелось бы, чтобы сохранялся список в том порядке, который сделал юзер." He reported the same for Report in early September; no issue was filed then.
What happens
Every MoonDataTable column is draggable by default (MoonUI MoonDataTableColumn::new sets movable: true), so the user can reorder columns in every table. The new order lives only in MoonDataTableState::column_order and is persisted by just two panels:
- Orders:
panels/orders/persist.rs stores column_order in docks.json and restores it.
- Alerts:
panels/alerts/mod.rs, same approach.
Nothing else stores it, so after a restart these tables go back to their default order:
- Report (
report-table). Default order = the core's report schema order (visible_cols() filters self.cols). The Columns menu (Колонки) only toggles visibility, so the user has no other way to set the order.
- Screener (
screener-table)
- Assets
- Core status: main table, by-IP view, problems, warnings, updates list
This is not macOS-specific. Nothing about it depends on the platform.
It looks like a bug from the user's side: in the same tables, column widths, visible columns and sort already survive a restart through persistence/table_persist.rs (layout.toml, keyed by ctx_id with :dock/:win). Only the order is dropped.
Suggested direction
Add a column-order entry to table_persist next to widths / visible / sort (same ctx_id key, same compare-then-mark-dirty contract), and restore and persist it in the tables above. That gives every table one storage path instead of per-panel docks.json fields.
Things to keep:
- The Report schema comes from the core and can gain or lose columns. MoonUI's
ordered_columns already skips unknown saved keys and appends new columns at the end. Keep that behaviour and do not drop the saved order when the schema changes.
- Dock and detached window keep separate layouts, as widths do now.
- Orders/Alerts: either migrate their
docks.json order into the shared storage or leave them as they are. Existing users must not lose their saved order either way.
- A column switched back on through the Columns menu gets appended at the tail of a saved order. Alerts avoids this by clearing its drag order whenever the visible set changes (
panels/alerts/mod.rs, cols_changed), which throws away the user's arrangement. A shared solution should insert the column at its canonical position instead of wiping the order.
- Reset: the width-reset button (
⤢) resets only widths. Decide whether order needs its own reset.
Reported by @viktor_s_r (macOS): "если упорядочить колонки, то после запуска терминала упорядоченный список сбивается и включается по умолчанию. Хотелось бы, чтобы сохранялся список в том порядке, который сделал юзер." He reported the same for Report in early September; no issue was filed then.
What happens
Every
MoonDataTablecolumn is draggable by default (MoonUIMoonDataTableColumn::newsetsmovable: true), so the user can reorder columns in every table. The new order lives only inMoonDataTableState::column_orderand is persisted by just two panels:panels/orders/persist.rsstorescolumn_orderindocks.jsonand restores it.panels/alerts/mod.rs, same approach.Nothing else stores it, so after a restart these tables go back to their default order:
report-table). Default order = the core's report schema order (visible_cols()filtersself.cols). The Columns menu (Колонки) only toggles visibility, so the user has no other way to set the order.screener-table)This is not macOS-specific. Nothing about it depends on the platform.
It looks like a bug from the user's side: in the same tables, column widths, visible columns and sort already survive a restart through
persistence/table_persist.rs(layout.toml, keyed byctx_idwith:dock/:win). Only the order is dropped.Suggested direction
Add a column-order entry to
table_persistnext to widths / visible / sort (samectx_idkey, same compare-then-mark-dirty contract), and restore and persist it in the tables above. That gives every table one storage path instead of per-paneldocks.jsonfields.Things to keep:
ordered_columnsalready skips unknown saved keys and appends new columns at the end. Keep that behaviour and do not drop the saved order when the schema changes.docks.jsonorder into the shared storage or leave them as they are. Existing users must not lose their saved order either way.panels/alerts/mod.rs,cols_changed), which throws away the user's arrangement. A shared solution should insert the column at its canonical position instead of wiping the order.⤢) resets only widths. Decide whether order needs its own reset.