Skip to content

Track B: speed foundation — client store, /sync with ETag, optimistic edits, side panel - #8

Merged
erikgoins merged 2 commits into
mainfrom
feature/speed
Nov 10, 2026
Merged

erikgoins merged 2 commits into
mainfrom
feature/speed

Conversation

@erikgoins

Copy link
Copy Markdown
Contributor

Roadmap Track B (decisions 026, 027; new decision 033 amends 026).

What

  • GET /api/v1/workspaces/:id/sync: the viewer's filtered snapshot with a strong ETag over its exact bytes; 304 on match. Cache-Control: private, no-cache, Vary: Cookie.
  • Client store (apps/web/src/lib/board-store.ts): views read it; view switches use history.replaceState (no server render); polls every 5 s while visible and on focus; pending edits layer over each snapshot; a poll that started before an edit finished is discarded; undo stack.
  • Optimistic edits in the new side panel and in kanban drags: shown at once, rolled back with a notice on refusal.
  • Side panel: a click opens the task from the store with no page load; hover prefetches the body; modified click still opens the full page. New tasks open in the panel.
  • Decision 033: snapshot ETag instead of a change table. A hidden-item change leaves Read Only's bytes and ETag unchanged, so polling leaks nothing. IndexedDB deferred (an override point on Q4).

Measured (2,000 tasks, local Chromium)

List 23 ms, board 53 ms, timeline 60 ms per switch, no request. The roadmap's 16 ms target needs virtualized rows (follow-up, B6). The CI budget is 400 ms.

Tested

  • Locally: pnpm lint, pnpm typecheck, pnpm test (376 passed), pnpm test:e2e (11 passed), pnpm smoke: all pass.
  • Leak test (both drivers): edits to a hidden issue, an unlinked repo's issue, and a draft → Read Only 304, Member 200. Proven red by hashing all cached issues.
  • Read Only exit check extended to /sync and the side panel.
  • speed.spec.ts: first poll 304; no request on view switch; panel without page load; optimistic edit before a stubbed 502, then rollback; stubbed success kept.

apps/web/e2e/outbox.ts carries the same change as #7, so the two merge cleanly. STATE.md and INDEX.md will need a small conflict fix after #5–#7.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7sHybpLbFAyRXzPFkfWun

…its, side panel

- GET /workspaces/:id/sync: the viewer's filtered snapshot with a strong ETag
  over its exact bytes; 304 on match; private, no-cache, Vary: Cookie.
- BoardStore: pending edits layered over each snapshot, stale polls discarded,
  5 s polling while visible, undo stack. Views read the store; view switches
  use history.replaceState, no server render.
- Side panel opens tasks from the store; fields edit in place, optimistically.
- Decision 033 amends 026: snapshot ETag instead of a change table; no IndexedDB yet.
- Tests: sync leak test (proven red), store and field-value units, speed E2E on
  2,000 tasks (no request on view switch; 23-60 ms), Read Only exit check on /sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHybpLbFAyRXzPFkfWun
Signed-off-by: Erik Goins <erikgoins@gmail.com>
Signed-off-by: Erik Goins <erikgoins@gmail.com>

# Conflicts:
#	docs/INDEX.md
#	docs/STATE.md
#	packages/server/src/index.ts
@erikgoins
erikgoins merged commit 2cf38a6 into main Nov 10, 2026
3 checks passed
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