Add telemetry for chat todo list widget interactions#305747
Merged
Conversation
1e697b0 to
d9ffa18
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds interaction telemetry for the chat todo list widget so product insights can measure how users engage with the widget (expand/collapse/clear) along with the current todo count.
Changes:
- Injects
ITelemetryServiceintoChatTodoListWidget. - Logs a new
chatTodoListWidgettelemetry event forexpand,collapse, andclearactions withtodoCount. - Introduces event + GDPR classification types for the new telemetry event.
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.ts:375
toggleExpanded()callsgetTodos(this._currentSessionResource)twice (once to computetodoCountand again to update the title). Consider retrieving the todo list once and reusing it for both telemetry and title update to avoid duplicated work and keep the logic in sync.
This issue also appears on line 363 of the same file.
const todoCount = this._currentSessionResource ? this.chatTodoListService.getTodos(this._currentSessionResource).length : 0;
this.telemetryService.publicLog2<ChatTodoListWidgetEvent, ChatTodoListWidgetClassification>(
'chatTodoListWidget',
{
action: this._isExpanded ? 'expand' : 'collapse',
todoCount
}
);
if (this._currentSessionResource) {
const todoList = this.chatTodoListService.getTodos(this._currentSessionResource);
this.updateTitleElement(this.titleElement, todoList);
}
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.ts:370
- Telemetry was added for expand/collapse/clear, but the existing
ChatTodoListWidgetbrowser tests don't cover these new events. Adding assertions (with a stubbed/testITelemetryService) that the correct event name + payload are logged on (1) expando click, (2) clear click, and (3) focus-triggered expansion would prevent regressions and validate the "explicit user action only" requirement for clear.
const todoCount = this._currentSessionResource ? this.chatTodoListService.getTodos(this._currentSessionResource).length : 0;
this.telemetryService.publicLog2<ChatTodoListWidgetEvent, ChatTodoListWidgetClassification>(
'chatTodoListWidget',
{
action: this._isExpanded ? 'expand' : 'collapse',
todoCount
}
);
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.ts
Show resolved
Hide resolved
Yoyokrazy
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
chatTodoListWidgettelemetry event to track user interactions with the todo list widget:Each event includes the
todoCountat the time of the action.Note: the clear event only fires on explicit user action (button click), not when todos are programmatically cleared after completion.