Repository navigation
Conversation
The Commits panel only ever walked HEAD. Add a scope option: - current (default) keeps today's HEAD-only walk. - all runs the same single bounded git log over --branches --remotes --tags plus HEAD, so refs/stash and provider refs such as refs/pull/* stay out and a detached checkout is still listed. All three options predate the Git 2.25 baseline. The scope travels through desktop IPC, the SSH relay, runtime RPC (a closed enum) and the web preload API, and the host echoes it in the result so a host that predates this change reads as current instead of being mislabelled. The panel gets a Current branch / All branches toggle group; switching drops the shown result and any in-flight read before refetching, and the choice is kept per worktree for the session. Folder workspaces are unchanged: the hook already skips them. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (25)
📝 WalkthroughWalkthroughThe change adds Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: 🔵 Low · up to All branches can incorrectly appear empty on an unborn branch. The issue is narrow and straightforward to fix before merging. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new modes use fixed Git options within the selected repository rather than granting additional command authority. The remaining concern is history ownership during host switches: a broader cached commit list can remain visible under a different host until refresh succeeds. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 18 files. (6 skipped: 6 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one rough edge on mixed-version hosts.
Reviewed changes
- Loader scope (
src/shared/git-history.ts) —scope: 'all'switches the single boundedgit logto--branches --remotes --tags HEAD(deliberately not--all), and the result now echoesscope. - End-to-end plumbing —
scopethreads through desktop IPC goroutine normalization, the SSH provider, the relay handler, the runtime RPC schema (z.enum(['current','all']).optional()), and the web preload. - Panel control (
git-history-scope-control.tsx) — newToggleGrouptoggle wired throughgit-history-panel.tsx,use-git-history.ts,use-file-listing.ts, andpanel-content.tsx. - Per-worktree scope state — remembered for the session, pruned with the tracked worktrees, dropped and refetched on switch so a stale result is never relabelled.
- Strings — three keys added to every locale.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
An older host omits `scope` from the history result, so the toggle shows "Current branch" while the requested scope stays "all". Clicking "All branches" again early-returned and the refresh effect never re-ran, leaving the toggle dead. Re-read when the shown scope differs from the request. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Drop the type assertions from the relay scope test, mark the runtime stub assertion with a SAFETY rationale like its neighbours, keep the pre-existing history pruning effect verbatim, and stop restyling ToggleGroupItem. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Addressed the review notes from the review summary: Separately, ec1024a clears the changed-code quality gate for this PR ( |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Fixed the mixed-version toggle dead-end —
setGitHistoryScopenow returns early only when the scope matches both the requested and the shown scope, and when an older host answered with a different scope it callsrefreshGitHistory()directly, since the trigger effect won't re-run on an unchangedrequestedScope. - Hook tests for the fix — new cases cover the re-request after an older host ignores
scope(2 → 3 calls) and confirm a host that honours the scope gets no redundant refetch. - RPC test quality — the
git.historyscope test now usestoMatchObject/toHavePropertyinstead ofas HistoryReplycasts; the assertions remain exact (items.lengthis pinned to 2). - Scope toggle styling — dropped the custom
px-1 text-[10px]classes from the toggle items, leaving the default type scale.
The previously open concern about the toggle becoming unresponsive on a host that ignores scope is addressed by 86604b440e; that thread is resolved.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
419aeeec-0dc1-4144-a7dd-ca522caa1311
📒 Files selected for processing (24)
src/main/ipc/filesystem/filesystem-git-status-handlers.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/relay/git-handler-read-operations.tssrc/relay/git-handler.test.tssrc/renderer/src/components/right-sidebar/GitHistoryPanel.test.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/use-file-listing.tssrc/renderer/src/components/right-sidebar/source-control/panel/panel-content.tsxsrc/renderer/src/components/right-sidebar/source-control/sync/git-history-panel.tsxsrc/renderer/src/components/right-sidebar/source-control/sync/git-history-scope-control.tsxsrc/renderer/src/components/right-sidebar/source-control/sync/use-git-history.tssrc/renderer/src/components/right-sidebar/use-source-control-git-history.test.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/web/preload-api/web-git-api.tssrc/renderer/src/web/web-preload-api-git.test.tssrc/shared/git-history-types.tssrc/shared/git-history.test.tssrc/shared/git-history.tssrc/shared/rpc-contract/git-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An orphan checkout or a fresh worktree has no HEAD commit, so the loader returned empty before git log even when branches, remotes or tags existed. The current scope keeps the early empty result; the all scope now walks --branches --remotes --tags without HEAD. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Unborn-HEAD all-scope fix — extracted the bounded
git loginto a sharedrunHistoryLog, and made theallscope list--branches --remotes --tagseven whenHEADis unborn (fresh repo or orphan checkout), degrading to empty on failure, whilecurrentstill returns empty without issuing agit log. - Real-Git coverage — new
history-unborn-head-real-git.test.tsbuilds an orphan checkout beside a committedmainand assertsalllists the other branch whilecurrentstays empty; verified passing locally. - Docstrings — one-line JSDoc added to the functions this change touches; no behavior change.
The prior concern about the scope toggle dead-ending on an older host is already resolved and its thread closed; the CodeRabbit unborn-HEAD finding is addressed by 76e414331c.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
@coderabbitai full review |
|

ELI5
The Commits panel used to show only the history of the branch you are on. Now there is a switch at the top of the panel: "Current branch" keeps the old view, "All branches" also shows commits from your other branches, remote branches and tags.
What Changed
src/shared/git-history.ts): new optionalscope: 'current' | 'all'.current(the default) still runsgit log … HEAD.allruns the same single boundedgit log -n51 --topo-orderwith--branches --remotes --tags HEAD. The result now echoesscope.scopeis passed through desktop IPC (git:history, normalized tocurrent/all), the SSH relay handler, the runtime RPC schema (z.enum(['current','all']).optional(), unknown values rejected), and the web preload API. The SSH provider, local runtime and renderer client already forward the whole options object.Current branch / All branchestoggle group (existingToggleGroupprimitive, labelled "Commit history scope") under the Commits header. Switching drops the shown result and any in-flight read for that worktree before refetching, so the old list is never labelled with the new scope. The choice is kept per worktree for the session and dropped when the worktree goes away.Why
--all:--allalso walksrefs/stashand provider refs likerefs/pull/*, which are noise in a branch graph. AddingHEADkeeps a detached checkout in the list.scopeis a new optional param (safe per the remote wire rules), and the host echoes it in the result. The panel shows the scope the result actually came from, so a host that predates this change reads as "Current branch" instead of lying.--branches,--remotesand--tagspredate the Git 2.25 baseline by many years, so no capability probe or fallback is needed.Linked Issue
Fixes #25539
Visual Proof
Before/after screenshots will be attached by the author (Commits panel with the scope toggle in each state).
Testing
New/updated tests (10 failed before the change, all pass after):
src/shared/git-history.test.ts— default walks only HEAD and reportscurrent;allpasses--branches --remotes --tags HEAD, never--all, in one log call.src/relay/git-handler.test.ts— real Git repo over the relay: a side-branch commit appears only inall; a stash commit never appears.src/main/runtime/rpc/methods/git.test.ts— scope forwarded; unknown scope rejected.src/renderer/src/web/web-preload-api-git.test.ts— web preload forwardsscopetogit.history.use-source-control-git-history.test.tsx— switching clears the old result and refetches with the new scope; an older host that ignores the scope reads ascurrent; scope is remembered per worktree and forgotten when the worktree is removed.GitHistoryPanel.test.tsx— labelled toggle group marks the shown scope.Commands run:
pnpm vitest run --config config/vitest.config.tson the six files above — 79 passedpnpm lint— passpnpm typecheck— passpnpm testandpnpm buildwere not run locally; relying on CI. Not manually exercised on Windows or against a live SSH host.AI Disclosure
Implemented with Claude Code (Claude Opus 5.5); reviewed by the author.
Review
git logcall; history is still fetched only when the panel is expanded and visible.ToggleGroupprimitive and type scale; no new tokens.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — lint and typecheck pass locally; full test and build left to CI