Closed berhalak closed 1 week ago
Deployed commit e98cb810d692f1f78f4aa9333a3ce720630576b7
as https://grist-gristlabs-grist-core-sorting-columns-new-record-card.fly.dev (until 2024-11-08T09:36:50.673Z)
Deployed commit 1315cc366fa634f750292aeaa4c5ffe470017705
as https://grist-gristlabs-grist-core-sorting-columns-new-record-card.fly.dev (until 2024-11-14T09:27:05.867Z)
Deployed commit 3718883bc95f3fffc00369473a4da4170e342bab
as https://grist-gristlabs-grist-core-sorting-columns-new-record-card.fly.dev (until 2024-11-14T11:05:35.319Z)
Deployed commit 9b27e3fd2bde855e3f601087e81c0d21c6173e88
as https://grist-gristlabs-grist-core-sorting-columns-new-record-card.fly.dev (until 2024-11-14T11:25:15.890Z)
Context
This PR improves the user experience by ensuring that columns are sorted logically and consistently, wherever the order was not chosen by the user. Currently columns are ordered in the order they were created.
Proposed solution
New method called
labelsOrder
that can sort object with labels. The function follow logical order, first normal labels, then those starting with_
or#
(that usually are used for private columns).Order is changed only in drop-downs/menus that weren't sorted by the user and where the default order (by row id) was used. For example:
add filter
andadd sort
menusUnrelated issue:
Record card was refusing to show itself for a new row when asked to, without any particular good reason. Grid view already doesn't issue this commend so it won't show on the new row, but custom widgets can leverage this record card to add a new row. So from now on the view is responsible for deciding if it will show this card or not, not the card itself.
Has this been tested?