feat: Board List Reorder#328
Merged
Merged
Conversation
Mirror the server drag-reorder pattern for the board list: persist board order in ~/.rk/settings.yaml, add POST /api/boards/order with rank-aware sort, broadcast a server-global board-order SSE event, and wire drag reordering into the sidebar BoardsSection and Cockpit BOARDS zone.
There was a problem hiding this comment.
Pull request overview
Implements user-controlled board list ordering (instead of hard alphabetical sorting) by persisting a host-global board order in ~/.rk/settings.yaml, exposing a new POST /api/boards/order endpoint, broadcasting a server-global board-order SSE event, and wiring shared drag + command-palette reorder paths across the main board list surfaces.
Changes:
- Backend: add
BoardOrderpersistence in settings, apply rank-aware sorting toGET /api/boards, and addPOST /api/boards/orderplus server-globalboard-orderSSE broadcast + replay-on-connect. - Frontend: add
setBoardOrder, subscribe toboard-ordervia SessionProvider, and introduce shareduseBoardListReorderhook wired into sidebar BoardsSection + Cockpit BOARDS zone, plus palette “Board: Move up/down”. - Tests/docs: add Go unit/integration tests, Vitest coverage for the hook/client/palette wiring, and Playwright e2e coverage for endpoint+sort+SSE fanout, plus memory docs updates.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| fab/changes/260708-a2qd-board-list-reorder/plan.md | Generated implementation plan and acceptance criteria for board reorder feature. |
| fab/changes/260708-a2qd-board-list-reorder/intake.md | Feature intake/requirements and design decisions for board list reorder. |
| fab/changes/260708-a2qd-board-list-reorder/.status.yaml | Change status/metrics metadata for the fab pipeline. |
| fab/changes/260708-a2qd-board-list-reorder/.history.jsonl | Pipeline stage transition history for the change. |
| docs/memory/run-kit/ui-patterns.md | Documents new UI pattern: board-list drag reorder + palette move actions + e2e filesystem snapshot/restore convention. |
| docs/memory/run-kit/index.md | Updates memory index summary to include new board-order architecture details. |
| docs/memory/run-kit/architecture.md | Documents /api/boards/order, board-order persistence/sorting, and server-global board-order SSE semantics. |
| app/backend/internal/settings/settings.go | Adds BoardOrder parse/serialize + accessors persisted to ~/.rk/settings.yaml. |
| app/backend/internal/settings/settings_test.go | Tests parsing/serialization/round-trip semantics for BoardOrder and coexistence with server colors. |
| app/backend/api/boards.go | Applies rank-aware board sorting and adds POST /api/boards/order handler with validation + SSE broadcast. |
| app/backend/api/router.go | Registers POST /api/boards/order. |
| app/backend/api/sse.go | Adds cached-slot + replay-on-connect + fanout for server-global board-order SSE event. |
| app/backend/api/sse_test.go | Tests board-order fanout to all clients + cached replay + nil normalization. |
| app/backend/api/boards_test.go | Tests sort helper, GET ordering integration, and POST validation/persist+broadcast behavior. |
| app/frontend/src/api/boards.ts | Adds setBoardOrder() client and updates BoardSummary docs to reflect display ordering. |
| app/frontend/src/api/boards.test.ts | Adds MSW tests validating setBoardOrder request/response and error propagation. |
| app/frontend/src/contexts/session-context.tsx | Adds subscribeBoardOrder seam and wires board-order listeners on pool + metrics streams. |
| app/frontend/src/hooks/use-boards.ts | Subscribes to server-global board-order to trigger debounced refetch. |
| app/frontend/src/hooks/use-board-list-reorder.ts | New shared drag-reorder hook for board lists (sidebar + cockpit) with debounce/flush + optimistic override. |
| app/frontend/src/hooks/use-board-list-reorder.test.ts | Vitest coverage for MIME discrimination, splice behavior, reconcile lifecycle, debounce/flush, and self-target acceptance. |
| app/frontend/src/components/sidebar/boards-section.tsx | Wires useBoardListReorder into the sidebar BoardsSection and renders orderedBoards. |
| app/frontend/src/components/sidebar/boards-section.test.tsx | Ensures board rows are draggable and wiring behaves as expected. |
| app/frontend/src/components/server-list-page.tsx | Wires useBoardListReorder into Cockpit BOARDS zone tiles and renders orderedBoards. |
| app/frontend/src/components/server-list-page.test.tsx | Ensures Cockpit board tiles are draggable (wiring test). |
| app/frontend/src/components/board/board-page.tsx | Adds palette “Board: Move up/down” actions using computeMoveOrder + setBoardOrder. |
| app/frontend/src/lib/palette-move.test.ts | Extends coverage for board move semantics via computeMoveOrder. |
| app/frontend/tests/e2e/board-list-reorder.spec.ts | Playwright e2e for endpoint persistence, rank-aware sort, and server-global SSE broadcast; snapshots/restores settings. |
| app/frontend/tests/e2e/board-list-reorder.spec.md | Companion doc describing what the e2e validates and why it avoids synthetic drag simulation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meta
a2qdexcludes
fab/,docs/· generated by fab-kit v2.13.5Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Summary
The board list is hard-sorted alphabetically everywhere (sidebar BoardsSection, Cockpit BOARDS zone, top-bar BoardSwitcher), so users can't surface the boards they use most without renaming them. This mirrors the existing server drag-reorder pattern to let users manually reorder boards, persisting order in
~/.rk/settings.yamlsince a board is an emergent cross-server aggregate with no single tmux object to carry a rank.Changes
~/.rk/settings.yaml(internal/settings)POST /api/boards/order+ rank-aware board sort (api/boards.go)event: board-orderSSE broadcast (api/sse.go)useBoards(hooks/use-boards.ts,api/boards.ts,contexts/session-context.tsx)lib/palette-move.ts+ palette wiring)