From a7a2faebc5aeb21bba25d478f97ca38a85de430b Mon Sep 17 00:00:00 2001 From: BinBandit Date: Mon, 9 Mar 2026 13:14:38 +1100 Subject: [PATCH] refactor(web): remove redundant double parse of diff route search params `rawSearch` is already the output of `parseDiffRouteSearch` via the `useSearch` select transform. The `useMemo` at line 760 re-parsed it through the same function with an unsafe `as Record` cast, producing an identical result. Use `rawSearch` directly instead. --- apps/web/src/components/ChatView.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index a96b17bdb76..69a4c377003 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -757,11 +757,7 @@ export default function ChatView({ threadId }: ChatViewProps) { composerDraft.interactionMode ?? activeThread?.interactionMode ?? DEFAULT_INTERACTION_MODE; const isServerThread = serverThread !== undefined; const isLocalDraftThread = !isServerThread && localDraftThread !== undefined; - const diffSearch = useMemo( - () => parseDiffRouteSearch(rawSearch as Record), - [rawSearch], - ); - const diffOpen = diffSearch.diff === "1"; + const diffOpen = rawSearch.diff === "1"; const activeThreadId = activeThread?.id ?? null; const activeLatestTurn = activeThread?.latestTurn ?? null; const latestTurnSettled = isLatestTurnSettled(activeLatestTurn, activeThread?.session ?? null);