feat(viewer): sort the board sidebar by Name · Created · Updated#176
Merged
Conversation
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.
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.
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:
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
Payloadgains a stablecreatedAt.Store.setresolves 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 —asPayloadnever reads it from the request body.updatebroadcasts now send the stored payload, so both timestamps reach the client on every event;createdAtis also added toGET /list.sortBoardsis a pure, DOM-free helper instate.ts(name asc / created desc / updated desc, stable name tie-break), unit-tested directly./w/demo/.Verification
npx vitest run→ 432/432 pass (incl. newStore.createdAt+sortBoardscases).npm run buildexit 0.board-sort.e2e.mjs(chained into the e2e CI script) → 12/12: order per mode, the "latest" tag, and persistence across reload. Existingrich.e2e.mjs→ 57/57 (no regression from theStore.setreturn / broadcast change)./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.tschange re-seeds on a fresh container at deploy.