Skip to content

feat(ui): show history commit metadata in reviews - #1016

Merged
benvinegar merged 6 commits into
mainfrom
feat/commit-review-info
Sep 7, 2026
Merged

feat(ui): show history commit metadata in reviews#1016
benvinegar merged 6 commits into
mainfrom
feat/commit-review-info

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • show history-selected commit metadata in the existing review-info pane, including title, revision, author, and a minute-updating relative timestamp
  • preserve metadata only across refreshes of the exact same provider review and normalize repository identity for launches from subdirectories
  • restore click-to-copy for commit revisions through the public extension pane action API
  • align the commit panel and sidebar selection rails with the diff's thin gutter marker, and use brighter theme roles for revisions and copy controls
  • document the extension API v20 additions and timestamp validation contract

Validation

  • bun run typecheck
  • bun run lint
  • bun run deps:check
  • bun run test
  • bun run test:integration
  • bun run test:tty-smoke
  • targeted review-info, theme, session-host, and interactive-log tests after final presentation changes
  • git diff --check

The PTY coverage verifies the metadata panel in a real interactive hunk log review flow. No visual attachment is included.

This PR description was generated by Pi using gpt-5.6-sol

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Sep 7, 2026 12:47pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds history-selected commit metadata to the review-info pane, preserves it across matching reloads, exposes clipboard copying to extension panes, and aligns related theme and selection styling.

  • Builds immutable commit descriptors from interactive history selections.
  • Displays the commit title, author, relative timestamp, and a copyable revision.
  • Extends extension API version 20 with authoredAt, copyText, and a copy-action theme role.
  • Normalizes reload identity for VCS reviews launched from repository subdirectories.
  • Adds unit, host, session, and PTY coverage plus corresponding API documentation.
  • The copied descriptor currently contains the abbreviated display revision rather than the full immutable revision.
  • Timestamp validation does not reject every impossible ISO-shaped calendar value.

Confidence Score: 4/5

The PR should not merge until the review-info copy control is backed by the full immutable revision rather than the abbreviated display ID.

History rows distinguish the immutable revision from its abbreviated display form, but the new descriptor stores and copies the display form; timestamp validation also accepts some impossible calendar dates.

Files Needing Attention: packages/hunk/src/ui/session/HunkSessionHost.tsx, packages/hunk/src/core/reviewDescriptor.ts

Important Files Changed

Filename Overview
packages/hunk/src/ui/session/HunkSessionHost.tsx Creates commit metadata for history-opened reviews, but records the abbreviated display ID as the copyable revision.
packages/hunk/src/core/reviewDescriptor.ts Adds bounded authoredAt validation, though impossible ISO-shaped dates can pass through Date.parse normalization.
packages/hunk/src/extensions/default/ui/reviewInfo/index.tsx Extends the review-info pane with commit metadata, minute-based relative-time updates, thin rails, and revision copying.
packages/hunk/src/extensions/default/ui/reviewInfo/presentation.ts Adds cell-aware commit title, revision, author, and relative-time formatting.
packages/hunk/src/app/delegatedReview.ts Preserves commit metadata only across matching immutable provider review requests and normalizes VCS repository identity.
packages/hunk/src/ui/components/panes/ExtensionPane.tsx Adds a stable host-mediated copyText action to public pane actions.
packages/hunk/src/extension-api/types.ts Advances the extension API to version 20 and publishes timestamp, clipboard, and theme additions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  H[Interactive history row] -->|open review| D[Build commit descriptor]
  D --> B[AppBootstrap.review]
  B --> P[Review-info pane]
  B --> S[Session registration]
  P --> T[Title, author, relative time]
  P --> C[Copy revision through pane action]
  C --> O[OSC 52 clipboard]
  B --> R[Matching review reload]
  R --> B
Loading
Prompt To Fix All With AI
### Issue 1
packages/hunk/src/ui/session/HunkSessionHost.tsx:62
**Copies abbreviated revision**

When a user copies the revision from the new review-info panel, this descriptor supplies `displayId`, so the panel copies the abbreviated Git or Jujutsu identifier. The existing history action instead copies the full immutable `revisionId`. An abbreviated identifier can become ambiguous when pasted into another command. Store the full revision in the descriptor and truncate it only for display.

```suggestion
    revision: outcome.commit.revisionId,
```

### Issue 2
packages/hunk/src/core/reviewDescriptor.ts:137-138
**Accepts impossible timestamps**

The new validator accepts ISO-shaped but impossible dates such as `2026-02-31T00:00:00Z`: the regular expression accepts the shape, and `Date.parse` normalizes the value instead of returning `NaN`. The UI can therefore show a relative time for a different date than the provider supplied. Validate that the parsed calendar components match the original timestamp.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(ui): show history commit metadata i..." | Re-trigger Greptile

Comment thread packages/hunk/src/ui/session/HunkSessionHost.tsx Outdated
Comment thread packages/hunk/src/core/reviewDescriptor.ts Outdated
@benvinegar
benvinegar force-pushed the feat/commit-review-info branch from 2e008cd to c2a2473 Compare September 7, 2026 03:57
@benvinegar
benvinegar merged commit 07c5892 into main Sep 7, 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.

1 participant