@devries-cameron20 / t3code-1 / commits / 6d22719b03
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

perf(web): the command palette results compile without manual memoization (#20579)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 22:05 UTC 6d22719b03cb25f11fa1b843bcd966dff4ba4ae9
1 file changed +3 -3
apps/web/src/components/CommandPaletteResults.tsx
+3 -3
@@ -1,7 +1,7 @@
1 import { type ResolvedKeybindingsConfig } from "@t3tools/contracts";
2 import { LegendList, type LegendListRef } from "@legendapp/list/react";
3 import { ChevronRightIcon } from "lucide-react";
4 -import { type RefObject, useCallback, useState } from "react";
4 +import { type RefObject, useState } from "react";
5 import { cn } from "~/lib/utils";
6 import { shortcutLabelForCommand } from "../keybindings";
7 import {
@@ -96,7 +96,7 @@ interface CommandPaletteVirtualizedResultsProps extends Omit<CommandPaletteResul
96 export function CommandPaletteVirtualizedResults(props: CommandPaletteVirtualizedResultsProps) {
97 const { listRef } = props;
98 const [scrollFade, setScrollFade] = useState({ top: false, bottom: false });
99 - const updateScrollFade = useCallback(() => {
99 + const updateScrollFade = () => {
100 const scrollElement = listRef.current?.getScrollableNode?.();
101 if (!(scrollElement instanceof HTMLElement)) return;
102 const top = scrollElement.scrollTop > 1;
@@ -105,7 +105,7 @@ export function CommandPaletteVirtualizedResults(props: CommandPaletteVirtualize
105 setScrollFade((current) =>
106 current.top === top && current.bottom === bottom ? current : { top, bottom },
107 );
108 - }, [listRef]);
108 + };
109
110 if (props.rows.length === 0) {
111 return <CommandPaletteEmptyState {...props} />;