Skip to content

feat(ui): the sidebar orders the stacks by name or by last opened (#377, ADR-0084) - #411

Merged
7schmiede merged 1 commit into
mainfrom
feat/sidebar-order
Nov 2, 2026
Merged

7schmiede merged 1 commit into
mainfrom
feat/sidebar-order

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Refs #377 (favourites and hiding stay open there).

A button (↕) beside the "Stacks" heading's + chooses the order of the stacks: by name (default) or last opened first. Last opened is a snapshot taken when the page loads or the choice is made: opening a stack moves nothing while the page is open, and a start or a stop never does. Choice and times live in this browser (devstack.sidebar.order, devstack.sidebar.opened), as the fold state does. ADR-0084 records it.

Review card

Approved by the owner in the conversation on 2026-11-02, points 1 to 5:

# Category Point Beats Reversing costs
1 concept The user chooses the order of the stacks in a menu beside +: by name (the default) or last opened first. Dragging, favourites, an order by state. Low: the menu goes, a stored choice is ignored.
2 concept The order does not change while the page is open: last opened is taken when the page loads or the choice is made. Re-sorting on every click. Low: UI code only.
3 concept There is no order by state: a start or a stop moves nothing (as since #374); the dot tells the state. Running first. One more entry in the menu.
4 contract The choice and when each stack was last opened live in the browser's localStorage, as the fold state does. A setting in the hub, per machine. Moving it to the hub later loses the values per browser.
5 concept The trees within a stack and "Shared with you" stay ordered by name. An order per section. Adding a choice per section.

Decided on my own: the icon (↕) and the English labels; a stack counts as opened whenever it is shown (sidebar, switcher, palette, link), not only on a sidebar click; removing a stack from the dashboard drops its time.

Tests

  • ui/src/lib/stackOrder.test.ts: the order, its storage.
  • ui/src/components/Sidebar.test.ts: choosing "last opened" reorders; opening a stack afterwards moves nothing.
  • npm run typecheck clean, vitest run 133 passed.

🤖 Generated with Claude Code

…, ADR-0084)

A menu beside the "Stacks" heading's + chooses the order: by name (the
default) or last opened first. Last opened is a snapshot taken when the
page loads or the choice is made, so opening a stack moves nothing while
the page is open; a start or a stop never does. The choice and the times
live in this browser, as the fold state does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 2efa9be into main Nov 2, 2026
@7schmiede
7schmiede deleted the feat/sidebar-order branch November 2, 2026 14:59
@7schmiede 7schmiede mentioned this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant