feat(differ): add Graphite stack support for scoped PR diffs#499
Conversation
apps/differ/src-tauri/src/lib.rs
Outdated
| let output = Command::new("gt") | ||
| .args(["state"]) | ||
| .current_dir(repo) | ||
| .output() | ||
| .ok()?; | ||
|
|
||
| if !output.status.success() { | ||
| return None; | ||
| } |
There was a problem hiding this comment.
apparently this would be a good hook to also offer non-graphite stacking options like jj but probably worth punting on that
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b0ffee4b0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const si = await commands.getStackInfo(); | ||
| stackInfo = si; | ||
| if (si && !args.mode) { | ||
| setMode('stack'); |
There was a problem hiding this comment.
Avoid racing diff loads when auto-selecting stack mode
loadRepoInfo() triggers loadDiff() but does not await its completion, and this new setMode('stack') call immediately kicks off another loadDiff(). In a Graphite repo on startup, the two requests can resolve out of order and the later completion overwrites files/selectedFile, leaving the UI in stack mode while showing results from the earlier mode; the same sequence is repeated in the repo-switch path.
Useful? React with 👍 / 👎.
0b0ffee to
1000c03
Compare
Add stack-aware diff mode that shows only the current branch's changes instead of the entire branch diff from trunk. Detects Graphite stacks via `gt state` and auto-selects stack mode when available. - Add `get_stack_info` Tauri command that parses `gt state` JSON - Add `StackInfo`/`StackBranchInfo` types and spec builders - Add Stack dropdown with upstack/downstack branch navigation - Navigate other stack branches without checkout (read-only refs) - Show needs-restack warning indicator - Graceful fallback: Stack button hidden when gt not installed Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d28f5-71eb-7256-af52-1b4c406e53a7
1000c03 to
e368dba
Compare
Stack overview
This is PR 1/4 in a stack of Differ improvements:
Background
Differ currently shows the full diff from trunk for any branch, which is noisy when working with Graphite stacked PRs — you see all changes from every branch in the stack, not just the current one.
Overview of Changes
get_stack_infoTauri command that shells out togt state, parses the JSON, and returns structuredStackInfo/StackBranchInfotypesgtis not installed or repo is not in a stackTesting Performed
gtis not installed (Stack UI hidden)Video testing (with all 4 from stack)
gtinstalledgtinstalledScreen.Recording.2026-03-26.at.10.38.26.AM_compressed.mp4
Screen.Recording.2026-03-26.at.10.41.16.AM_compressed.mp4
Fixed the text overflow artifacts that you can see in the video
I just didn't want to rerecord



✨🤖 heavily assisted by AmpCode