Skip to content

agent sessions - implement diff bar#276342

Merged
bpasero merged 1 commit intomainfrom
ben/junior-chicken
Nov 9, 2025
Merged

agent sessions - implement diff bar#276342
bpasero merged 1 commit intomainfrom
ben/junior-chicken

Conversation

@bpasero
Copy link
Member

@bpasero bpasero commented Nov 9, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 9, 2025 07:06
@bpasero bpasero enabled auto-merge (squash) November 9, 2025 07:06
@bpasero bpasero self-assigned this Nov 9, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the diff statistics display in the agent sessions viewer by moving it from the renderer into a dedicated action view item. The change improves code organization by separating UI concerns and making the diff statistics interactive.

Key changes:

  • Extracted diff statistics rendering logic from the renderer into a new AgentSessionShowDiffAction and AgentSessionDiffActionViewItem
  • Replaced inline diff elements with an ActionBar-based toolbar
  • Moved associated CSS styles from agentsessionsviewer.css to a new agentsessionsactions.css file

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
agentsessionsviewer.css Removed inline diff styling and related color selectors, added padding for status element
agentsessionsactions.css New file containing diff container styles and color definitions for files/additions/deletions
agentSessionsViewer.ts Replaced inline diff elements with ActionBar toolbar integration and added action view item provider
agentSessionsActions.ts New file implementing AgentSessionShowDiffAction and AgentSessionDiffActionViewItem for interactive diff statistics


const session = this.action.getSession();

this.commandService.executeCommand(`agentSession.${session.provider.chatSessionType}.openChanges`, this.action.getSession().resource);
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The session is retrieved twice unnecessarily. The session variable is already defined on line 81 but this.action.getSession() is called again to get the resource. Use session.resource instead.

Suggested change
this.commandService.executeCommand(`agentSession.${session.provider.chatSessionType}.openChanges`, this.action.getSession().resource);
this.commandService.executeCommand(`agentSession.${session.provider.chatSessionType}.openChanges`, session.resource);

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +73
elements.filesSpan.textContent = diff.files > 0 ? `${diff.files}` : '';
elements.addedSpan.textContent = diff.insertions > 0 ? `+${diff.insertions}` : '';
elements.removedSpan.textContent = diff.deletions > 0 ? `-${diff.deletions}` : '';
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic duplicates the condition check from line 138 in agentSessionsViewer.ts. The action is only created when diff.files > 0 || diff.insertions > 0 || diff.deletions > 0, so these checks in the render method may be redundant. Consider simplifying to always display the values when the action exists, or document why the double-checking is necessary.

Suggested change
elements.filesSpan.textContent = diff.files > 0 ? `${diff.files}` : '';
elements.addedSpan.textContent = diff.insertions > 0 ? `+${diff.insertions}` : '';
elements.removedSpan.textContent = diff.deletions > 0 ? `-${diff.deletions}` : '';
elements.filesSpan.textContent = `${diff.files}`;
elements.addedSpan.textContent = `+${diff.insertions}`;
elements.removedSpan.textContent = `-${diff.deletions}`;

Copilot uses AI. Check for mistakes.
@bpasero bpasero merged commit f9e5258 into main Nov 9, 2025
33 of 34 checks passed
@bpasero bpasero deleted the ben/junior-chicken branch November 9, 2025 07:25
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants