Skip to content

Commit 03548f6

Browse files
authored
Rename tasks -> todo list (microsoft#257951)
1 parent 7d9aa7e commit 03548f6

File tree

11 files changed

+167
-167
lines changed

11 files changed

+167
-167
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ import { ChatDynamicVariableModel } from './contrib/chatDynamicVariables.js';
114114
import { ChatAttachmentResolveService, IChatAttachmentResolveService } from './chatAttachmentResolveService.js';
115115
import { registerLanguageModelActions } from './actions/chatLanguageModelActions.js';
116116
import { PromptUrlHandler } from './promptSyntax/promptUrlHandler.js';
117-
import { ChatTaskServiceImpl, IChatTasksService } from '../common/chatTasksService.js';
117+
import { ChatTodoListService, IChatTodoListService } from '../common/chatTodoListService.js';
118118
import { ChatOutputRendererService, IChatOutputRendererService } from './chatOutputItemRenderer.js';
119119
import { AssistedTypes, AddConfigurationType } from '../../mcp/browser/mcpCommandsAddConfiguration.js';
120120
import { ChatSessionsView } from './chatSessions.js';
@@ -546,10 +546,10 @@ configurationRegistry.registerConfiguration({
546546
mode: 'startup'
547547
}
548548
},
549-
'chat.manageTasksTool.enabled': {
549+
'chat.todoListTool.enabled': {
550550
type: 'boolean',
551551
default: false,
552-
description: nls.localize('chat.manageTasksTool.enabled', "Enables manageTasksTool in chat. This tool allows you to use task lists in chat."),
552+
description: nls.localize('chat.todoListTool.enabled', "Enables todo lists in chat. This tool allows you to use todo lists in chat."),
553553
tags: ['experimental'],
554554
included: false,
555555
},
@@ -841,7 +841,7 @@ registerSingleton(IPromptsService, PromptsService, InstantiationType.Delayed);
841841
registerSingleton(IChatContextPickService, ChatContextPickService, InstantiationType.Delayed);
842842
registerSingleton(IChatModeService, ChatModeService, InstantiationType.Delayed);
843843
registerSingleton(IChatAttachmentResolveService, ChatAttachmentResolveService, InstantiationType.Delayed);
844-
registerSingleton(IChatTasksService, ChatTaskServiceImpl, InstantiationType.Delayed);
844+
registerSingleton(IChatTodoListService, ChatTodoListService, InstantiationType.Delayed);
845845
registerSingleton(IChatOutputRendererService, ChatOutputRendererService, InstantiationType.Delayed);
846846

847847
registerWorkbenchContribution2(ChatEditingNotebookFileSystemProviderContrib.ID, ChatEditingNotebookFileSystemProviderContrib, WorkbenchPhase.BlockStartup);

src/vs/workbench/contrib/chat/browser/chatContentParts/chatStickyTaskWidget.ts renamed to src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,54 @@ import * as dom from '../../../../../base/browser/dom.js';
77
import { Emitter, Event } from '../../../../../base/common/event.js';
88
import { Disposable } from '../../../../../base/common/lifecycle.js';
99
import { localize } from '../../../../../nls.js';
10-
import { IChatTasksService, IChatTask } from '../../common/chatTasksService.js';
10+
import { IChatTodoListService, IChatTodo } from '../../common/chatTodoListService.js';
1111

12-
export class ChatStickyTaskWidget extends Disposable {
12+
export class ChatTodoListWidget extends Disposable {
1313
public readonly domNode: HTMLElement;
1414

1515
private readonly _onDidChangeHeight = this._register(new Emitter<void>());
1616
public readonly onDidChangeHeight: Event<void> = this._onDidChangeHeight.event;
1717

1818
private _isExpanded: boolean = true;
1919
private expandoElement!: HTMLElement;
20-
private taskListContainer!: HTMLElement;
20+
private todoListContainer!: HTMLElement;
2121
private _currentSessionId: string | undefined;
2222

2323
constructor(
24-
@IChatTasksService private readonly chatTasksService: IChatTasksService
24+
@IChatTodoListService private readonly chatTodoListService: IChatTodoListService
2525
) {
2626
super();
2727

28-
this.domNode = this.createStickyTaskWidget();
28+
this.domNode = this.createChatTodoWidget();
2929
}
3030

3131
public get height(): number {
3232
return this.domNode.style.display === 'none' ? 0 : this.domNode.offsetHeight;
3333
}
3434

35-
private createStickyTaskWidget(): HTMLElement {
36-
const container = dom.$('.chat-sticky-task-widget');
35+
private createChatTodoWidget(): HTMLElement {
36+
const container = dom.$('.chat-todo-list-widget');
3737
container.style.display = 'none';
3838

39-
this.expandoElement = dom.$('.task-expando');
39+
this.expandoElement = dom.$('.todo-list-expand');
4040
this.expandoElement.setAttribute('role', 'button');
4141
this.expandoElement.setAttribute('aria-expanded', 'true');
4242
this.expandoElement.setAttribute('tabindex', '0');
4343

4444
const expandIcon = dom.$('.expand-icon.codicon');
4545
expandIcon.classList.add(this._isExpanded ? 'codicon-chevron-down' : 'codicon-chevron-right');
4646

47-
const titleElement = dom.$('.task-title');
48-
titleElement.textContent = localize('chat.task.title', 'Tasks');
47+
const titleElement = dom.$('.todo-list-title');
48+
titleElement.textContent = localize('chat.todoList.title', 'Tasks');
4949

5050
this.expandoElement.appendChild(expandIcon);
5151
this.expandoElement.appendChild(titleElement);
5252

53-
this.taskListContainer = dom.$('.task-list-container');
54-
this.taskListContainer.style.display = this._isExpanded ? 'block' : 'none';
53+
this.todoListContainer = dom.$('.todo-list-container');
54+
this.todoListContainer.style.display = this._isExpanded ? 'block' : 'none';
5555

5656
container.appendChild(this.expandoElement);
57-
container.appendChild(this.taskListContainer);
57+
container.appendChild(this.todoListContainer);
5858

5959
this._register(dom.addDisposableListener(this.expandoElement, 'click', () => {
6060
this.toggleExpanded();
@@ -72,21 +72,21 @@ export class ChatStickyTaskWidget extends Disposable {
7272

7373
public updateSessionId(sessionId: string | undefined): void {
7474
this._currentSessionId = sessionId;
75-
this.updateTaskDisplay();
75+
this.updateTodoDisplay();
7676
}
7777

78-
private updateTaskDisplay(): void {
78+
private updateTodoDisplay(): void {
7979
if (!this._currentSessionId) {
8080
this.domNode.style.display = 'none';
8181
this._onDidChangeHeight.fire();
8282
return;
8383
}
8484

85-
const taskStorage = this.chatTasksService.getChatTasksStorage();
86-
const tasks = taskStorage.getTasks(this._currentSessionId);
85+
const todoListStorage = this.chatTodoListService.getChatTodoListStorage();
86+
const todoList = todoListStorage.getTodoList(this._currentSessionId);
8787

88-
if (tasks.length > 0) {
89-
this.renderTaskList(tasks);
88+
if (todoList.length > 0) {
89+
this.renderTodoList(todoList);
9090
this.domNode.style.display = 'block';
9191
} else {
9292
this.domNode.style.display = 'none';
@@ -95,32 +95,32 @@ export class ChatStickyTaskWidget extends Disposable {
9595
this._onDidChangeHeight.fire();
9696
}
9797

98-
private renderTaskList(tasks: IChatTask[]): void {
99-
this.taskListContainer.textContent = '';
98+
private renderTodoList(todoList: IChatTodo[]): void {
99+
this.todoListContainer.textContent = '';
100100

101-
const titleElement = this.expandoElement.querySelector('.task-title') as HTMLElement;
101+
const titleElement = this.expandoElement.querySelector('.todo-list-title') as HTMLElement;
102102
if (titleElement) {
103-
titleElement.textContent = `${localize('chat.task.title', 'Tasks')}`;
103+
titleElement.textContent = `${localize('chat.todoList.title', 'Tasks')}`;
104104
}
105105

106-
tasks.forEach((task, index) => {
107-
const taskElement = dom.$('.task-item');
106+
todoList.forEach((todo, index) => {
107+
const todoElement = dom.$('.todo-item');
108108

109-
const statusIcon = dom.$('.task-status-icon.codicon');
110-
statusIcon.classList.add(this.getStatusIconClass(task.status));
111-
statusIcon.style.color = this.getStatusIconColor(task.status);
109+
const statusIcon = dom.$('.todo-status-icon.codicon');
110+
statusIcon.classList.add(this.getStatusIconClass(todo.status));
111+
statusIcon.style.color = this.getStatusIconColor(todo.status);
112112

113-
const taskContent = dom.$('.task-content');
113+
const todoContent = dom.$('.todo-content');
114114

115-
const titleElement = dom.$('.task-title');
116-
titleElement.textContent = `${index + 1}. ${task.title}`;
115+
const titleElement = dom.$('.todo-title');
116+
titleElement.textContent = `${index + 1}. ${todo.title}`;
117117

118-
taskContent.appendChild(titleElement);
118+
todoContent.appendChild(titleElement);
119119

120-
taskElement.appendChild(statusIcon);
121-
taskElement.appendChild(taskContent);
120+
todoElement.appendChild(statusIcon);
121+
todoElement.appendChild(todoContent);
122122

123-
this.taskListContainer.appendChild(taskElement);
123+
this.todoListContainer.appendChild(todoElement);
124124
});
125125
}
126126

@@ -134,7 +134,7 @@ export class ChatStickyTaskWidget extends Disposable {
134134
}
135135

136136
this.expandoElement.setAttribute('aria-expanded', this._isExpanded.toString());
137-
this.taskListContainer.style.display = this._isExpanded ? 'block' : 'none';
137+
this.todoListContainer.style.display = this._isExpanded ? 'block' : 'none';
138138

139139
this._onDidChangeHeight.fire();
140140
}

src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class ChatResponseAccessibleProvider extends Disposable implements IAccessibleVi
9191
? toolInvocation.toolSpecificData.commandLine.userEdited ?? toolInvocation.toolSpecificData.commandLine.toolEdited ?? toolInvocation.toolSpecificData.commandLine.original
9292
: toolInvocation.toolSpecificData?.kind === 'extensions'
9393
? JSON.stringify(toolInvocation.toolSpecificData.extensions)
94-
: toolInvocation.toolSpecificData?.kind === 'tasks'
95-
? JSON.stringify(toolInvocation.toolSpecificData.tasks)
94+
: toolInvocation.toolSpecificData?.kind === 'todoList'
95+
? JSON.stringify(toolInvocation.toolSpecificData.todoList)
9696
: toolInvocation.toolSpecificData?.kind === 'pullRequest'
9797
? JSON.stringify(toolInvocation.toolSpecificData)
9898
: JSON.stringify(toolInvocation.toolSpecificData.rawInput);

src/vs/workbench/contrib/chat/browser/chatWidget.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ import './media/chatViewWelcome.css';
6767
import { ChatViewWelcomePart, IChatSuggestedPrompts, IChatViewWelcomeContent } from './viewsWelcome/chatViewWelcomeController.js';
6868
import { MicrotaskDelay } from '../../../../base/common/symbols.js';
6969
import { IChatRequestVariableEntry, ChatRequestVariableSet as ChatRequestVariableSet, isPromptFileVariableEntry, toPromptFileVariableEntry, PromptFileVariableKind, isPromptTextVariableEntry } from '../common/chatVariableEntries.js';
70-
import { ChatStickyTaskWidget } from './chatContentParts/chatStickyTaskWidget.js';
70+
import { ChatTodoListWidget } from './chatContentParts/chatTodoListWidget.js';
7171
import { PromptsConfig } from '../common/promptSyntax/config/config.js';
7272
import { CancellationToken } from '../../../../base/common/cancellation.js';
7373
import { ComputeAutomaticInstructions } from '../common/promptSyntax/computeAutomaticInstructions.js';
7474
import { startupExpContext, StartupExperimentGroup } from '../../../services/coreExperimentation/common/coreExperimentationService.js';
7575
import { IWorkspaceContextService, WorkbenchState } from '../../../../platform/workspace/common/workspace.js';
7676
import { IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js';
77-
import { ManageToolSettingId } from '../common/tools/manageTasksTool.js';
77+
import { TodoListToolSettingId as TodoListToolSettingId } from '../common/tools/manageTodoListTool.js';
7878

7979
const $ = dom.$;
8080

@@ -187,7 +187,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
187187

188188
private welcomeMessageContainer!: HTMLElement;
189189
private readonly welcomePart: MutableDisposable<ChatViewWelcomePart> = this._register(new MutableDisposable());
190-
private readonly stickyTaskWidget: ChatStickyTaskWidget;
190+
private readonly chatTodoListWidget: ChatTodoListWidget;
191191

192192
private bodyDimension: dom.Dimension | undefined;
193193
private visibleChangeCount = 0;
@@ -373,7 +373,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
373373
}));
374374

375375
this._codeBlockModelCollection = this._register(instantiationService.createInstance(CodeBlockModelCollection, undefined));
376-
this.stickyTaskWidget = this._register(this.instantiationService.createInstance(ChatStickyTaskWidget));
376+
this.chatTodoListWidget = this._register(this.instantiationService.createInstance(ChatTodoListWidget));
377377

378378
this._register(this.configurationService.onDidChangeConfiguration((e) => {
379379
if (e.affectsConfiguration('chat.renderRelatedFiles')) {
@@ -525,7 +525,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
525525
}
526526

527527
get contentHeight(): number {
528-
return this.input.contentHeight + this.tree.contentHeight + this.stickyTaskWidget.height;
528+
return this.input.contentHeight + this.tree.contentHeight + this.chatTodoListWidget.height;
529529
}
530530

531531
get attachmentModel(): ChatAttachmentModel {
@@ -559,8 +559,8 @@ export class ChatWidget extends Disposable implements IChatWidget {
559559
this.welcomeMessageContainer = dom.append(this.container, $('.chat-welcome-view-container', { style: 'display: none' }));
560560
this._register(dom.addStandardDisposableListener(this.welcomeMessageContainer, dom.EventType.CLICK, () => this.focusInput()));
561561

562-
dom.append(this.container, this.stickyTaskWidget.domNode);
563-
this._register(this.stickyTaskWidget.onDidChangeHeight(() => {
562+
dom.append(this.container, this.chatTodoListWidget.domNode);
563+
this._register(this.chatTodoListWidget.onDidChangeHeight(() => {
564564
if (this.bodyDimension) {
565565
this.layout(this.bodyDimension.height, this.bodyDimension.width);
566566
}
@@ -726,7 +726,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
726726
}
727727

728728
this.renderWelcomeViewContentIfNeeded();
729-
this.renderStickyTaskWidget();
729+
this.renderChatTodoListWidget();
730730

731731
this._onWillMaybeChangeHeight.fire();
732732

@@ -827,10 +827,10 @@ export class ChatWidget extends Disposable implements IChatWidget {
827827
}
828828
}
829829

830-
private renderStickyTaskWidget(): void {
831-
const isManageTasksToolEnabled = this.configurationService.getValue<boolean>(ManageToolSettingId) === true;
832-
if (isManageTasksToolEnabled) {
833-
this.stickyTaskWidget.updateSessionId(this.viewModel?.sessionId);
830+
private renderChatTodoListWidget(): void {
831+
const isChatTodoListToolEnabled = this.configurationService.getValue<boolean>(TodoListToolSettingId) === true;
832+
if (isChatTodoListToolEnabled) {
833+
this.chatTodoListWidget.updateSessionId(this.viewModel?.sessionId);
834834
}
835835
}
836836

@@ -1950,10 +1950,10 @@ export class ChatWidget extends Disposable implements IChatWidget {
19501950
}
19511951

19521952
const inputHeight = this.inputPart.inputPartHeight;
1953-
const stickyTaskWidgetHeight = this.stickyTaskWidget.height;
1953+
const chatTodoListWidgetHeight = this.chatTodoListWidget.height;
19541954
const lastElementVisible = this.tree.scrollTop + this.tree.renderHeight >= this.tree.scrollHeight - 2;
19551955

1956-
const contentHeight = Math.max(0, height - inputHeight - stickyTaskWidgetHeight);
1956+
const contentHeight = Math.max(0, height - inputHeight - chatTodoListWidgetHeight);
19571957
if (this.viewOptions.renderStyle === 'compact' || this.viewOptions.renderStyle === 'minimal') {
19581958
this.listContainer.style.removeProperty('--chat-current-response-min-height');
19591959
} else {
@@ -2018,9 +2018,9 @@ export class ChatWidget extends Disposable implements IChatWidget {
20182018
const width = this.bodyDimension?.width ?? this.container.offsetWidth;
20192019
this.input.layout(possibleMaxHeight, width);
20202020
const inputPartHeight = this.input.inputPartHeight;
2021-
const stickyTaskWidgetHeight = this.stickyTaskWidget.height;
2022-
const newHeight = Math.min(renderHeight + diff, possibleMaxHeight - inputPartHeight - stickyTaskWidgetHeight);
2023-
this.layout(newHeight + inputPartHeight + stickyTaskWidgetHeight, width);
2021+
const chatTodoListWidgetHeight = this.chatTodoListWidget.height;
2022+
const newHeight = Math.min(renderHeight + diff, possibleMaxHeight - inputPartHeight - chatTodoListWidgetHeight);
2023+
this.layout(newHeight + inputPartHeight + chatTodoListWidgetHeight, width);
20242024
});
20252025
}));
20262026
}
@@ -2063,7 +2063,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
20632063
const width = this.bodyDimension?.width ?? this.container.offsetWidth;
20642064
this.input.layout(this._dynamicMessageLayoutData.maxHeight, width);
20652065
const inputHeight = this.input.inputPartHeight;
2066-
const stickyTaskWidgetHeight = this.stickyTaskWidget.height;
2066+
const chatTodoListWidgetHeight = this.chatTodoListWidget.height;
20672067

20682068
const totalMessages = this.viewModel.getItems();
20692069
// grab the last N messages
@@ -2077,7 +2077,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
20772077
this.layout(
20782078
Math.min(
20792079
// we add an additional 18px in order to show that there is scrollable content
2080-
inputHeight + stickyTaskWidgetHeight + listHeight + (totalMessages.length > 2 ? 18 : 0),
2080+
inputHeight + chatTodoListWidgetHeight + listHeight + (totalMessages.length > 2 ? 18 : 0),
20812081
this._dynamicMessageLayoutData.maxHeight
20822082
),
20832083
width

src/vs/workbench/contrib/chat/browser/media/chat.css

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,8 +2322,8 @@ have to be updated for changes to the rules above, or to support more deeply nes
23222322
background-color: var(--vscode-toolbar-hoverBackground);
23232323
}
23242324

2325-
/* Sticky Task Widget */
2326-
.chat-sticky-task-widget {
2325+
/* Chat Todo List Widget */
2326+
.chat-todo-list-widget {
23272327
position: sticky;
23282328
top: 0;
23292329
z-index: 100;
@@ -2333,58 +2333,58 @@ have to be updated for changes to the rules above, or to support more deeply nes
23332333
margin-bottom: 8px;
23342334
}
23352335

2336-
.chat-sticky-task-widget .task-expando {
2336+
.chat-todo-list-widget .todo-list-expand {
23372337
display: flex;
23382338
align-items: center;
23392339
gap: 6px;
23402340
cursor: pointer;
23412341
padding: 4px 0;
23422342
}
23432343

2344-
.chat-sticky-task-widget .task-expando:hover {
2344+
.chat-todo-list-widget .todo-list-expand:hover {
23452345
background-color: var(--vscode-toolbar-hoverBackground);
23462346
border-radius: 4px;
23472347
}
23482348

2349-
.chat-sticky-task-widget .task-expando:focus {
2349+
.chat-todo-list-widget .todo-list-expand:focus {
23502350
outline: 1px solid var(--vscode-focusBorder);
23512351
outline-offset: 1px;
23522352
border-radius: 4px;
23532353
}
23542354

2355-
.chat-sticky-task-widget .expand-icon {
2355+
.chat-todo-list-widget .expand-icon {
23562356
flex-shrink: 0;
23572357
}
23582358

2359-
.chat-sticky-task-widget .task-title {
2359+
.chat-todo-list-widget .todo-list-title {
23602360
font-weight: 600;
23612361
color: var(--vscode-foreground);
23622362
}
23632363

2364-
.chat-sticky-task-widget .task-list-container {
2364+
.chat-todo-list-widget .todo-list-container {
23652365
padding-left: 20px;
23662366
margin-top: 4px;
23672367
}
23682368

2369-
.chat-sticky-task-widget .task-list {
2369+
.chat-todo-list-widget .todo-list {
23702370
display: flex;
23712371
flex-direction: column;
23722372
gap: 4px;
23732373
}
23742374

2375-
.chat-sticky-task-widget .task-item {
2375+
.chat-todo-list-widget .todo-item {
23762376
display: flex;
23772377
align-items: center;
23782378
gap: 8px;
23792379
padding: 2px 0;
23802380
}
23812381

2382-
.chat-sticky-task-widget .task-status-icon {
2382+
.chat-todo-list-widget .todo-status-icon {
23832383
flex-shrink: 0;
23842384
font-size: 14px;
23852385
}
23862386

2387-
.chat-sticky-task-widget .task-content {
2387+
.chat-todo-list-widget .todo-content {
23882388
color: var(--vscode-foreground);
23892389
flex-grow: 1;
23902390
}

0 commit comments

Comments
 (0)