From 664dfd138e2776f91cfd96d6fa6ce67fe21258aa Mon Sep 17 00:00:00 2001 From: LHaghfoss Date: Mon, 23 Nov 2026 20:29:35 +0100 Subject: [PATCH] fix(desktop): keep the palette's selected row in view with the neutral fill --- apps/desktop/src/design.test.ts | 1 + apps/desktop/src/ui/CommandPalette.tsx | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/design.test.ts b/apps/desktop/src/design.test.ts index 9250058ad..70d4f1491 100644 --- a/apps/desktop/src/design.test.ts +++ b/apps/desktop/src/design.test.ts @@ -43,6 +43,7 @@ const SHAPED = /(?(null); + useEffect(() => { + listRef.current?.querySelectorAll('[role="option"]')[index]?.scrollIntoView({ block: "nearest" }); + }, [index]); // biome-ignore lint/correctness/useExhaustiveDependencies: a changed result order resets keyboard selection useEffect(() => { @@ -477,7 +481,12 @@ export function CommandPalette() { -
+
{!results.length && (
Nothing matches “{q}”.
)} @@ -501,13 +510,13 @@ export function CommandPalette() { className={cx( "flex w-full items-center gap-3 rounded-lg px-3 text-left", r.kind === "thread" ? "min-h-[48px] py-2" : "min-h-[36px] py-1.5", - i === index && "bg-accent/16", + i === index && "bg-fill", r.kind === "action" && r.action.disabled && "opacity-45", )} > {r.kind === "thread" ? ( <> - + {highlight(r.title, q)} {r.detail} @@ -520,7 +529,7 @@ export function CommandPalette() { ) : ( <> - + {highlight(r.action.label, q)} {r.action.group && r.action.detail && (