orca icon indicating copy to clipboard operation
orca copied to clipboard

[Bug]: Diff staged-vs-working split missing for Markdown files

Open flexoid opened this issue 4 months ago • 5 comments

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!

flexoid avatar Jul 09 '26 13:07 flexoid

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 avatar Jul 13 '26 07:07 nwparker

@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.

flexoid avatar Jul 13 '26 09:07 flexoid

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 🙏.

nwparker avatar Aug 23 '26 00:08 nwparker

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.

nwparker avatar Aug 25 '26 01:08 nwparker

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.

markdown-staged

markdown-unstaged

OrcaWin avatar Oct 29 '26 01:10 OrcaWin