Skip to content

Commit 1a97fe5

Browse files
authored
"Copilot on My Behalf" tooltip (#7283)
Fixes #7276
1 parent 0be4389 commit 1a97fe5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/view/treeNodes/categoryNode.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
130130
public repositoryPageInformation: Map<string, PageInformation> = new Map<string, PageInformation>();
131131
public contextValue: string;
132132
public resourceUri: vscode.Uri;
133+
public tooltip?: string | vscode.MarkdownString | undefined;
133134

134135
constructor(
135136
parent: TreeNodeParent,
@@ -145,8 +146,8 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
145146
super(parent);
146147

147148
this.prs = new Map();
148-
149-
const hasCopilotChanges = _categoryQuery && isCopilotQuery(_categoryQuery) && this._copilotManager.notificationsCount > 0;
149+
const isCopilot = _categoryQuery && isCopilotQuery(_categoryQuery);
150+
const hasCopilotChanges = isCopilot && this._copilotManager.notificationsCount > 0;
150151

151152
switch (this.type) {
152153
case PRType.All:
@@ -182,6 +183,18 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
182183
if (this._categoryQuery) {
183184
this.contextValue = 'query';
184185
}
186+
187+
if (isCopilot) {
188+
this.tooltip = vscode.l10n.t('Pull requests you asked the coding agent to create');
189+
} else if (this.type === PRType.LocalPullRequest) {
190+
this.tooltip = vscode.l10n.t('Pull requests for branches you have locally');
191+
} else if (this.type === PRType.All) {
192+
this.tooltip = vscode.l10n.t('All open pull requests in the current repository');
193+
} else if (_categoryQuery) {
194+
this.tooltip = new vscode.MarkdownString(vscode.l10n.t('Pull requests for query: `{0}`', _categoryQuery));
195+
} else {
196+
this.tooltip = this.label;
197+
}
185198
}
186199

187200
public async expandPullRequest(pullRequest: PullRequestModel, retry: boolean = true): Promise<boolean> {

0 commit comments

Comments
 (0)