perf: Tier 1 dashboard rendering optimizations - #88
Merged
Conversation
aterrylu
enabled auto-merge (squash)
March 27, 2026 17:44
Eliminate 70+ unnecessary React re-renders/sec from JS spinners, polling writes, subscription fan-out, and unbatched ResizeObserver notifications. Six fixes: 1. CSS @Keyframes spinner replaces setInterval(100ms) state updates 2. fetchNotifications equality guard skips set() when data unchanged 3. useShallow splits Sidebar into data selectors + stable action refs 4. fetchSessions equality guard compares id/name/status/claudeSessionId 5. rAF debounce batches notifySlotUpdate per frame 6. React.memo on GroupContainer prevents parent-triggered re-renders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aterrylu
force-pushed
the
terry/perf-tier1
branch
from
March 27, 2026 17:45
880e56a to
7529fc5
Compare
4 tasks
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.
Summary
setInterval(100ms)+ React state → zero JS re-renders during animationfetchSessionsandfetchNotificationsskipset()when data unchanged, preventing subscriber re-renders on every 3s/5s polluseShallowconsolidates 18 separate Zustand subscriptions in Sidebar into 2 focused selectors (data + actions)notifySlotUpdatefrom ResizeObserver, coalescing multiple callbacks per frameReact.memoonGroupContainerprevents unnecessary re-renders from parent state changesProblem
Dashboard was sluggish when clicking UI elements — React DevTools profiler showed 70+ unnecessary re-renders/sec from:
Changes
@keyframesspinneragent-status-icon.tsxfetchNotificationsequality guardstore.tsuseShallowselector splitSidebar.tsxfetchSessionsequality guardstore.tsnotifySlotUpdateSessionMountLayer.tsxReact.memoGroupContainerSidebar.tsxTest plan
npm run build)/polish— code-reviewer, code-simplifier, silent-failure-hunter all run🤖 Generated with Claude Code