Files
wekan/docs/Features/Board-Header/Sort-Cards.md
T
Lauri Ojansivu a8fd080bc8 Docs mirror the Admin Panel and the menus: a page for every menu entry.
The docs tree is laid out like the menus - a menu path is a docs path.
Admin Panel / Settings follows the new structure: Visibility.md is
Appearance.md, with new Features.md, Feature-Profiles.md, Security.md,
Activities-and-Notifications.md and Delete.md; the section indexes,
Admin-Panel.md, Admin-Panel-URLs.md (with the moved-pane redirects) and
Validation.md follow the live menus, and Who-Sees-What.md explains in one
place which layer decides what is shown and what is allowed.

Pages are added for the menu entries that had none, each written from
the code: every Admin Panel / Problems pane, the member menu, the board
header, Board Settings, the All Boards left menu, and the list,
swimlane and card menus. Older links to the moved panes are updated
across docs/.

TODO.md records what documenting the menus found: Edit Profile does not
save a username for non-admins, the Support page's signed-out case is
unreachable, Create board from this card is hidden from members who can
edit the card, All Boards Settings is unreachable, and the Share template
targets live in browser storage.

Thanks to xet7 !
2026-11-19 01:22:22 +02:00

42 lines
1.8 KiB
Markdown

# Board header / Sort Cards
The control after [Watch](Watch.md) in a board's header controls (`fa-sort`).
Its label and tooltip are **Sort Cards**, or **Sort is on** while a sort is
chosen; the button is then emphasised and an **X** beside it (**Remove
sort**) turns sorting off. See [the header](../Header-Bar/Header.md) for its
place in the bar.
Any signed-in user can use it. It changes only how the cards are shown to you:
it is stored in your browser (the `sortBy` Session value, saved to
`localStorage` as `wekan-cards-sortBy` so it survives a reload), not on the
board, and no card's position is changed.
## The popup
`cardsSortPopup` in `client/components/boards/boardHeader.jade`. Choosing an
entry sorts the cards inside each list and closes the popup.
| Entry | Order |
| --- | --- |
| Due Date | Earliest due date first (`dueAt: 1`). |
| Title (Alphabetically) | Title A to Z (`title: 1`). |
| Created At (Newest First) | Newest card first (`createdAt: -1`). |
| Created At (Oldest First) | Oldest card first (`createdAt: 1`). |
| Sort by votes | Highest vote score (positive minus negative) first. |
| Label order | By the board's label order: a card goes where its first label in that order goes, cards without a label last. |
The first four are passed to the card cursor as a sort, with the card `_id`
as a tie-breaker. **Sort by votes** and **Label order** are display orders
computed in `cardsWithLimit()` (`client/components/lists/listBody.js`) with
`models/lib/voteSortCards.js` and `models/lib/labelOrder.js`; cards with an
equal rank keep their manual order. The board's label order is changed by a
board admin with Move up / Move down when editing a label.
**Remove sort** clears the stored value, and the cards return to their manual
(dragged) order.
## Related
- [Filter](../Board-Sidebar/Filter/README.md)
- [Search](Search.md)