Skip to content

Commit d6720d0

Browse files
authored
Chat todos: make the label briefer for the widget (fix #273084) (#273368)
* Chat todos: make the label briefer for the widget (fix #273084) * cleanup
1 parent 13197dc commit d6720d0

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.ts

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -366,31 +366,24 @@ export class ChatTodoListWidget extends Disposable {
366366
const firstInProgressTodo = inProgressTodos.length > 0 ? inProgressTodos[0] : undefined;
367367
const notStartedTodos = todoList.filter(todo => todo.status === 'not-started');
368368
const firstNotStartedTodo = notStartedTodos.length > 0 ? notStartedTodos[0] : undefined;
369-
370-
// Calculate current task number (1-indexed)
371369
const currentTaskNumber = inProgressTodos.length > 0 ? completedCount + 1 : Math.max(1, completedCount);
372-
const progressCount = totalCount > 0 ? ` (${currentTaskNumber}/${totalCount})` : '';
373-
374-
const titleText = dom.$('span');
375-
titleText.textContent = this._isExpanded
376-
? localize('chat.todoList.title', 'Todos') + progressCount
377-
: progressCount;
378-
titleElement.appendChild(titleText);
379370

380371
const expandButtonLabel = this._isExpanded
381-
? localize('chat.todoList.collapseButton', 'Collapse Todos {0}', progressCount)
382-
: localize('chat.todoList.expandButton', 'Expand Todos {0}', progressCount);
372+
? localize('chat.todoList.collapseButton', 'Collapse Todos')
373+
: localize('chat.todoList.expandButton', 'Expand Todos');
383374
this.expandoElement.setAttribute('aria-label', expandButtonLabel);
384375
this.expandoElement.setAttribute('aria-expanded', this._isExpanded ? 'true' : 'false');
385-
if (!this._isExpanded) {
376+
377+
if (this._isExpanded) {
378+
const titleText = dom.$('span');
379+
titleText.textContent = totalCount > 0 ?
380+
localize('chat.todoList.titleWithCount', 'Todos ({0}/{1})', currentTaskNumber, totalCount) :
381+
localize('chat.todoList.title', 'Todos');
382+
titleElement.appendChild(titleText);
383+
} else {
386384
// Show first in-progress todo, or if none, the first not-started todo
387385
const todoToShow = firstInProgressTodo || firstNotStartedTodo;
388386
if (todoToShow) {
389-
const separator = dom.$('span');
390-
separator.textContent = ' - ';
391-
separator.style.marginLeft = '4px';
392-
titleElement.appendChild(separator);
393-
394387
const icon = dom.$('.codicon');
395388
if (todoToShow === firstInProgressTodo) {
396389
icon.classList.add('codicon-record');
@@ -399,13 +392,12 @@ export class ChatTodoListWidget extends Disposable {
399392
icon.classList.add('codicon-circle-outline');
400393
icon.style.color = 'var(--vscode-foreground)';
401394
}
402-
icon.style.marginLeft = '4px';
403395
icon.style.marginRight = '4px';
404396
icon.style.verticalAlign = 'middle';
405397
titleElement.appendChild(icon);
406398

407399
const todoText = dom.$('span');
408-
todoText.textContent = todoToShow.title;
400+
todoText.textContent = localize('chat.todoList.currentTask', '{0} ({1}/{2})', todoToShow.title, currentTaskNumber, totalCount);
409401
todoText.style.verticalAlign = 'middle';
410402
todoText.style.overflow = 'hidden';
411403
todoText.style.textOverflow = 'ellipsis';
@@ -415,14 +407,8 @@ export class ChatTodoListWidget extends Disposable {
415407
}
416408
// Show "Done" when all tasks are completed
417409
else if (completedCount > 0 && completedCount === totalCount) {
418-
const separator = dom.$('span');
419-
separator.textContent = ' - ';
420-
separator.style.marginLeft = '4px';
421-
titleElement.appendChild(separator);
422-
423410
const doneText = dom.$('span');
424411
doneText.textContent = localize('chat.todoList.allDone', 'Done');
425-
doneText.style.marginLeft = '4px';
426412
doneText.style.verticalAlign = 'middle';
427413
titleElement.appendChild(doneText);
428414
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,6 @@ have to be updated for changes to the rules above, or to support more deeply nes
11221122
padding-left: 3px;
11231123
display: flex;
11241124
align-items: center;
1125-
gap: 4px;
11261125
flex: 1;
11271126
font-size: 11px;
11281127
white-space: nowrap;
@@ -1177,6 +1176,7 @@ have to be updated for changes to the rules above, or to support more deeply nes
11771176

11781177
.interactive-session .interactive-input-part > .chat-todo-list-widget-container .chat-todo-list-widget .expand-icon {
11791178
flex-shrink: 0;
1179+
margin-right: 3px;
11801180
}
11811181

11821182
.interactive-session .interactive-input-part > .chat-todo-list-widget-container .chat-todo-list-widget .todo-list-title {

0 commit comments

Comments
 (0)