From 7a3f99c4f2fd62a0db5647a8a0c076c51bcf0977 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:12:38 +0530 Subject: [PATCH] refactor(editor-panel): enhance layout and styling for improved usability - Updated the EditorPanelContent to streamline the header layout and improve button styling for closing the panel. - Adjusted the grid layout for better alignment and spacing, enhancing the overall user experience. - Integrated a vertical separator with updated styling for a more cohesive design. --- .../components/editor-panel/editor-panel.tsx | 31 ++--- .../layout/ui/right-panel/RightPanel.tsx | 128 ++++++++++-------- 2 files changed, 87 insertions(+), 72 deletions(-) diff --git a/surfsense_web/components/editor-panel/editor-panel.tsx b/surfsense_web/components/editor-panel/editor-panel.tsx index dfaeeba96..4f2f598d8 100644 --- a/surfsense_web/components/editor-panel/editor-panel.tsx +++ b/surfsense_web/components/editor-panel/editor-panel.tsx @@ -574,28 +574,14 @@ export function EditorPanelContent({ <> {showDesktopHeader ? (
-
-

File

-
- -
-
-
+

{displayTitle}

{memoryLimitState && ( <> {memoryLimitState.label} @@ -671,6 +657,19 @@ export function EditorPanelContent({ )} )} + +
diff --git a/surfsense_web/components/layout/ui/right-panel/RightPanel.tsx b/surfsense_web/components/layout/ui/right-panel/RightPanel.tsx index 80f9cf002..15025f4eb 100644 --- a/surfsense_web/components/layout/ui/right-panel/RightPanel.tsx +++ b/surfsense_web/components/layout/ui/right-panel/RightPanel.tsx @@ -2,6 +2,7 @@ import { useAtom, useAtomValue, useSetAtom } from "jotai"; import { PanelRight } from "lucide-react"; +import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import dynamic from "next/dynamic"; import { startTransition, useEffect } from "react"; import { closeReportPanelAtom, reportPanelAtom } from "@/atoms/chat/report-panel.atom"; @@ -161,6 +162,11 @@ const PANEL_WIDTHS = { artifacts: 420, } as const; +const PANEL_SLIDE_TRANSITION = { + duration: 0.2, + ease: [0.22, 1, 0.36, 1], +} as const; + /** * Priority order used to fall back to another open surface when the active * tab's content closes. The neutral "sources" tab is kept as the closed state. @@ -195,6 +201,7 @@ export function RightPanel({ showTopBorder = false }: RightPanelProps) { const artifactsOpen = useAtomValue(artifactsPanelOpenAtom); const closeArtifacts = useSetAtom(closeArtifactsPanelAtom); const [collapsed] = useAtom(rightPanelCollapsedAtom); + const reduceMotion = useReducedMotion(); const reportOpen = reportState.isOpen && !!reportState.reportId; const editorOpen = @@ -246,64 +253,73 @@ export function RightPanel({ showTopBorder = false }: RightPanelProps) { }); const targetWidth = PANEL_WIDTHS[effectiveTab]; - if (!isVisible) return null; return ( - + + ) : null} + ); }