Skip to content

Add telemetry for chat todo list widget interactions#305747

Merged
bhavyaus merged 1 commit intomainfrom
dev/bhavyau/todo-list-widget-telemetry
Mar 27, 2026
Merged

Add telemetry for chat todo list widget interactions#305747
bhavyaus merged 1 commit intomainfrom
dev/bhavyau/todo-list-widget-telemetry

Conversation

@bhavyaus
Copy link
Copy Markdown
Collaborator

Adds a chatTodoListWidget telemetry event to track user interactions with the todo list widget:

  • expand — user expands the todo list
  • collapse — user collapses the todo list
  • clear — user clicks the clear button (X)

Each event includes the todoCount at 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.

Copilot AI review requested due to automatic review settings March 27, 2026 17:22
@bhavyaus bhavyaus force-pushed the dev/bhavyau/todo-list-widget-telemetry branch from 1e697b0 to d9ffa18 Compare March 27, 2026 17:23
@vs-code-engineering vs-code-engineering bot added this to the Backlog milestone Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ITelemetryService into ChatTodoListWidget.
  • Logs a new chatTodoListWidget telemetry event for expand, collapse, and clear actions with todoCount.
  • 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() calls getTodos(this._currentSessionResource) twice (once to compute todoCount and 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 ChatTodoListWidget browser tests don't cover these new events. Adding assertions (with a stubbed/test ITelemetryService) 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
			}
		);

@bhavyaus bhavyaus enabled auto-merge (squash) March 27, 2026 18:03
@bhavyaus bhavyaus merged commit 483f2ca into main Mar 27, 2026
18 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/todo-list-widget-telemetry branch March 27, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants