Skip to content

Commit aee3160

Browse files
benibenjCopilot
andauthored
chat: always enable turn status pills (#334702)
Remove the chat.turnStatusPills configuration and legacy compatibility path so turn status pills render consistently in agent sessions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fc0a9e9 commit aee3160

12 files changed

Lines changed: 28 additions & 148 deletions

File tree

src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { IConfigurationService } from '../../../../platform/configuration/common
1717
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
1818
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
1919
import { ChatInputPills, StandardChatInputPillSources } from '../../../../workbench/contrib/chat/browser/chatInputPills.js';
20-
import { diffStatsEqual, EMPTY_DIFF_STATS, IDiffStats, observeTurnStatusPillsEnabled } from '../../../../workbench/contrib/chat/browser/widget/chatTurnPills.js';
20+
import { diffStatsEqual, EMPTY_DIFF_STATS, IDiffStats } from '../../../../workbench/contrib/chat/browser/widget/chatTurnPills.js';
2121
import { SessionArtifacts, sessionArtifactLocation } from './sessionArtifacts.js';
2222
import { SessionCustomizations } from './sessionCustomizations.js';
2323
import { localize } from '../../../../nls.js';
@@ -259,8 +259,8 @@ export class SessionChatInputToolbar extends Disposable {
259259
return computeSessionInputPillStats(this._session.read(reader), changesStatsCache, reader);
260260
});
261261

262-
const turnStatusPillsEnabled = observeTurnStatusPillsEnabled(this._configurationService);
263-
this._browsers = this._register(instantiationService.createInstance(SessionBrowsersControl, this._session, this._chat, turnStatusPillsEnabled, derived(reader => visibility.isVisible(SessionChatPillKind.Browsers, reader))));
262+
const pillsEnabled = constObservable(true);
263+
this._browsers = this._register(instantiationService.createInstance(SessionBrowsersControl, this._session, this._chat, pillsEnabled, derived(reader => visibility.isVisible(SessionChatPillKind.Browsers, reader))));
264264

265265
// The browsers pill already offers the pages it lists, so the artifacts and
266266
// references pills leave those websites out.
@@ -273,8 +273,7 @@ export class SessionChatInputToolbar extends Disposable {
273273
const sessionCustomizations = this._register(instantiationService.createInstance(SessionCustomizations, this._chat, this._session));
274274
this._customizationSections = sessionCustomizations.sections;
275275

276-
const pillsEnabled = derived(reader => this._debugData.read(reader) !== undefined || turnStatusPillsEnabled.read(reader));
277-
this._backgroundActivities = this._register(instantiationService.createInstance(SessionBackgroundActivitiesControl, this._session, this._chat, turnStatusPillsEnabled, constObservable(true)));
276+
this._backgroundActivities = this._register(instantiationService.createInstance(SessionBackgroundActivitiesControl, this._session, this._chat, pillsEnabled, constObservable(true)));
278277
const gitHubInfo = derived(this, reader => {
279278
const session = this._session.read(reader);
280279
const workspace = session?.workspace.read(reader);
@@ -292,7 +291,7 @@ export class SessionChatInputToolbar extends Disposable {
292291
const reference = reader.store.add(gitHubService.createIssueModelReference(ref.owner, ref.repo, ref.number));
293292
return { ref, issue: reference.object.issue.read(reader) };
294293
}));
295-
const issuesActive = derived(this, reader => pillsEnabled.read(reader) && visibility.isVisible(SessionChatPillKind.Issues, reader));
294+
const issuesActive = derived(this, reader => visibility.isVisible(SessionChatPillKind.Issues, reader));
296295
this._register(autorun(reader => {
297296
if (!issuesActive.read(reader)) {
298297
return;

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { ISessionChatPillVisibilityService, SessionChatPillKind } from '../../..
3333
import { CHAT_SUBAGENT_RESOURCE_QUERY_PARAM } from '../../../common/constants.js';
3434
import { IEditSessionEntryDiff } from '../../../common/editing/chatEditingService.js';
3535
import { chatPersistentContentVisibleClass, type ChatWidget } from '../../widget/chatWidget.js';
36-
import { observeTurnStatusPillsEnabled, openChatTurnFile, previewKind } from '../../widget/chatTurnPills.js';
36+
import { openChatTurnFile, previewKind } from '../../widget/chatTurnPills.js';
3737
import { openChatFileChanges } from '../../editorChatResponseFileChangesService.js';
3838
import { ChatInputPills, StandardChatInputPillSources } from '../../chatInputPills.js';
3939
import { agentHostChangesetFileToEntryDiff } from './agentHostResponseFileChanges.js';
@@ -237,7 +237,7 @@ export class AgentHostSessionInputPills extends Disposable {
237237
) {
238238
super();
239239

240-
const pillsEnabled = observeTurnStatusPillsEnabled(this._configurationService);
240+
const pillsEnabled = constObservable(true);
241241
const sessionResource = observableFromEvent(this, this._widget.onDidChangeViewModel, () => this._widget.viewModel?.sessionResource);
242242
const sessionResolutionChanged = observableSignalFromEvent(this, connectionsService.onDidChangeSessionResolution);
243243
const resolution = derivedOpts<IAgentHostSessionResolution | undefined>({ owner: this, equalsFn: resolutionEquals }, reader => {
@@ -247,7 +247,7 @@ export class AgentHostSessionInputPills extends Disposable {
247247
});
248248
const sessionStateSource = derived(this, reader => {
249249
const current = resolution.read(reader);
250-
if (!current || !pillsEnabled.read(reader)) {
250+
if (!current) {
251251
return constObservable<SessionState | undefined>(undefined);
252252
}
253253
const subscription = reader.store.add(current.connection.getSubscription(StateComponents.Session, current.backendSession, 'AgentHostSessionInputPills'));
@@ -312,7 +312,7 @@ export class AgentHostSessionInputPills extends Disposable {
312312
const browserInputs = derived(this, reader => {
313313
this._browserChanged.read(reader);
314314
const resource = sessionResource.read(reader);
315-
if (!resource || !resolution.read(reader) || !pillsEnabled.read(reader)) {
315+
if (!resource || !resolution.read(reader)) {
316316
return [];
317317
}
318318
const ownerIds = getAgentHostSessionBrowserOwnerIds(resource, sessionState.read(reader));

src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,37 +1062,6 @@ configurationRegistry.registerConfiguration({
10621062
description: nls.localize('chat.checkpoints.showFileChanges', "Controls whether to show chat checkpoint file changes."),
10631063
default: false
10641064
},
1065-
[ChatConfiguration.TurnStatusPills]: {
1066-
anyOf: [
1067-
{
1068-
type: 'boolean',
1069-
},
1070-
{
1071-
type: 'object',
1072-
properties: {
1073-
changes: {
1074-
type: 'boolean',
1075-
default: false,
1076-
description: nls.localize('chat.turnStatusPills.changes', "Show a pill summarizing the files changed and the lines added and removed in the turn."),
1077-
},
1078-
preview: {
1079-
type: 'boolean',
1080-
default: false,
1081-
description: nls.localize('chat.turnStatusPills.preview', "Show a pill to preview a Markdown or HTML file created or edited in the turn."),
1082-
},
1083-
browser: {
1084-
type: 'boolean',
1085-
default: false,
1086-
description: nls.localize('chat.turnStatusPills.browser', "Show a pill for browser activity in the turn."),
1087-
},
1088-
},
1089-
additionalProperties: false,
1090-
deprecationMessage: nls.localize('chat.turnStatusPills.objectDeprecated', "The per-pill object form is deprecated. Use a boolean value instead."),
1091-
},
1092-
],
1093-
markdownDescription: nls.localize('chat.turnStatusPills', "Controls whether agent status pills are shown above the chat input and inside completed responses. Only applies to agent sessions."),
1094-
default: true,
1095-
},
10961065
[mcpAccessConfig]: {
10971066
type: 'string',
10981067
description: nls.localize('chat.mcp.access', "Controls access to installed Model Context Protocol servers."),

src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTurnPillsPart.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IEditSessionEntryDiff } from '../../../common/editing/chatEditingServic
1919
import { IChatRendererContent, IChatTurnPillsPart } from '../../../common/model/chatViewModel.js';
2020
import { ChatTreeItem } from '../../chat.js';
2121
import { AUTHORITATIVE_EMPTY_CHAT_RESPONSE_FILE_CHANGES, IChatResponseFileChangesService } from '../../chatResponseFileChangesService.js';
22-
import { EMPTY_DIFF_STATS, IDiffStats, observeTurnStatusPillsEnabled } from '../chatTurnPills.js';
22+
import { EMPTY_DIFF_STATS, IDiffStats } from '../chatTurnPills.js';
2323
import { renderChangesSummaryFileList } from './chatChangesSummaryPart.js';
2424
import { ChatCollapsibleContentPart } from './chatCollapsibleContentPart.js';
2525
import { IChatContentPart, IChatContentPartRenderContext } from './chatContentParts.js';
@@ -77,9 +77,7 @@ export class ChatTurnPillsContentPart extends Disposable implements IChatContent
7777
return { files: diffs.length, insertions, deletions };
7878
});
7979

80-
const turnStatusPillsEnabled = observeTurnStatusPillsEnabled(this._configurationService);
81-
const changesEnabled = derived(this, reader => turnStatusPillsEnabled.read(reader));
82-
const showChanges = derived(this, reader => changesEnabled.read(reader) && stats.read(reader).files > 0);
80+
const showChanges = derived(this, reader => stats.read(reader).files > 0);
8381

8482
const root = this.domNode.appendChild($('.checkpoint-file-changes-summary.checkpoint-file-changes-compact'));
8583
const details = root.appendChild(document.createElement('details'));

src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ import { ChatAttachmentsContentPart } from './chatContentParts/chatAttachmentsCo
8787
import { ChatAutoModeResolutionContentPart } from './chatContentParts/chatAutoModeResolutionContentPart.js';
8888
import { ChatCheckpointFileChangesSummaryContentPart } from './chatContentParts/chatChangesSummaryPart.js';
8989
import { ChatTurnPillsContentPart } from './chatContentParts/chatTurnPillsPart.js';
90-
import { ChatTurnStatusPillsSetting, isChatTurnStatusPillsEnabled } from './chatTurnPills.js';
9190
import { ChatCodeCitationContentPart } from './chatContentParts/chatCodeCitationContentPart.js';
9291
import { ChatCollapsibleContentPart } from './chatContentParts/chatCollapsibleContentPart.js';
9392
import { ChatCommandButtonContentPart } from './chatContentParts/chatCommandContentPart.js';
@@ -597,8 +596,8 @@ export function shouldShowFileChangesSummaryForSettings(isComplete: boolean, isL
597596
return isComplete && isLocalSession && showFileChanges;
598597
}
599598

600-
export function shouldShowPillsSummaryForSettings(isComplete: boolean, isAgentHostSession: boolean, turnStatusPills: ChatTurnStatusPillsSetting | undefined): boolean {
601-
return isComplete && isAgentHostSession && isChatTurnStatusPillsEnabled(turnStatusPills);
599+
export function shouldShowTurnPillsSummary(isComplete: boolean, isAgentHostSession: boolean): boolean {
600+
return isComplete && isAgentHostSession;
602601
}
603602

604603
export function shouldPinToolInvocationToThinking(state: IChatToolInvocation.StateKind, hasConfirmationMessages: boolean, hasMcpAppData: boolean): boolean {
@@ -3127,10 +3126,9 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
31273126
}
31283127

31293128
private shouldShowPillsSummary(element: IChatResponseViewModel): boolean {
3130-
return shouldShowPillsSummaryForSettings(
3129+
return shouldShowTurnPillsSummary(
31313130
element.isComplete,
31323131
isAgentHostTarget(getChatSessionType(element.sessionResource)),
3133-
this.configService.getValue<ChatTurnStatusPillsSetting | undefined>(ChatConfiguration.TurnStatusPills),
31343132
);
31353133
}
31363134

src/vs/workbench/contrib/chat/browser/widget/chatTurnPills.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ import { localize } from '../../../../../nls.js';
1515
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';
1616
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
1717
import { IOpenerService } from '../../../../../platform/opener/common/opener.js';
18-
import { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js';
1918
import { DEFAULT_LABELS_CONTAINER, ResourceLabels } from '../../../../browser/labels.js';
2019
import { BrowserViewEditorId } from '../../../browserView/common/browserView.js';
21-
import { ChatConfiguration } from '../../common/constants.js';
2220
import { getEditorOverrideForChatResource } from './chatEditorAssociations.js';
2321
import { ChatPillsWidget, getChatPillEntries, IChatPill, type IChatPillSection } from '../../../../browser/chatPills.js';
2422
import { ChatChangesPillActionViewItem } from '../../../../browser/chatChangesPill.js';
@@ -114,26 +112,6 @@ export interface IChatTurnPillsModel {
114112
openChanges(): void;
115113
}
116114

117-
/** The former per-pill setting shape, retained for existing user settings. */
118-
export interface IChatTurnStatusPillsLegacyConfig {
119-
readonly changes?: boolean;
120-
readonly preview?: boolean;
121-
readonly browser?: boolean;
122-
}
123-
124-
export type ChatTurnStatusPillsSetting = boolean | IChatTurnStatusPillsLegacyConfig;
125-
126-
/** Normalize the boolean setting and its legacy per-pill object form. */
127-
export function isChatTurnStatusPillsEnabled(value: ChatTurnStatusPillsSetting | undefined): boolean {
128-
return typeof value === 'boolean' ? value : !!(value?.changes || value?.preview || value?.browser);
129-
}
130-
131-
/** Observe whether agent turn status pills are enabled. */
132-
export function observeTurnStatusPillsEnabled(configurationService: IConfigurationService): IObservable<boolean> {
133-
const value = observableConfigValue<ChatTurnStatusPillsSetting>(ChatConfiguration.TurnStatusPills, true, configurationService);
134-
return derived(reader => isChatTurnStatusPillsEnabled(value.read(reader)));
135-
}
136-
137115
/**
138116
* A toolbar of clickable pills reflecting a single turn's status. Used both as a
139117
* floating widget above the chat input (live, active turn) and inside a completed

src/vs/workbench/contrib/chat/common/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ export enum ChatConfiguration {
128128
DefaultToCopilotHarness = 'chat.defaultToCopilotHarness',
129129
EditorLocalAgentEnabled = 'chat.editor.localAgent.enabled',
130130
AgentsHandoffTipMode = 'chat.agentsHandoffTip.mode',
131-
TurnStatusPills = 'chat.turnStatusPills',
132131

133132
IncrementalRendering = 'chat.experimental.incrementalRendering.enabled',
134133
IncrementalRenderingStyle = 'chat.experimental.incrementalRendering.animationStyle',

0 commit comments

Comments
 (0)