Repository navigation
feat(git): a commit opens as its own tab, with GitHub avatars in History - #389
Conversation
Source Control → History rows now read as message, then avatar · author · time · short sha. Clicking one (or a node in the Git Graph) opens a "commit" centre tab instead of swapping the sidebar for a detail view: the author header with a Commit SHA copy, and every changed file as a collapsible section, split or unified, with expand/collapse-all and +/- totals. The cherry-pick, revert, reset, tag and produced-by-session controls moved with it. Avatars come from GitHub through the user's own `gh` (git_repo_avatars: one `gh api` call for the branch's newest 100 commits, shared by every avatar in the repository), then the noreply-email account id, then Gravatar, then a glyph. The CSP admits avatars.githubusercontent.com. `git show` for a commit, its per-file diff and its file list now use `-m --first-parent`, so a merge shows what it brought into its branch rather than an empty combined diff. Binary files and renames say so instead of rendering as an empty +0 −0 section. The standalone Git Diff module (a blank tab with a file tree and commit picker) leaves the new-tab menu and palette — the commit tab replaces it. Layouts saved with one drop it on restore; Git Diff tabs for a file stay.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (32)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe changes add repository-scoped GitHub avatar lookup, dedicated commit tabs with detailed commit views, and first-parent diffs for merge commits. They also update commit log data, layout restoration, and mock responses to support these changes. ChangesGit commit experience
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant GitGraphPanel
participant OpenCommit as openCommit
participant LayoutStore as layout store
participant CenterPanel
participant CommitView
GitGraphPanel->>OpenCommit: Open repository path, SHA, and subject
OpenCommit->>LayoutStore: Create or focus and activate commit tab
LayoutStore->>CenterPanel: Provide active commit tab
CenterPanel->>CommitView: Render with repository path and SHA
CommitView->>CommitView: Load commit details and render diff
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change opens commits in their own tabs, adds GitHub avatars to History, and shows merge commits against their first parent. No concrete defect was identified. Author emails reach History rows from the native backend, so avatars can resolve. Saved single-file diff tabs and commit tabs are still restored. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 59.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 29 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What?
+N −M;+N −M;ui_open diff) are unchanged.Why?
The old sidebar detail view squeezed a whole commit into the sidebar width, and avatars were Gravatar-only, so most authors showed a generic icon. Reading a commit wants the editor's width and the faces people know from GitHub. The blank Git Diff module was the other way to browse a commit; with the commit tab it is redundant.
How?
commit-view.tsx, new tab typecommit, idcommit:{repo}:{sha}): parses thegit_showdiff client-side; split rows are paired by the newsplitHunkLines(a removal run sits across from the addition run that replaced it). Virtualized, with stable row ids so collapse and mode switches keep measured heights.git_show, the per-file commit diff and the commit file list now use-m --first-parent, so a merge shows what it brought into its branch — before, a clean merge showed "No file changes". Ordinary commits are unaffected.+0 −0section.git_avatars.rs,git-avatars-api.ts): onegh api repos/{owner}/{repo}/commits?sha={branch}call per repository through the user's owngh(reusinggit_pr.rs's runner, timeout and permits), shared by every avatar via the query cache. A branch GitHub doesn't have falls back to the default branch; a timed-out call doesn't retry. Lookup order: GitHub → the account id in a…@users.noreply.github.comemail → Gravatar → glyph.ghmissing or signed out backs off for 10 minutes. CSP (prod and dev) admitshttps://avatars.githubusercontent.comonly.NEW_TAB_OPTIONSand the new-tab palette;isRetiredTabdrops a saved blank Git Diff tab on both restore paths, so old layouts don't bring back a tab nothing can open.Known gaps: long lines clip (the per-file "Open in diff view" shows them whole); no expand-context arrows or search / GitHub buttons in the toolbar; GitHub avatars need
ghinstalled and signed in, and cover authors in the branch's newest 100 commits (plus any noreply email).Checklist
0.4.1)splitHunkLinespairing, binary / rename parsing, thegit_repo_avatarsIPC seam and its back-off,isRetiredTab; Rust: avatar parsing, origin filter and wire shape (6 tests)target-gc.test.tsandmessage-body.test.tsx, which fail the same way on the base commit987226c7and pass when run on their own. Rust:git_avatars,gitdiff,git_pr,git_ops38 passed.Summary by CodeRabbit