Skip to content

CommitRow Re-renders for Every Selection Change #69

Description

@abhinavgautam01

Location: plugins/git/src/client/components/views/log-panel-view.tsx

The Git dashboard renders commit history as an unvirtualized list. CommitRow is currently a plain function component, so every LogPanelView render re-runs every visible row. Selecting a commit changes selectedHash, which only affects the previous and next selected rows, but the whole list still re-renders.

This becomes more expensive as infinite-scroll pages accumulate into the commits array. Each row also renders graph-related UI, so avoiding unnecessary row renders improves interaction responsiveness.

The existing props are mostly suitable for memoization: computeGraph(commits) is memoized, commit objects are stable across selection-only changes and the dashboard passes React's stable setSelectedCommit as the selection callback.

Recommended fix: Wrap CommitRow with React.memo. Keep the row selection callback stable and avoid creating new per-row object or function props that would defeat memoization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions