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

This commit is contained in:
eggfriedrice authored and GitHub committed 2026-03-12 10:44:16 -07:00
1 parent a01d712751
commit a33cc8c758
3 files changed
+5 -7

No files matched your search

+1 -1
View File
@@ -1003,7 +1003,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
replace: true,
search: (previous) => {
const rest = stripDiffSearchParams(previous);
return diffOpen ? rest : { ...rest, diff: "1" };
return diffOpen ? { ...rest, diff: undefined } : { ...rest, diff: "1" };
},
});
}, [diffOpen, navigate, threadId]);
+3 -3
View File
@@ -1,9 +1,9 @@
import { TurnId } from "@t3tools/contracts";
export interface DiffRouteSearch {
diff?: "1";
diffTurnId?: TurnId;
diffFilePath?: string;
diff?: "1" | undefined;
diffTurnId?: TurnId | undefined;
diffFilePath?: string | undefined;
}
function isDiffOpenValue(value: unknown): boolean {
+1 -3
View File
@@ -170,9 +170,7 @@ function ChatThreadRouteView() {
void navigate({
to: "/$threadId",
params: { threadId },
search: (previous) => {
return stripDiffSearchParams(previous);
},
search: { diff: undefined },
});
}, [navigate, threadId]);
const openDiff = useCallback(() => {