Skip to content

add context menu actions to tips#294002

Merged
meganrogge merged 3 commits intomainfrom
merogge/tips
Feb 10, 2026
Merged

add context menu actions to tips#294002
meganrogge merged 3 commits intomainfrom
merogge/tips

Conversation

@meganrogge
Copy link
Collaborator

@meganrogge meganrogge commented Feb 9, 2026

fixes #293507

Adds a right-click context menu to the chat tips widget with two actions: Dismiss this tip (persists the dismissal to workspace storage and cycles to the next eligible tip) and Disable Tips (turns off the chat.tips.enabled setting).

The intent is:

  • to allow users to hide tips as they learn
  • to make it easy for power users to hide this if they find it annoying
Screenshot 2026-02-09 at 1 51 56 PM

@meganrogge meganrogge requested review from Copilot and sbatten and removed request for Copilot February 9, 2026 20:12
@meganrogge meganrogge self-assigned this Feb 9, 2026
@meganrogge meganrogge added this to the February 2026 milestone Feb 9, 2026
@meganrogge meganrogge enabled auto-merge (squash) February 9, 2026 20:12
@meganrogge meganrogge requested a review from justschen February 9, 2026 20:43
Copilot AI review requested due to automatic review settings February 9, 2026 23:55
Copy link
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 a context menu to the chat tip widget so users can dismiss individual tips (persisted per-workspace) or disable tips entirely via the chat.tips.enabled setting.

Changes:

  • Introduces a new ChatTipContext menu and registers “Dismiss This Tip” / “Disable Tips” actions.
  • Extends ChatTipService to support dismiss/disable operations and emits events so the UI can react immediately.
  • Adds unit tests covering tip dismissal/disable behavior and event firing.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts Adds tests for dismiss/disable behavior and related events.
src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Wires tip rendering to the new context-menu-enabled ChatTipContentPart and handles tip hide events.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.ts Implements the tip context menu UI behavior and registers the two menu actions.
src/vs/workbench/contrib/chat/browser/chatTipService.ts Adds dismissal persistence, disable behavior, and events; excludes dismissed tips from selection.
src/vs/platform/actions/common/actions.ts Adds a new MenuId.ChatTipContext for the tip widget context menu.

templateData.value.appendChild(tipPart.domNode);
templateData.elementDisposables.add(tipPart);
templateData.elementDisposables.add(tipPart.onDidHide(() => {
tipPart.domNode.remove();
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

When the tip hides, the code removes the DOM node but does not dispose the ChatTipContentPart. That leaves it subscribed to chatTipService events (and holding onto rendered markdown) for the lifetime of the list item. Consider disposing tipPart in the onDidHide handler (or have ChatTipContentPart dispose itself after firing onDidHide).

Suggested change
tipPart.domNode.remove();
tipPart.domNode.remove();
tipPart.dispose();

Copilot uses AI. Check for mistakes.
Comment on lines 43 to +69
this.domNode = $('.chat-tip-widget');
this._renderTip(tip);

this._register(this._chatTipService.onDidDismissTip(() => {
const nextTip = this._getNextTip();
if (nextTip) {
this._renderTip(nextTip);
} else {
this._onDidHide.fire();
}
}));

this._register(this._chatTipService.onDidDisableTips(() => {
this._onDidHide.fire();
}));

this._register(dom.addDisposableListener(this.domNode, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {
dom.EventHelper.stop(e, true);
const event = new StandardMouseEvent(dom.getWindow(this.domNode), e);
this._contextMenuService.showContextMenu({
getAnchor: () => event,
getActions: () => {
const menu = this._menuService.getMenuActions(MenuId.ChatTipContext, this._contextKeyService);
return getFlatContextMenuActions(menu);
},
});
}));
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The tip widget DOM node isn’t focusable (div with no tabIndex), so keyboard-only users can’t reach it to open the context menu (e.g. via the Context Menu key / Shift+F10). Consider making .chat-tip-widget focusable (and optionally adding an ARIA label/role) so the new actions are accessible without a mouse.

Copilot uses AI. Check for mistakes.
@meganrogge meganrogge merged commit 70c8113 into main Feb 10, 2026
18 checks passed
@meganrogge meganrogge deleted the merogge/tips branch February 10, 2026 00:54
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.

add context menu to tips element

3 participants