Skip to content

feat(viewer): sort the board sidebar by Name · Created · Updated#176

Merged
ivanmkc merged 1 commit into
masterfrom
feat/board-sort-recency
Jun 11, 2026
Merged

feat(viewer): sort the board sidebar by Name · Created · Updated#176
ivanmkc merged 1 commit into
masterfrom
feat/board-sort-recency

Conversation

@ivanmkc

@ivanmkc ivanmkc commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Problem

When several agents push to several boards, there's no way to tell which board changed most recently — the sidebar lists boards in fixed alphabetical order.

What this adds

A 3-way sort toggle above the board list:

  • Name — A→Z (the previous default)
  • Created — newest first
  • Updated — newest first

The choice is persisted in localStorage (default Name, so existing users see no change until they switch). Each board row shows a muted "Xm ago" for the active key, refreshed in place every 60s; in Created/Updated modes the single most-recent board wears a "latest" tag.

Data plumbing

  • Payload gains a stable createdAt. Store.set resolves it once (incoming ?? existing ?? ts) and returns the canonical stored payload, so created-time is set at first push, preserved across every later update, and survives reloads via persistence. Pushers can't forge it — asPayload never reads it from the request body.
  • The four update broadcasts now send the stored payload, so both timestamps reach the client on every event; createdAt is also added to GET /list.
  • sortBoards is a pure, DOM-free helper in state.ts (name asc / created desc / updated desc, stable name tie-break), unit-tested directly.
  • The demo seed staggers each board's created/updated time so the toggle is demonstrable on /w/demo/.

Verification

  • Unit: npx vitest run432/432 pass (incl. new Store.createdAt + sortBoards cases).
  • Build: npm run build exit 0.
  • e2e: new board-sort.e2e.mjs (chained into the e2e CI script) → 12/12: order per mode, the "latest" tag, and persistence across reload. Existing rich.e2e.mjs57/57 (no regression from the Store.set return / broadcast change).
  • Visual: screenshotted /w/demo/ (12 staggered boards) in all three modes at desktop — Name = alphabetical (no tag), Created/Updated = newest-first with the "latest" tag and per-row "Xm ago".

Viewer-only; no plugin/CLI bump (no recipe/skill change). The seed.ts change re-seeds on a fresh container at deploy.

Name mode Updated mode
alphabetical, no tag newest-first, "latest" tag + per-row "Xm ago"

When several agents push to several boards, there was no way to tell which board
changed most recently — the sidebar listed boards in fixed alphabetical order.

Add a 3-way sort toggle above the board list:
- Name (A→Z, the previous default)
- Created (newest first)
- Updated (newest first)

The choice is persisted in localStorage (default Name, so existing users see no
change until they switch). Each row shows a muted "Xm ago" for the active key,
refreshed in place every 60s; in Created/Updated modes the most-recent board
wears a "latest" tag.

Data:
- Payload gains a stable `createdAt`. Store.set resolves it once
  (incoming ?? existing ?? ts) and returns the canonical stored payload, so
  created_at is set at first push and preserved across every later update, and
  survives reloads via persistence. Pushers can't forge it (asPayload never
  reads it from the request body).
- The four `update` broadcasts now send the stored payload, so both timestamps
  reach the client on every event; `createdAt` is also added to GET /list.
- `sortBoards` is a pure, DOM-free helper in state.ts (name asc / created desc /
  updated desc, stable name tie-break), unit-tested directly.
- The demo seed staggers each board's created/updated time so the toggle is
  demonstrable on /w/demo/.

Tests: state.test.ts covers the createdAt semantics + sortBoards; a new
board-sort.e2e.mjs drives the toggle in a browser (order per mode, the "latest"
tag, and persistence across reload) and is chained into the e2e CI script.
@ivanmkc ivanmkc merged commit b3d8997 into master Jun 11, 2026
5 checks passed
@ivanmkc ivanmkc deleted the feat/board-sort-recency branch June 11, 2026 03:53
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.

2 participants