Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 29, 2025

The coding agent changed files list was missing the green/red diff indicators (+12 -0) that show lines added and removed, unlike regular chat which displays these indicators correctly.

Before

Before - no diff indicators

After

After - with diff indicators

Changes Made

Extended IChatMultiDiffData Interface

Added optional diffMeta field to resource entries to carry diff statistics:

diffMeta?: {
  added: number;
  removed: number;
};

Enhanced ChatMultiDiffListRenderer

  • Added diff indicator elements to template (fileDiffsContainer, addedSpan, removedSpan)
  • Display "+X -Y" indicators when diff metadata is available
  • Hide indicators when no diff metadata is present
  • Added proper accessibility labels for screen readers

Backward Compatibility

The changes are fully backward compatible - existing callers that don't provide diff metadata will continue to work unchanged, while new callers can optionally include diff statistics.

The fix ensures that when coding agents modify files, users see the same helpful diff indicators (+lines added, -lines removed) that appear in regular chat, providing better transparency about the scope of changes.

Recent Updates

  • Extended IChatMultiDiffData interface to include optional diffMeta field
  • Enhanced ChatMultiDiffListRenderer to display diff indicators (+X -Y)
  • Added proper accessibility labels for screen readers
  • Maintained backward compatibility with existing callers
  • Fixed formatting issue - removed extra blank line

Fixes #258613.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Show diff indicators in coding agent changed files Show diff indicators in coding agent changed files Aug 29, 2025
Copilot finished work on behalf of joshspicer August 29, 2025 23:07
@Copilot Copilot AI requested a review from joshspicer August 29, 2025 23:07
@joshspicer
Copy link
Member

@copilot No, the change needs to be made in src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.ts. You should optionally allow this data to be provided by the caller (along with the file name, diffs, etc...)


@joshspicer
Copy link
Member

@copilot No, the change needs to be made in src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.ts. You should optionally allow this data to be provided by the caller (along with the file name, diffs, etc...)


Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 2, 2025

@copilot No, the change needs to be made in src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.ts. You should optionally allow this data to be provided by the caller (alon...

You're absolutely right! I moved the change to chatMultiDiffContentPart.ts as requested. The fix now:

  1. Extends IChatMultiDiffData to optionally include diffMeta with added/removed line counts
  2. Updates the ChatMultiDiffListRenderer to display "+X -Y" indicators when diff metadata is provided
  3. Properly handles cases where no diff metadata is available (hides indicators)

The caller can now optionally provide diff statistics along with file names and diff URIs, and they'll be displayed just like in the regular chat references.

Commit: 23c37b4

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI changed the title Show diff indicators in coding agent changed files Add diff indicators support to chat multi-diff content part Sep 2, 2025
Copilot finished work on behalf of joshspicer September 2, 2025 16:13
@mofreh345
Copy link

mofreh345 commented Sep 2, 2025 via email

@joshspicer
Copy link
Member

@copilot fix the formatting issue

[hygiene                  ] File not formatted. Run the 'Format Document' command to fix it: src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.ts
[extensions-ci-pr         ] [16:18:07] Bundled extension: git-base/extension.webpack.config.js...
[extensions-ci-pr         ] [16:18:08] Bundled extension: terminal-suggest/extension.webpack.config.js...
[hygiene                  ] [16:18:24] 'hygiene' errored after 2.07 min
[hygiene                  ] 
[hygiene                  ] [16:18:24] Error: Hygiene failed with 1 errors. Check 'build / gulpfile.hygiene.js'.
[hygiene                  ]     at formatError (/mnt/vss/_work/vscode/vscode/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js:21:10)
[hygiene                  ]     at Gulp.<anonymous> (/mnt/vss/_work/vscode/vscode/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js:33:15)
[hygiene                  ]     at Gulp.emit (node:events:530:35)
[hygiene                  ]     at Gulp.emit (node:domain:489:12)
[hygiene                  ]     at Object.error (/mnt/vss/_work/vscode/vscode/node_modules/undertaker/lib/helpers/createExtensions.js:61:10)
[hygiene                  ]     at handler (/mnt/vss/_work/vscode/vscode/node_modules/now-and-later/lib/map.js:50:14)
[hygiene                  ]     at f (/mnt/vss/_work/vscode/vscode/node_modules/once/once.js:25:25)
[hygiene                  ]     at f (/mnt/vss/_work/vscode/vscode/node_modules/once/once.js:25:25)
[hygiene                  ]     at tryCatch (/mnt/vss/_work/vscode/vscode/node_modules/async-done/index.js:24:15)
[hygiene                  ]     at done (/mnt/vss/_work/vscode/vscode/node_modules/async-done/index.js:40:12)
ERROR: "hygiene" exited with 1.

…tPart

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 2, 2025

@copilot fix the formatting issue

...

Fixed the formatting issue by removing the extra blank line. The file should now pass hygiene checks. Commit: dfb23a9

Copilot finished work on behalf of joshspicer September 2, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show diff indicators in coding agent changed files
3 participants