The best way to control Claude Code, Codex and more from any computer or phone
fix(web): scroll project picker to top on first result (#34113)
Yash Singh committed
Nov 10, 2026 at 18:23 UTC
1d80047048c29c9ce91c1509200d07788aaad1a8
2 files changed
+15
-2
apps/web/src/components/CommandPalette.tsx
+6
-1
@@ -2650,6 +2650,7 @@ function OpenCommandPaletteDialog(props: {
2650
scrollCommandPaletteRowIntoView(
2651
resultListRef.current,
2652
resultRows.rowIndexByItemIndex[0] ?? 0,
2653
+ true,
2654
);
2655
return;
2656
}
@@ -2921,7 +2922,11 @@ function OpenCommandPaletteDialog(props: {
2922
setHighlightedItemValue(typeof value === "string" ? value : null);
2923
const rowIndex = resultRows.rowIndexByItemIndex[eventDetails.index];
2924
if (eventDetails.reason === "keyboard" && rowIndex !== undefined) {
2924
- scrollCommandPaletteRowIntoView(resultListRef.current, rowIndex);
2925
+ scrollCommandPaletteRowIntoView(
2926
+ resultListRef.current,
2927
+ rowIndex,
2928
+ eventDetails.index === 0,
2929
+ );
2930
}
2931
}}
2932
onValueChange={(nextQuery, { event }) => handleQueryChange(nextQuery, event.target)}
apps/web/src/components/CommandPaletteResults.tsx
+9
-1
@@ -78,7 +78,15 @@ export function CommandPaletteResults(props: CommandPaletteResultsProps) {
78
);
79
}
80
81
-export function scrollCommandPaletteRowIntoView(list: LegendListRef | null, rowIndex: number) {
81
+export function scrollCommandPaletteRowIntoView(
82
+ list: LegendListRef | null,
83
+ rowIndex: number,
84
+ isFirstItem: boolean,
85
+) {
86
+ if (isFirstItem) {
87
+ void list?.scrollToOffset({ offset: 0, animated: false });
88
+ return;
89
+ }
90
void list?.scrollIndexIntoView({
91
index: rowIndex,
92
animated: false,