mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-20 21:18:13 +02:00
fix: gate desktop right panel to prevent duplicate mobile editor
This commit is contained in:
parent
cfafed09bc
commit
cfc3be5b1f
1 changed files with 5 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import { rightPanelCollapsedAtom, rightPanelTabAtom } from "@/atoms/layout/right
|
|||
import { Button } from "@/components/ui/button";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { closeHitlEditPanelAtom, hitlEditPanelAtom } from "@/features/chat-messages/hitl";
|
||||
import { useMediaQuery } from "@/hooks/use-media-query";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { DocumentsSidebar } from "../sidebar";
|
||||
|
||||
|
|
@ -196,6 +197,9 @@ export function RightPanel({
|
|||
const citationState = useAtomValue(citationPanelAtom);
|
||||
const closeCitation = useSetAtom(closeCitationPanelAtom);
|
||||
const [collapsed, setCollapsed] = useAtom(rightPanelCollapsedAtom);
|
||||
// Desktop-only surface; mobile uses the dedicated Mobile* drawers. Without
|
||||
// this guard both render together and two editors fight over one model.
|
||||
const isDesktop = useMediaQuery("(min-width: 1024px)");
|
||||
|
||||
const documentsOpen = documentsPanel?.open ?? false;
|
||||
const reportOpen = reportState.isOpen && !!reportState.reportId;
|
||||
|
|
@ -267,7 +271,7 @@ export function RightPanel({
|
|||
<CollapseButton onClick={() => setCollapsed(true)} />
|
||||
) : null;
|
||||
|
||||
if (!isVisible) return null;
|
||||
if (!isVisible || !isDesktop) return null;
|
||||
|
||||
return (
|
||||
<aside
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue