Skip to content

feat(source-control): add commit details modal and truncated-subject tooltip - #3006

Open
onel0p3z wants to merge 7 commits into
generalaction:mainfrom
onel0p3z:feat/commit-row-details-and-tooltip
Open

feat(source-control): add commit details modal and truncated-subject tooltip#3006
onel0p3z wants to merge 7 commits into
generalaction:mainfrom
onel0p3z:feat/commit-row-details-and-tooltip

Conversation

@onel0p3z

@onel0p3z onel0p3z commented Aug 19, 2026

Copy link
Copy Markdown

Description

Branch commit rows in the source-control panel are currently click-to-expand only, and a long
subject is silently cut off with no way to read it. This adds three things to that surface:

  • Right-click context menu on a commit row: View commit details, Copy commit SHA,
    Copy commit message.
  • Commit details modal: full message body, author/committer identity and dates, full SHA
    with parents and tags, pushed status, and the changed files with +/− stats. Files in the
    modal are display-only for now — wiring them to open the diff is a small follow-up
    (CommitFilesList in commits-list.tsx already has the openDiff logic).
  • Truncated-subject tooltip: hovering a row shows the full subject, but only when the
    subject is actually truncated. Truncation is measured when the tooltip asks to open
    (controlled open + scrollWidth > clientWidth on the subject span), so a panel resize
    never leaves a stale answer and no useEffect is needed.

Supporting change in the git runtime: git log only captured %an/%at, so author email,
committer identity, and commit date were never available to render. LOG_FORMAT now also
captures %ae %cn %ce %ct.

High-risk callout (per AGENTS.md)

This touches the workspace-server wire contract, so flagging it explicitly:

  • commitSchema is wire-visible — the git runtime mounts on workspaceWireContract and is
    served by remote workspace-server daemons. Every new field is therefore .optional(), so a
    newer desktop stays a tolerant reader of a daemon that omits them; a required field would make
    .parse() throw against any non-upgraded daemon.
  • PROTOCOL_VERSION 1.0.01.1.0. Minor only, deliberately: the major keys the
    release-channel artifact paths introduced in 8950a1d, and these additions are backward
    compatible. Happy to drop the bump entirely if you would rather reserve minors for changes
    something actually negotiates on.
  • LOG_FORMAT parsing is positionalparseLogRecords splits on \x1f and destructures by
    index, so the format string and the destructuring have to move together. The new
    ops/log.test.ts pins the placeholder count and the field mapping so they cannot drift apart.

Related issues

None — this came out of using the branch commits panel, not from a filed issue.

Testing

Full local gate against current main:

  • pnpm run format, pnpm run lint, pnpm run typecheck — clean across all 9 projects.
  • packages/core: 1414 passed / 12 skipped, including the new ops/log.test.ts and real-repo
    identity + epoch-ms assertions added to git-checkout.test.ts.
  • App node project: 2820 passed / 1 skipped.
  • App browser project: the two new files pass in real Chromium —
    commit-details-modal.test.tsx (context menu, modal content, display-only file list, no-body
    fallback, through the real openModal path) and commit-row-tooltip.test.tsx (real CDP hover;
    tooltip present in a 200px container, absent at 900px).

Manual verification in the running desktop app: right-click → menu → modal on a real commit;
both copy actions confirmed by pasting (SHA exact, message arrives as subject\n\nbody); tooltip
appears only when the subject is truncated, re-measures correctly after narrowing the panel, and
closes when the context menu opens; click-to-expand still works.

Screenshot/Recording (if applicable)

Screenshots of the context menu, the details modal, and the tooltip can be added on request.

Screenshot from 2026-08-13 12-57-21 image Screenshot from 2026-08-13 14-01-33
Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title
onel0p3z and others added 7 commits August 19, 2026 14:13
The log format only captured `%an` and `%at`, so a commit's author email and
its committer identity/date were unavailable to any consumer. Extend
LOG_FORMAT with `%ae`, `%cn`, `%ce`, and `%ct` and carry them on commitSchema.

The new fields are optional and the parser leaves them absent rather than
empty, so a newer client stays a tolerant reader of a pre-8.2.0 host and no
consumer renders a blank name or an epoch-zero date. PROTOCOL_VERSION takes a
minor bump per the additive-field rule in agents/architecture/workspace-server.md.

Adds a parser unit test that pins the placeholder count and the positional
mapping, which is the part of this format most likely to drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Branch-commit rows truncated the subject and exposed no way to read the rest
of a commit. Right-clicking a row now offers View commit details, Copy commit
SHA, and Copy commit message.

The details modal shows the full message body, author and committer identity
with dates, the full SHA, parents, tags, pushed status, and the changed files
with per-file and total +/- stats. The commit itself already rides the
surrounding log query, so only the file list is fetched, through the existing
useCommitFiles hook and getCommitFiles procedure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…al repo

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…the browser

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extract the commit row button into its own component and wrap it in a
tooltip that opens on hover only when the subject line is actually
truncated. Truncation is measured when the tooltip asks to open, so
panel resizes never leave the answer stale.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Real-Chromium hover via vitest userEvent: the tooltip shows the full
subject in a narrow container and stays closed when the subject fits.
Layout utilities are shimmed because the browser-test harness compiles
no app-level Tailwind.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds commit-row context actions, a read-only commit-details modal, and truncation-aware subject tooltips. It also extends Git log records with optional author and committer metadata and increments the compatible workspace protocol minor version.

  • Adds details and clipboard actions to branch commit rows.
  • Displays commit metadata and changed-file statistics in a contributed modal.
  • Extends positional Git-log parsing with optional identity fields and epoch-millisecond committer dates.
  • Adds browser and Git-runtime coverage for the new behavior.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified.

The modal follows the existing contribution and commit-files query patterns, the tooltip remeasures truncation when opening, and the new wire fields remain optional across mixed protocol-minor versions.

Important Files Changed

Filename Overview
apps/emdash-desktop/src/core/features/source-control/browser/diff-view/changes-panel/components/pr-entry/commit-details-modal.tsx Adds a read-only modal that renders commit metadata and reuses the established commit-files query.
apps/emdash-desktop/src/core/features/source-control/browser/diff-view/changes-panel/components/pr-entry/commit-row-button.tsx Extracts the commit-row button and conditionally opens a tooltip based on current text-overflow geometry.
apps/emdash-desktop/src/core/features/source-control/browser/diff-view/changes-panel/components/pr-entry/commits-list.tsx Composes commit rows with the new context menu and opens the contributed details modal with existing workspace identifiers.
packages/core/src/runtimes/git/node/checkout/ops/log.ts Extends positional Git-log formatting and parsing with author email and committer identity/date fields.
packages/core/src/runtimes/git/api/checkout/schemas.ts Adds the new wire-visible commit metadata as optional fields for mixed-version compatibility.
packages/core/src/workspace-server/versions/index.ts Applies the expected additive protocol minor-version increment.

Sequence Diagram

sequenceDiagram
  participant U as User
  participant R as Commit row
  participant M as Details modal
  participant G as Git checkout client
  participant H as Git runtime
  U->>R: Right-click commit
  R-->>U: Show context menu
  U->>R: View commit details
  R->>M: Open with commit and workspace identity
  M->>G: getCommitFiles(commit hash)
  G->>H: Wire checkout request
  H-->>G: Changed files and line statistics
  G-->>M: Query result
  M-->>U: Render message, identities, metadata, and files
Loading

Reviews (1): Last reviewed commit: "test(source-control): cover the truncati..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant