From 1af6f87824997133f7169ab4694274e8797a4d5a Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Wed, 30 Jul 2025 10:38:04 +0300 Subject: [PATCH] F: Improve Sidepanel UI --- .../frontend/src/app/application-layout.tsx | 3 + .../side-panel/side-panel.tsx | 9 ++- .../side-panel/toolbar-schema.tsx | 56 +++++++++++++++++-- rsconcept/frontend/src/stores/app-layout.ts | 8 ++- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/rsconcept/frontend/src/app/application-layout.tsx b/rsconcept/frontend/src/app/application-layout.tsx index f1c3e34a..b64e0be7 100644 --- a/rsconcept/frontend/src/app/application-layout.tsx +++ b/rsconcept/frontend/src/app/application-layout.tsx @@ -23,6 +23,7 @@ export function ApplicationLayout() { const viewportHeight = useViewportHeight(); const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation); const noNavigation = useAppLayoutStore(state => state.noNavigation); + const toastBottom = useAppLayoutStore(state => state.toastBottom); const noFooter = useAppLayoutStore(state => state.noFooter); const activeDialog = useDialogsStore(state => state.active); @@ -35,6 +36,8 @@ export function ApplicationLayout() { autoClose={3000} draggable={false} pauseOnFocusLoss={false} + position={toastBottom ? 'bottom-right' : 'top-right'} + newestOnTop={toastBottom} /> }> diff --git a/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/side-panel/side-panel.tsx b/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/side-panel/side-panel.tsx index b5bbac90..2393a85a 100644 --- a/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/side-panel/side-panel.tsx +++ b/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/side-panel/side-panel.tsx @@ -1,4 +1,4 @@ -import { Suspense } from 'react'; +import { Suspense, useEffect } from 'react'; import clsx from 'clsx'; import { useDebounce } from 'use-debounce'; @@ -23,6 +23,7 @@ interface SidePanelProps { export function SidePanel({ isMounted, className }: SidePanelProps) { const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation); + const setToastBottom = useAppLayoutStore(state => state.setToastBottom); const { schema, isMutable, selectedItems } = useOssEdit(); const selectedOperation = selectedItems.length === 1 && selectedItems[0].nodeType === NodeType.OPERATION ? selectedItems[0] : null; @@ -32,8 +33,14 @@ export function SidePanel({ isMounted, className }: SidePanelProps) { const [debouncedMounted] = useDebounce(isMounted, PARAMETER.moveDuration); const closePanel = usePreferencesStore(state => state.toggleShowOssSidePanel); + const showPanel = usePreferencesStore(state => state.showOssSidePanel); const sidePanelHeight = useMainHeight(); + useEffect(() => { + setToastBottom(showPanel); + return () => setToastBottom(false); + }, [setToastBottom, showPanel]); + return (