authorgravatar for eggfriedricew.g.o@gmail.comeggfriedrice <eggfriedricew.g.o@gmail.com> 2026-03-12 17:44:16+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-12 10:44:16-07:00
loga33cc8c75874bf89050ae90c58c5b6227debd4e2
tree72df57bc37a63f3b58b8b12cc779e25643b1b5c9
parenta01d712751f8103001b5e728d64c12bc7c3d652a
signature Signed by PGP key B5690EEEBB952194

fix: diff panel unclosable after retainSearchParams middleware (#937)


3 files changed, 5 insertions(+), 7 deletions(-)

apps/web/src/components/ChatView.tsx+1-1
...@@ -1003,7 +1003,7 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -1003,7 +1003,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
1003 replace: true,1003 replace: true,
1004 search: (previous) => {1004 search: (previous) => {
1005 const rest = stripDiffSearchParams(previous);1005 const rest = stripDiffSearchParams(previous);
1006 return diffOpen ? rest : { ...rest, diff: "1" };1006 return diffOpen ? { ...rest, diff: undefined } : { ...rest, diff: "1" };
1007 },1007 },
1008 });1008 });
1009 }, [diffOpen, navigate, threadId]);1009 }, [diffOpen, navigate, threadId]);
apps/web/src/diffRouteSearch.ts+3-3
...@@ -1,9 +1,9 @@...@@ -1,9 +1,9 @@
1import { TurnId } from "@t3tools/contracts";1import { TurnId } from "@t3tools/contracts";
22
3export interface DiffRouteSearch {3export interface DiffRouteSearch {
4 diff?: "1";4 diff?: "1" | undefined;
5 diffTurnId?: TurnId;5 diffTurnId?: TurnId | undefined;
6 diffFilePath?: string;6 diffFilePath?: string | undefined;
7}7}
88
9function isDiffOpenValue(value: unknown): boolean {9function isDiffOpenValue(value: unknown): boolean {
apps/web/src/routes/_chat.$threadId.tsx+1-3
...@@ -170,9 +170,7 @@ function ChatThreadRouteView() {...@@ -170,9 +170,7 @@ function ChatThreadRouteView() {
170 void navigate({170 void navigate({
171 to: "/$threadId",171 to: "/$threadId",
172 params: { threadId },172 params: { threadId },
173 search: (previous) => {173 search: { diff: undefined },
174 return stripDiffSearchParams(previous);
175 },
176 });174 });
177 }, [navigate, threadId]);175 }, [navigate, threadId]);
178 const openDiff = useCallback(() => {176 const openDiff = useCallback(() => {