Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix:diff panel doesnt collapse #992

ClosedHeinrich-XIAO(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/992/headopened View on GitHub

Showing 2 changed files with 45 additions and 5 deletions.

x
0 of 2 viewed, 2 left
3 additions and 1 deletionapps/web/src/components/ChatView.tsxModified
View file
@@ -1027,7 +1027,9 @@
replace: true,
search: (previous) => {
const rest = stripDiffSearchParams(previous);
- return diffOpen ? { ...rest, diff: undefined } : { ...rest, diff: "1" };
+ return diffOpen
+ ? { ...rest, clearDiff: "1" as const }
+ : { ...rest, diff: "1" };
}, [diffOpen, navigate, threadId]);
42 additions and 4 deletionsapps/web/src/routes/_chat.$threadId.tsxModified
View file
@@ -1,5 +1,5 @@
import { ThreadId } from "@t3tools/contracts";
-import { createFileRoute, retainSearchParams, useNavigate } from "@tanstack/react-router";
+import { createFileRoute, stripSearchParams, useNavigate } from "@tanstack/react-router";
import { Suspense, lazy, type ReactNode, useCallback, useEffect } from "react";
​
import ChatView from "../components/ChatView";
@@ -20,6 +20,36 @@
const DIFF_INLINE_DEFAULT_WIDTH = "clamp(28rem,48vw,44rem)";
const DIFF_INLINE_SIDEBAR_MIN_WIDTH = 26 * 16;
const COMPOSER_COMPACT_MIN_LEFT_CONTROLS_WIDTH_PX = 208;
+const CLEAR_DIFF_SEARCH_VALUE = "1";
+​
+type ChatThreadRouteSearch = DiffRouteSearch & {
+ clearDiff?: typeof CLEAR_DIFF_SEARCH_VALUE;