Skip to content

Commit deb7c68

Browse files
authored
feat(cloudwatchlogs): preserve position while loading items #3934
Problem: When trying to select a CloudWatch Log Stream, the UI scrolls to the top while fetching all streams, which is very difficult to use. Solution: Set `keepScrollPosition = true` by default. Closes #2379
1 parent b91972f commit deb7c68

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "CloudWatch Logs: Preserve quickpick menu position when loading more items."
4+
}

src/shared/ui/picker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function createQuickPick<T extends vscode.QuickPickItem>({
4747
buttons?: vscode.QuickInputButton[]
4848
}): vscode.QuickPick<T> {
4949
const picker = vscode.window.createQuickPick<T>()
50+
picker.keepScrollPosition = true
5051

5152
if (options) {
5253
picker.title = options.title

src/shared/ui/pickerPrompter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export type ExtendedQuickPickOptions<T> = Omit<
6363
errorItem?: DataQuickPickItem<T>
6464
/** Description for recently used item */
6565
recentlyUsed?: string
66+
/** Defined on `vscode.QuickPick` but not `vscode.QuickPickOptions` 🤷 */
67+
keepScrollPosition?: boolean
6668
}
6769

6870
/** See {@link ExtendedQuickPickOptions.noItemsFoundItem noItemsFoundItem} for setting a different item */
@@ -85,6 +87,7 @@ export const defaultQuickpickOptions: ExtendedQuickPickOptions<any> = {
8587
ignoreFocusOut: true,
8688
noItemsFoundItem: defaultNoItemsItem,
8789
errorItem: defaultErrorItem,
90+
keepScrollPosition: true,
8891
}
8992

9093
type QuickPickData<T> = PromptResult<T> | (() => Promise<PromptResult<T>>)

0 commit comments

Comments
 (0)