diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts index 50a3b94aea5..481f4bed2f1 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts @@ -192,6 +192,7 @@ export class AgentSessionRenderer extends Disposable implements ICompressibleTre } } template.diffContainer.classList.toggle('has-diff', hasDiff); + ChatContextKeys.hasAgentSessionChanges.bindTo(template.contextKeyService).set(hasDiff); // Badge let hasBadge = false; diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css b/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css index 190ef9eceb1..846c2ff8fd9 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css @@ -59,7 +59,7 @@ .monaco-list-row:hover .agent-session-title-toolbar, .monaco-list-row.focused .agent-session-title-toolbar { - width: 22px; + width: 44px; .monaco-toolbar { display: block; diff --git a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts index 30404affd13..5d245b48a1c 100644 --- a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts +++ b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts @@ -35,6 +35,7 @@ import { isChatTreeItem, isRequestVM, isResponseVM } from '../../common/model/ch import { ChatAgentLocation, ChatConfiguration, ChatModeKind } from '../../common/constants.js'; import { CHAT_CATEGORY } from '../actions/chatActions.js'; import { ChatTreeItem, IChatWidget, IChatWidgetService } from '../chat.js'; +import { IAgentSession, isAgentSession } from '../agentSessions/agentSessionsModel.js'; export abstract class EditingSessionAction extends Action2 { @@ -323,18 +324,29 @@ export class ViewAllSessionChangesAction extends Action2 { group: 'navigation', order: 10, when: ChatContextKeys.hasAgentSessionChanges + }, + { + id: MenuId.AgentSessionItemToolbar, + group: 'navigation', + order: 0, + when: ChatContextKeys.hasAgentSessionChanges } ], }); } - override async run(accessor: ServicesAccessor, sessionResource?: URI): Promise { + override async run(accessor: ServicesAccessor, sessionOrSessionResource?: URI | IAgentSession): Promise { const agentSessionsService = accessor.get(IAgentSessionsService); const commandService = accessor.get(ICommandService); - if (!URI.isUri(sessionResource)) { + + if (!URI.isUri(sessionOrSessionResource) && !isAgentSession(sessionOrSessionResource)) { return; } + const sessionResource = URI.isUri(sessionOrSessionResource) + ? sessionOrSessionResource + : sessionOrSessionResource.resource; + const session = agentSessionsService.getSession(sessionResource); const changes = session?.changes; if (!(changes instanceof Array)) {