From c200e2a1896104e333388747c04d5071c477623b Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sat, 4 Oct 2025 21:26:36 +0100 Subject: [PATCH] feat: integrate fullscreen catalog into tool panel --- frontend/src/components/tools/ToolPanel.css | 12 +- frontend/src/components/tools/ToolPanel.tsx | 148 +++++----- .../src/components/tools/ToolPanelOverlay.css | 154 +++------- .../src/components/tools/ToolPanelOverlay.tsx | 265 ++++++++---------- frontend/src/pages/HomePage.css | 51 ++++ frontend/src/pages/HomePage.tsx | 25 +- 6 files changed, 318 insertions(+), 337 deletions(-) diff --git a/frontend/src/components/tools/ToolPanel.css b/frontend/src/components/tools/ToolPanel.css index bed84fd0b..70acb7789 100644 --- a/frontend/src/components/tools/ToolPanel.css +++ b/frontend/src/components/tools/ToolPanel.css @@ -1,3 +1,11 @@ +.tool-panel { + transition: width 0.35s ease, flex 0.35s ease; +} + +.tool-panel--catalog { + background: var(--bg-background); +} + .tool-panel__search-row { display: flex; align-items: center; @@ -17,10 +25,6 @@ transform: scale(1.05); } -.tool-panel--overlay-hidden { - visibility: hidden; -} - .tool-panel__overlay-hint { padding: 0.5rem 1rem; border-bottom: 1px solid var(--border-subtle); diff --git a/frontend/src/components/tools/ToolPanel.tsx b/frontend/src/components/tools/ToolPanel.tsx index ddd5b9819..edbf4654d 100644 --- a/frontend/src/components/tools/ToolPanel.tsx +++ b/frontend/src/components/tools/ToolPanel.tsx @@ -4,6 +4,7 @@ import ToolPicker from './ToolPicker'; import SearchResults from './SearchResults'; import ToolRenderer from './ToolRenderer'; import ToolSearch from './toolPicker/ToolSearch'; +import ToolPanelOverlay from './ToolPanelOverlay'; import { useSidebarContext } from "../../contexts/SidebarContext"; import rainbowStyles from '../../styles/rainbow.module.css'; import { ActionIcon, Group, ScrollArea, Text, Tooltip } from '@mantine/core'; @@ -38,7 +39,7 @@ export default function ToolPanel() { } = useToolWorkflow(); const isFullscreenMode = toolPanelMode === 'fullscreen'; - const overlayActive = isFullscreenMode && leftPanelView === 'toolPicker' && !isMobile; + const isCatalogActive = isFullscreenMode && leftPanelView === 'toolPicker' && !isMobile; const toggleLabel = isFullscreenMode ? t('toolPanel.modeToggle.sidebar', 'Switch to advanced sidebar') @@ -48,33 +49,42 @@ export default function ToolPanel() { setToolPanelMode(isFullscreenMode ? 'sidebar' : 'fullscreen'); }; + const computedWidth = () => { + if (isMobile) { + return '100%'; + } + + if (isFullscreenMode) { + if (isCatalogActive) { + return '100%'; + } + + if (leftPanelView === 'toolContent' && isPanelVisible) { + return '20rem'; + } + + return isPanelVisible ? '20rem' : '0'; + } + + return isPanelVisible ? '18.5rem' : '0'; + }; + return (