fix: add close buttons to mobile sidebars

- RightSidebar: added onCollapse prop and close button in header

- LeftSidebar: wired existing onCollapse prop in App.tsx

- CSS: show .leftbar-toggle and .rightbar-close on mobile

- Both buttons call setMobile{Left,Right}Open(false) to close overlays
This commit is contained in:
2026-06-28 22:35:33 +02:00
parent 8c878e4bba
commit 3f93a236e1
4 changed files with 24 additions and 0 deletions
+2
View File
@@ -954,6 +954,7 @@ const CADEditor: React.FC<CADEditorProps> = ({ projectId, token, onNavigateBack
selectedTemplate={selectedTemplate}
onTemplateSelect={handleTemplateSelect}
className={mobileLeftOpen ? 'open' : ''}
onCollapse={() => setMobileLeftOpen(false)}
/>
<CanvasArea
cursorPos={cursorPos}
@@ -1017,6 +1018,7 @@ const CADEditor: React.FC<CADEditorProps> = ({ projectId, token, onNavigateBack
onKISuggestionClick={handleSuggestionClick}
kiLoading={kiLoading}
className={mobileRightOpen ? 'open' : ''}
onCollapse={() => setMobileRightOpen(false)}
/>
</div>
<CommandLine
+4
View File
@@ -23,9 +23,13 @@ const RightSidebar: React.FC<RightSidebarProps> = ({
onRenameBlock, onDuplicateBlock, onDeleteBlock, onSvgImport, onSaveGroupAsBlock,
onBlockCategoryChange, onBlockSearch, onDragBlock,
kiMessages, kiSuggestions, onKISend, onKISuggestionClick, kiLoading, onUpdateElement,
onCollapse,
}) => {
return (
<aside className={`rightbar${className ? ' ' + className : ''}`} aria-label="Eigenschaften-Panels">
<button className="rightbar-close" aria-label="Rechte Leiste schließen" onClick={onCollapse}>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
</button>
<div className="rightbar-tabs" role="tablist">
{tabs.map((tab) => (
<button
+17
View File
@@ -1273,6 +1273,23 @@ a:hover { text-decoration: underline; }
body.drawer-open { overflow: auto !important; }
/* Mobile sidebars: scrollable content, visible labels */
.leftbar { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.leftbar-toggle { display: grid !important; }
.rightbar-close { display: grid !important; }
.rightbar-close {
position: absolute;
top: 6px;
left: 6px;
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: transparent;
color: var(--color-text);
cursor: pointer;
z-index: 10;
}
.rightbar-close svg { width: 18px; height: 18px; }
.rightbar-close:hover { background: var(--color-surface-3); }
.leftbar-title { display: block; }
.tool-section-label { display: block; padding: 0 6px 6px; }
.tool-btn-label { display: block; }
+1
View File
@@ -159,6 +159,7 @@ export interface RightSidebarProps {
kiLoading?: boolean;
onUpdateElement?: (el: CADElement) => void;
className?: string;
onCollapse?: () => void;
}
export interface PropertiesPanelProps {