From 685757303f86917bd3a44353727362d414f9d808 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Wed, 16 Sep 2026 10:22:36 +0200 Subject: [PATCH] fix(CAD-13): remove duplicate tool ribbon - drawing tools only in left sidebar (like real CAD), ribbon reduced to Start/Ansicht/KI, Stueckliste moved to Ansicht extras --- frontend/src/components/RibbonBar.tsx | 67 ++------------------------- frontend/src/types/ui.types.ts | 2 +- frontend/tests/Components.test.tsx | 6 +-- frontend/tests/uiMode.test.tsx | 35 ++++++-------- 4 files changed, 23 insertions(+), 87 deletions(-) diff --git a/frontend/src/components/RibbonBar.tsx b/frontend/src/components/RibbonBar.tsx index dbcc639..4044887 100644 --- a/frontend/src/components/RibbonBar.tsx +++ b/frontend/src/components/RibbonBar.tsx @@ -1,72 +1,18 @@ import React from 'react'; -import { useUIMode } from '../services/uiModeService'; -import { useT } from '../i18n/strings'; import type { RibbonBarProps, RibbonTab } from '../types/ui.types'; -import { pluginRegistry } from '../plugins'; -import { V2_TOOLS_ENABLED } from '../kernel/featureFlags'; const tabs: Array<{ id: RibbonTab; label: string; svg: React.ReactNode }> = [ { id: 'start', label: 'Start', svg: }, - { id: 'draw', label: 'Zeichnen', svg: }, { id: 'view', label: 'Ansicht', svg: }, { id: 'ki', label: 'KI', svg: }, ]; -/** V2-Werkzeug-Kategorien → Gruppen-Label im Zeichnen-Tab. */ -const V2_GROUP_LABELS: Record = { - canvas: 'Zeichnen & Ändern', - format: 'Bemaßung & Text', - insert: 'Bestuhlung & Traversen', -}; - const RibbonBar: React.FC = ({ activeTab, onTabChange, onAction, canvasBgColor = '#1e1e2e', gridColor = '#3a3a4a', rulerEnabled = true, onCanvasBgColorChange, onGridColorChange, onToggleRuler, onIsV2ToolActive, }) => { - const uiMode = useUIMode(); - - /** Rendert die V2-Werkzeuge einer Kategorie als Button-Gruppe. */ - const renderV2Group = (category: string) => { - const tools = pluginRegistry.getToolsV2() - .filter((tool) => tool.manifest.ribbonTab === category) - .filter((tool) => uiMode === 'pro' || (tool.manifest.tags ?? []).includes('basic')); - if (tools.length === 0) return null; - return ( -
-
- {tools.map((tool) => { - const isActive = onIsV2ToolActive?.(tool.manifest.id); - return ( - - ); - })} - {category === 'insert' && ( - - )} -
-
{V2_GROUP_LABELS[category] ?? category}
-
- ); - }; - return (