Skip to content

perf(client): reduce unnecessary re-renders and code-split GraphView#2

Merged
Postmodum37 merged 12 commits intomainfrom
feat/update-performance
Feb 28, 2026
Merged

perf(client): reduce unnecessary re-renders and code-split GraphView#2
Postmodum37 merged 12 commits intomainfrom
feat/update-performance

Conversation

@Postmodum37
Copy link
Copy Markdown
Owner

Summary

  • Split monolithic AppContext into 3 granular contexts (PollDataContext, SessionDetailContext, UIStateContext) so components only re-render when their slice of state changes
  • Stabilize GraphView by memoizing edge/node objects across polls, code-splitting the component, and fixing fetch race conditions with AbortController
  • Fix session detail re-fetching every poll cycle and memoize SessionList filtering

Changes

Performance

  • Stabilize GraphView edge/node objects to prevent layout thrash on poll updates
  • Memoize SessionList filtering and wrap in React.memo()
  • Code-split GraphView and vendor chunks via Vite manual chunks
  • Stop session detail from re-fetching on every 2s poll

Refactoring

  • Split AppContext (217 → 3 focused contexts) for granular render isolation
  • Migrate all sidebar widgets to granular hooks (usePollData, useUIState, useSessionDetail)

Bug Fixes

  • Add AbortController to fetch effects preventing stale response races
  • Increase diagram card width to 320px for readability

Tests

  • Context isolation tests (verify one context update doesn't trigger others)
  • Edge stability tests (241 lines — verify memoization across polls)
  • Playwright E2E for card sizing and build output
  • Update collide tests for new 320px default width

Postmodum37 and others added 12 commits February 28, 2026 22:33
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…r contexts

Add AbortController to both fetch effects in SessionDetailContext to
prevent stale responses from concurrent requests. Remove sessionDetail
dep from effect array to eliminate redundant fetch on each session
selection. Migrate all sidebar widgets (ScopeSnapshot, ActiveAgents,
SidebarPlanProgress, SystemHealth) from useAppContext to granular hooks
(usePollData, useUIState, useSessionDetail) for proper render isolation.
@Postmodum37 Postmodum37 merged commit 1c756f2 into main Feb 28, 2026
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