diff --git a/apps/web/src/rightPanelLayout.ts b/apps/web/src/rightPanelLayout.ts
new file mode 100644
index 0000000000..c94f52a9cb
--- /dev/null
+++ b/apps/web/src/rightPanelLayout.ts
@@ -0,0 +1,2 @@
+export const RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY = "(max-width: 1180px)";
+export const RIGHT_PANEL_SHEET_CLASS_NAME = "w-[min(88vw,820px)] max-w-[820px] p-0";
diff --git a/apps/web/src/routes/_chat.$threadId.tsx b/apps/web/src/routes/_chat.$threadId.tsx
index 8e7a5d3ba8..741c74f397 100644
--- a/apps/web/src/routes/_chat.$threadId.tsx
+++ b/apps/web/src/routes/_chat.$threadId.tsx
@@ -17,12 +17,15 @@ import {
stripDiffSearchParams,
} from "../diffRouteSearch";
import { useMediaQuery } from "../hooks/useMediaQuery";
+import {
+ RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY,
+ RIGHT_PANEL_SHEET_CLASS_NAME,
+} from "../rightPanelLayout";
import { useStore } from "../store";
import { Sheet, SheetPopup } from "../components/ui/sheet";
import { Sidebar, SidebarInset, SidebarProvider, SidebarRail } from "~/components/ui/sidebar";
const DiffPanel = lazy(() => import("../components/DiffPanel"));
-const DIFF_INLINE_LAYOUT_MEDIA_QUERY = "(max-width: 1180px)";
const DIFF_INLINE_SIDEBAR_WIDTH_STORAGE_KEY = "chat_diff_sidebar_width";
const DIFF_INLINE_DEFAULT_WIDTH = "clamp(28rem,48vw,44rem)";
const DIFF_INLINE_SIDEBAR_MIN_WIDTH = 26 * 16;
@@ -46,7 +49,7 @@ const DiffPanelSheet = (props: {
side="right"
showCloseButton={false}
keepMounted
- className="w-[min(88vw,820px)] max-w-[820px] p-0"
+ className={RIGHT_PANEL_SHEET_CLASS_NAME}
>
{props.children}
@@ -173,7 +176,7 @@ function ChatThreadRouteView() {
);
const routeThreadExists = threadExists || draftThreadExists;
const diffOpen = search.diff === "1";
- const shouldUseDiffSheet = useMediaQuery(DIFF_INLINE_LAYOUT_MEDIA_QUERY);
+ const shouldUseDiffSheet = useMediaQuery(RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY);
// TanStack Router keeps active route components mounted across param-only navigations
// unless remountDeps are configured, so this stays warm across thread switches.
const [hasOpenedDiff, setHasOpenedDiff] = useState(diffOpen);