From 939ffba04f11b68160510d6c8cabe137150bf90a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 20 Mar 2026 17:36:21 +0100 Subject: [PATCH] Sessions: remove diff changes from title (#303544) remove changes summary display and related logic from SessionsTitleBarWidget --- .../browser/media/sessionsTitleBarWidget.css | 14 ------ .../browser/sessionsTitleBarWidget.ts | 43 +------------------ 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css b/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css index b9f14273091..87dde988060 100644 --- a/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css +++ b/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css @@ -77,18 +77,4 @@ flex-shrink: 0; } -/* Changes summary */ -.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-changes { - display: flex; - align-items: center; - flex-shrink: 0; - gap: 3px; -} -.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-changes-added { - color: var(--vscode-gitDecoration-addedResourceForeground); -} - -.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-changes-removed { - color: var(--vscode-gitDecoration-deletedResourceForeground); -} diff --git a/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts b/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts index b8096dff925..774577eeb23 100644 --- a/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts +++ b/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts @@ -19,7 +19,7 @@ import { IMenuService, MenuId, MenuRegistry, SubmenuItemAction } from '../../../ import { IContextKeyService, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; import { ChatContextKeys } from '../../../../workbench/contrib/chat/common/actions/chatContextKeys.js'; -import { IMarshalledAgentSessionContext, getAgentChangesSummary, hasValidDiff } from '../../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; +import { IMarshalledAgentSessionContext } from '../../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; import { IChatSessionsService } from '../../../../workbench/contrib/chat/common/chatSessionsService.js'; import { Menus } from '../../../browser/menus.js'; import { IWorkbenchContribution } from '../../../../workbench/common/contributions.js'; @@ -128,10 +128,8 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { const label = this._getActiveSessionLabel(); const icon = this._getActiveSessionIcon(); const repoLabel = this._getRepositoryLabel(); - const changesSummary = this._getChangesSummary(); - // Build a render-state key from all displayed data - const renderState = `${icon?.id ?? ''}|${label}|${repoLabel ?? ''}|${changesSummary?.insertions ?? ''}|${changesSummary?.deletions ?? ''}`; + const renderState = `${icon?.id ?? ''}|${label}|${repoLabel ?? ''}`; // Skip re-render if state hasn't changed if (this._lastRenderState === renderState) { @@ -176,25 +174,6 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { centerGroup.appendChild(repoEl); } - // Changes summary shown next to the repo - if (changesSummary) { - const separator2 = $('span.agent-sessions-titlebar-separator'); - separator2.textContent = '\u00B7'; - centerGroup.appendChild(separator2); - - const changesEl = $('span.agent-sessions-titlebar-changes'); - - const addedEl = $('span.agent-sessions-titlebar-changes-added'); - addedEl.textContent = `+${changesSummary.insertions}`; - changesEl.appendChild(addedEl); - - const removedEl = $('span.agent-sessions-titlebar-changes-removed'); - removedEl.textContent = `-${changesSummary.deletions}`; - changesEl.appendChild(removedEl); - - centerGroup.appendChild(changesEl); - } - sessionPill.appendChild(centerGroup); // Click handler on pill - show sessions picker @@ -363,24 +342,6 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { menu.dispose(); } - /** - * Get the changes summary for the active session. - */ - private _getChangesSummary(): { insertions: number; deletions: number } | undefined { - const activeSession = this.activeSessionService.getActiveSession(); - if (!activeSession) { - return undefined; - } - - const agentSession = this.agentSessionsService.getSession(activeSession.resource); - const changes = agentSession?.changes; - if (!changes || !hasValidDiff(changes)) { - return undefined; - } - - return getAgentChangesSummary(changes); - } - private _showSessionsPicker(): void { const picker = this.instantiationService.createInstance(AgentSessionsPicker, undefined, { overrideSessionOpen: (session, openOptions) => this.activeSessionService.openSession(session.resource, openOptions)