authorgravatar for crazywolf132@gmail.com0x1f99d <crazywolf132@gmail.com> 2026-03-09 15:55:09+11:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-08 21:55:09-07:00
log8e8904a159e3b29fa1eae0e6f023872ef03a3f63
tree1c7fb975268454a059dc9f79a093a0a7b77ce7f1
parent16f3490aee9ab9928ae7ac084117517495155e96
signature Signed by PGP key B5690EEEBB952194

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<string, unknown>` cast, producing an identical result. Use `rawSearch` directly instead.

1 files changed, 1 insertions(+), 5 deletions(-)

apps/web/src/components/ChatView.tsx+1-5
...@@ -753,11 +753,7 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -753,11 +753,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
753 composerDraft.interactionMode ?? activeThread?.interactionMode ?? DEFAULT_INTERACTION_MODE;753 composerDraft.interactionMode ?? activeThread?.interactionMode ?? DEFAULT_INTERACTION_MODE;
754 const isServerThread = serverThread !== undefined;754 const isServerThread = serverThread !== undefined;
755 const isLocalDraftThread = !isServerThread && localDraftThread !== undefined;755 const isLocalDraftThread = !isServerThread && localDraftThread !== undefined;
756 const diffSearch = useMemo(756 const diffOpen = rawSearch.diff === "1";
757 () => parseDiffRouteSearch(rawSearch as Record<string, unknown>),
758 [rawSearch],
759 );
760 const diffOpen = diffSearch.diff === "1";
761 const activeThreadId = activeThread?.id ?? null;757 const activeThreadId = activeThread?.id ?? null;
762 const activeLatestTurn = activeThread?.latestTurn ?? null;758 const activeLatestTurn = activeThread?.latestTurn ?? null;
763 const latestTurnSettled = isLatestTurnSettled(activeLatestTurn, activeThread?.session ?? null);759 const latestTurnSettled = isLatestTurnSettled(activeLatestTurn, activeThread?.session ?? null);