Skip to content

perf(plugin-git): memoize commit log rows#82

Merged
antfu merged 1 commit into
devframes:mainfrom
abhinavgautam01:perf/issue-69-memoize-commit-row
Jul 9, 2026
Merged

perf(plugin-git): memoize commit log rows#82
antfu merged 1 commit into
devframes:mainfrom
abhinavgautam01:perf/issue-69-memoize-commit-row

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

Fixes #69

Summary

Memoizes the Git dashboard commit row component so selection changes do not re-render every row in the accumulated commit list.

Changes

  • Wrap CommitRow with React memo.
  • Preserve the existing row props and behavior.
  • Keep selection handling stable through the existing onSelectCommit callback.

Why

LogPanelView renders the commit history as an unvirtualized list. When selectedHash changes, only the previously selected and newly selected rows need to update, but the unmemoized row component re-rendered every visible row.

Verification

  • ./node_modules/.bin/eslint --fix plugins/git/src/client/components/views/log-panel-view.tsx
  • ./node_modules/.bin/tsc -p plugins/git/tsconfig.json --noEmit
  • ./node_modules/.bin/vitest run plugins/git/test/git.test.ts
  • git diff --check

Copilot AI review requested due to automatic review settings July 9, 2026 05:55
@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit d15ce58
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a4f37e5264b09000845e195
😎 Deploy Preview https://deploy-preview-82--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the performance of the Git plugin’s log panel by memoizing the per-commit row component so that changing the selected commit doesn’t trigger re-renders for every row in the (unvirtualized) commit list.

Changes:

  • Wrap CommitRow with React memo to avoid unnecessary re-renders.
  • Keep existing prop shape and selection behavior by continuing to pass the stable onSelectCommit callback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@antfu antfu merged commit 44ead78 into devframes:main Jul 9, 2026
12 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.

CommitRow Re-renders for Every Selection Change

3 participants