From 8e8904a159e3b29fa1eae0e6f023872ef03a3f63 Mon Sep 17 00:00:00 2001 From: 0x1f99d Date: Mon, 9 Mar 2026 15:55:09 +1100 Subject: [PATCH] refactor(web): remove redundant double parse of diff route search params (#598) `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 259f055ef037bb7bd1b9119884c2e7d30024b8f5..51b300ba8ec2e7a70f2babc2438f5673c71d4450 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -753,11 +753,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); -- 2.54.0