Skip to content

Add a commit details panel#42

Merged
cpojer merged 1 commit into
nkzw-tech:mainfrom
gumadeiras:codex/commit-details-panel
Jun 3, 2026
Merged

Add a commit details panel#42
cpojer merged 1 commit into
nkzw-tech:mainfrom
gumadeiras:codex/commit-details-panel

Conversation

@gumadeiras

@gumadeiras gumadeiras commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a commit details panel for commit reviews from the History tab.

The panel only appears when viewing a committed change. It does not show for local uncommitted changes.

The panel shows the commit message, author, committer, refs, parents, signature, trailers, file stats, and the files changed in the commit.

Changed files in the panel are clickable, so you can jump straight to that file in the diff. Reloading keeps the restored scroll position instant, while clicking a file scrolls smoothly to it (can change it to instant if you prefer).

image

I added the commit details panel as a fake item in the diff list. This keeps the diff view simple; the panel scrolls with the files, reloads restore the right position, and clicking a file can use the same navigation path as the rest of the diff.

Validation

  • vp check --fix
  • vp build
  • vp test src/__tests__/App-render.test.tsx

Copilot AI review requested due to automatic review settings June 2, 2026 21:26

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds first-class commit metadata support and an inline “commit details” panel that renders as part of the diff scroller, along with a small refactor for copy-to-clipboard UI state.

Changes:

  • Add CommitMetadata types, wire commit metadata into repository state, and implement git-side metadata extraction in Electron.
  • Render a commit details panel as a CodeView item (with dedicated styling) and enable smooth/instant scroll targeting behaviors.
  • Extract repeated “copied” timer logic into a reusable useCopiedState hook and adopt it in multiple components.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types.ts Introduces commit metadata types and adds commitMetadata to RepositoryState.
src/lib/app-types.ts Adds scroll target/behavior types and a new commit-details annotation metadata variant.
electron/git-state/commit.cjs Plumbs commit metadata loading into commit-state reads.
electron/git-state/commit-metadata.cjs New module to read/parse commit metadata (refs, trailers, numstat, signature, etc.).
src/app/components/ReviewCodeView.tsx Adds commit details CodeView item, scroll behavior support, and wiring to render the panel.
src/app/components/CommitDetails.tsx New UI component to display commit details and file list navigation.
src/lib/code-view-options.ts Adds CSS overrides to hide file UI around the commit details item.
src/app/components/useCopiedState.ts New reusable hook for “Copied” feedback state with timer cleanup.
src/app/components/Panels.tsx Refactors copy-comments button to use useCopiedState.
src/App.tsx Adds typed scroll target behavior and passes commit metadata into ReviewCodeView.
src/App.css Adds styles for the commit details panel and related UI.
src/tests/git-state.test.ts Adds tests for commit metadata extraction (root commits, trailers, renames, tab paths).
src/tests/ReviewCodeView-scroll.test.tsx Adds test coverage for commit-details file row navigation and scroll behavior.
src/tests/App-render.test.tsx Adds render/copy/signature formatting coverage for the commit details panel.

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

Comment on lines +775 to +786
// Build an id from commit details that can change the panel height. When the panel first appears,
// we change only layoutPass to make CodeView measure again; this id still means "same content."
const getCommitDetailsContentKey = (metadata: CommitMetadata) =>
[
metadata.ref,
metadata.refs.join('\u0000'),
metadata.stats.files,
metadata.stats.additions,
metadata.stats.deletions,
metadata.stats.renamedFiles,
metadata.stats.binaryFiles,
].join('\u0001');
Comment thread src/app/components/CommitDetails.tsx Outdated
@gumadeiras gumadeiras force-pushed the codex/commit-details-panel branch from a17e695 to 93c3d2b Compare June 2, 2026 21:31
Show commit details for history reviews, including metadata, signature state, trailers, stats, and changed files. Let file rows jump to their diff target while preserving instant reload restoration.
@cpojer cpojer force-pushed the codex/commit-details-panel branch from 93c3d2b to 5f40792 Compare June 3, 2026 00:37
@cpojer cpojer merged commit d73bd82 into nkzw-tech:main Jun 3, 2026
@cpojer

cpojer commented Jun 3, 2026

Copy link
Copy Markdown
Member

Made a bunch of styling improvements and going to ship this as 1.0.0 now. Thank you for all your contributions!

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.

3 participants