[Bug]: Diff staged-vs-working split missing for Markdown files
Problem or use case
When the same file in the git repository was edited, staged (git add), then edited again, there will be two entries of the file in Source Control pane. One under "Changes", another - "Staged changes".
Currently Changes show the whole diff comparing to branch state, so there's effectively no way to see diff since last git add. Personally I use it a lot while working with the agent iteratively and staging changes that I've reviewed, so I don't have to review everything on each interation.
Proposed solution
The expected behaviour for me would be "Staged changes" to show diff between commited state and staged, while "Changes" to show diff between staged and current file state. That's how VS Code shows it for example.
Alternatives or additional context
Thanks for the great product!
This should be handled for the common case now: clicking a file under Changes in Source Control diffs your staged version against the working file (i.e. only the changes since your last git add), and Staged Changes shows committed→staged — the same split VS Code does.
One spot that still shows the full diff against the last commit is Markdown files (they open in the editor's changes view) and the editor's inline Edit/Changes toggle. Can you confirm which file type / view you were looking at? If it was a non-Markdown file in the Source Control panel, a quick repro would help — otherwise the Markdown case is a known gap I can track separately.
@nwparker yep, that is exactly markdown files, that’s all we’re editing in these strange times right? 😄
Sorry about not mentioning it, didn't realise it can be filetype dependant.
Closing because Changes already splits staged vs working like VS Code. Disagree? Please respond! I will re-visit this ticket in 5 days. If you respond, I will re-open it 🙏.
Re-opening — closed as done but partially: the staged→working split (VS Code-style) shipped for code files; Markdown files still show the full diff per maintainer in-thread.
Verified the staged/working Markdown split against the source-control implementation on main at 8c3551bde3bb6fe872f6570dbb17b2ccf76c1454. Merged #31399 routes modified Markdown through the normal unstaged diff instead of the editable comparison against HEAD.
An isolated Linux Electron run exercised both real Source Control rows with three distinct versions of review.md:
- HEAD:
COMMITTED_A - Index:
STAGED_B - Working tree:
WORKING_C
Staged Changes rendered COMMITTED_A → STAGED_B; Changes rendered STAGED_B → WORKING_C, with the third version absent from each comparison. Both assertions passed, and the attached screenshots were inspected. The source-control implementation was unchanged in the verification checkout; its only patch concerns unrelated filename highlighting.
Closing as completed by #31399.