feat(source-control): add commit details modal and truncated-subject tooltip - #3006
Open
onel0p3z wants to merge 7 commits into
Open
feat(source-control): add commit details modal and truncated-subject tooltip#3006onel0p3z wants to merge 7 commits into
onel0p3z wants to merge 7 commits into
Conversation
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>
Contributor
Greptile SummaryThe 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.
Confidence Score: 5/5The 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.
|
| 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
Reviews (1): Last reviewed commit: "test(source-control): cover the truncati..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Copy commit message.
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
(
CommitFilesListincommits-list.tsxalready has theopenDifflogic).subject is actually truncated. Truncation is measured when the tooltip asks to open
(controlled
open+scrollWidth > clientWidthon the subject span), so a panel resizenever leaves a stale answer and no
useEffectis needed.Supporting change in the git runtime:
git logonly captured%an/%at, so author email,committer identity, and commit date were never available to render.
LOG_FORMATnow alsocaptures
%ae %cn %ce %ct.High-risk callout (per
AGENTS.md)This touches the workspace-server wire contract, so flagging it explicitly:
commitSchemais wire-visible — the git runtime mounts onworkspaceWireContractand isserved by remote workspace-server daemons. Every new field is therefore
.optional(), so anewer desktop stays a tolerant reader of a daemon that omits them; a required field would make
.parse()throw against any non-upgraded daemon.PROTOCOL_VERSION1.0.0→1.1.0. Minor only, deliberately: the major keys therelease-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_FORMATparsing is positional —parseLogRecordssplits on\x1fand destructures byindex, so the format string and the destructuring have to move together. The new
ops/log.test.tspins 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 newops/log.test.tsand real-repoidentity + epoch-ms assertions added to
git-checkout.test.ts.nodeproject: 2820 passed / 1 skipped.browserproject: the two new files pass in real Chromium —commit-details-modal.test.tsx(context menu, modal content, display-only file list, no-bodyfallback, through the real
openModalpath) andcommit-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); tooltipappears 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.
Checklist
messages and, when possible, the PR title