Skip to content

Commit 80c140a

Browse files
Copilotalexr00
andcommitted
Switch from placeholder to prompt API for QuickPick feedback
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 2494fd4 commit 80c140a

4 files changed

Lines changed: 46 additions & 18 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"languageModelToolResultAudience",
3535
"markdownAlertSyntax",
3636
"quickDiffProvider",
37+
"quickPickPrompt",
3738
"remoteCodingAgents",
3839
"shareProvider",
3940
"tokenInformation",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
declare module 'vscode' {
7+
8+
// https://github.com/microsoft/vscode/issues/78335
9+
10+
export interface QuickPick<T extends QuickPickItem> extends QuickInput {
11+
/**
12+
* Optional text that provides instructions or context to the user.
13+
*
14+
* The prompt is displayed below the input box and above the list of items.
15+
*/
16+
prompt: string | undefined;
17+
}
18+
19+
export interface QuickPickOptions {
20+
/**
21+
* Optional text that provides instructions or context to the user.
22+
*
23+
* The prompt is displayed below the input box and above the list of items.
24+
*/
25+
prompt?: string;
26+
}
27+
}

src/github/issueOverview.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -448,18 +448,18 @@ export class IssueOverviewPanel<TItem extends IssueModel = IssueModel> extends W
448448
}));
449449
quickPick.selectedItems = quickPick.items.filter(item => item.picked);
450450

451-
// Update placeholder based on selection
452-
const updatePlaceholder = () => {
451+
// Update prompt based on selection
452+
const updatePrompt = () => {
453453
if (quickPick.selectedItems.length === 0) {
454-
quickPick.placeholder = vscode.l10n.t('No labels selected');
454+
quickPick.prompt = vscode.l10n.t('No labels selected');
455455
} else {
456-
quickPick.placeholder = vscode.l10n.t('Select labels');
456+
quickPick.prompt = undefined;
457457
}
458458
};
459-
updatePlaceholder();
459+
updatePrompt();
460460

461461
quickPick.onDidChangeSelection(() => {
462-
updatePlaceholder();
462+
updatePrompt();
463463
});
464464

465465
quickPick.busy = false;
@@ -539,19 +539,19 @@ export class IssueOverviewPanel<TItem extends IssueModel = IssueModel> extends W
539539
quickPick.items = await getAssigneesQuickPickItems(this._folderRepositoryManager, undefined, this._item.remote.remoteName, this._item.assignees ?? [], this._item);
540540
quickPick.selectedItems = quickPick.items.filter(item => item.picked);
541541

542-
// Update placeholder based on selection
543-
const updatePlaceholder = () => {
542+
// Update prompt based on selection
543+
const updatePrompt = () => {
544544
const selectedAssignees = quickPick.selectedItems.filter(item => item.user);
545545
if (selectedAssignees.length === 0) {
546-
quickPick.placeholder = vscode.l10n.t('No assignees selected');
546+
quickPick.prompt = vscode.l10n.t('No assignees selected');
547547
} else {
548-
quickPick.placeholder = vscode.l10n.t('Select assignees');
548+
quickPick.prompt = undefined;
549549
}
550550
};
551-
updatePlaceholder();
551+
updatePrompt();
552552

553553
quickPick.onDidChangeSelection(() => {
554-
updatePlaceholder();
554+
updatePrompt();
555555
});
556556

557557
quickPick.busy = false;

src/github/quickPicks.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,19 @@ export async function reviewersQuickPick(folderRepositoryManager: FolderReposito
249249

250250
await updateItems((teamsCount !== 0 && teamsCount <= quickMaxTeamReviewers) ? TeamReviewerRefreshKind.Try : TeamReviewerRefreshKind.None);
251251

252-
// Update placeholder based on selection
253-
const updatePlaceholder = () => {
252+
// Update prompt based on selection
253+
const updatePrompt = () => {
254254
const selectedReviewers = quickPick.selectedItems.filter(item => item.user);
255255
if (selectedReviewers.length === 0) {
256-
quickPick.placeholder = vscode.l10n.t('No reviewers selected');
256+
quickPick.prompt = vscode.l10n.t('No reviewers selected');
257257
} else {
258-
quickPick.placeholder = defaultPlaceholder;
258+
quickPick.prompt = undefined;
259259
}
260260
};
261-
updatePlaceholder();
261+
updatePrompt();
262262

263263
quickPick.onDidChangeSelection(() => {
264-
updatePlaceholder();
264+
updatePrompt();
265265
});
266266

267267
quickPick.onDidTriggerButton(() => {

0 commit comments

Comments
 (0)