perf: memoize dashboard streams table and activity list to prevent unnecessary re-renders - #1361
Merged
K1NGD4VID merged 2 commits intoAug 30, 2026
Merged
Conversation
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
renderStreamsandrenderRecentActivityindashboard-view.tsxwere plain functions invoked on every render ofDashboardView. Any state change anywhere in this large component (e.g. typing into the template-name input) re-executed the full streams-table and activity-list JSX construction, causing unnecessary re-renders of heavy list components.Solution
Extracted both render functions into standalone memoized components and stabilized their callback props with
useCallback:StreamsTable— Wrapped withReact.memo, receivessnapshot,onTopUp,onCancel,onShowDetailsRecentActivityList— Wrapped withReact.memo, receivessnapshot,onCreateStreamuseCallbackhooks forhandleTopUp,handleCancel,handleShowDetails, andhandleShowWizardto prevent child re-renders from callback identity changesChanges
frontend/src/components/dashboard/dashboard-view.tsxrenderStreams(lines 369-451) →StreamsTablecomponent withReact.memorenderRecentActivity(lines 453-504) →RecentActivityListcomponent withReact.memouseCallbackhooks for 4 callback props inDashboardViewImpact
templateNameInput,editingTemplateId,selectedTemplateId)snapshotand callbacks remain stableTesting
All existing tests pass (286/286 across 32 test files). Lint and typecheck clean.
Closes #1243