perf: Fix UI responsiveness under rapid interaction and streaming #3
No reviewers
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/ui-responsiveness-wave1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
setInterval(0)hot loop, RAF-coalesce three MutationObservers, and coalesce four notify pollers into one shared store — fixes the main-thread stalls during streaming and rapid clicking/api/session/{id}/tasksendpoint replacing N per-task polling requests with oneDeferred
Testing
Wave 1 — quick wins: - Replace setInterval(0) hot loop with Zustand selector effect (P0) - RAF-coalesce three MutationObservers in AssistantThread (P1/P9) - Coalesce four notify pollers into one shared store (P2) - Add AbortSignal to Dashboard/ProjectDetail polls (P4 partial) Wave 2 — cancellation and memoisation: - Sweep AbortSignal through every api/store GET method (P4) - Cache per-message conversion in OcmanRuntimeProvider via WeakMap (P3) - Remove redundant cancelled flags where signals handle it Wave 3 — structural changes: - Add TanStack Query provider with sensible defaults - Migrate Dashboard sessions/projects, ProjectDetail, Stats tab, and Usage tab to TanStack Query hooks (P4/P5) - Add batch /api/session/{id}/tasks endpoint and migrate per-task polling loop to single request (P7) The session-detail LRU cache removal (step 8.4) is deferred — it is deeply integrated with the SSE-driven incremental update flow and warrants its own PR. The pending-prompt TTL cache (step 9) was already landed in commit9912577.