mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Agent Sessions - add view all changes action to sessions list (#289142)
* Agent Sessions - add view all changes action to sessions list * Hide menu if the session does not have any changes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<void> {
|
||||
override async run(accessor: ServicesAccessor, sessionOrSessionResource?: URI | IAgentSession): Promise<void> {
|
||||
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)) {
|
||||
|
||||
Reference in New Issue
Block a user