grist-core
grist-core copied to clipboard
Sorting columns new record card
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:
- Hidden column list
- Columns mapping in widgets
- Columns in
add filter
andadd sort
menus
Unrelated 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?
- [x] 👍 yes, I added tests to the test suite
- [ ] 💭 no, because this PR is a draft and still needs work
- [ ] 🙅 no, because this is not relevant here
- [ ] 🙋 no, because I need help