Saved views: dragging a column's width, applying Columns or pressing Reset deletes every saved view #503
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#503
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading how table settings are saved and runningclean_settingswith the snapshot's interpreter.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atstatic/js/app.js:2079-2101(saveWidth); the other locations have not moved.Saved views (#259) are stored under
viewsin the same per-table dictionary as the columns, page size, widths and shape. Every path throughtable_settingsexcept the shape switch replaces that dictionary with one that has noviewskey, so the person's saved views, including the one the table opens as, disappear without a word.core/tables.py:660-719,Table.clean_settings, which buildscleaned = {"columns": columns, "page_size": page_size, "widths": widths}(line 713) and carries onlyshapeacross;core/views_tables.py:23-38,table_settings, which stores that result in place of the old settings, and storesNoneon Reset;static/js/app.js:1846-1868,saveWidth, which posts every width drag and every arrow-key resize to the same view;templates/partials/table/columns.html:46-51, where Apply, the up and down buttons and Reset post;core/tables.py:459-461,is_customised, true as soon as a view exists, so Reset is offered then.clean_settings, whose result has noviews, andsave_settingsstores it. The Views menu is empty and the table no longer opens as the default. The same happens on Apply or a move in the Columns menu. Reset says "Back to the usual columns." and removes the views as well. Checked:CompaniesTable.clean_settings(QueryDict("width=name&px=300&order=name&show=name"), current)with one stored view returns only the keyscolumns,page_sizeandwidths.tests/test_saved_views.pyortests/test_tables.pystores a view and then saves columns.?saved=…),visibleshows the view's columns, so the Columns form andsaveWidth(which posts every shown header asshow) write the view's columns into the person's own columns. After one drag, the table shows the view's columns even with no view applied.clean_settings, carryviewsacross asshapeis (if isinstance(current.get("views"), list): cleaned["views"] = current["views"]). Make Reset clear only columns, page size and widths (keepingviewsandshape), as its message says. For the width drag, post onlywidthandpx, and haveclean_settingskeepcurrent["columns"]andcurrent["page_size"]when noorderarrives, so a drag under an applied view does not overwrite the person's columns.Related to #259 (closed), which added saved views beside the stored columns and widths without carrying them through these saves.
Done when
tests/test_saved_views.pyhas tests that a stored view survives a width POST, an Apply, amoveand a Reset tocore:table_settings, and that a width POST made while a view is applied leaves the storedcolumnsunchanged.