task(A4.13): dynamic v2 tool section in ribbon behind flag
This commit is contained in:
@@ -1148,6 +1148,15 @@ const CADEditor: React.FC<CADEditorProps> = ({ projectId, token, onNavigateBack
|
||||
if (action === 'measure') { setActiveTool('dimension'); setCommandHistory((prev) => [...prev, { prefix: '·', text: 'Messwerkzeug aktiv', type: 'info' }]); return; }
|
||||
if (action === 'history') { setHistoryPanelOpen((prev) => !prev); return; }
|
||||
|
||||
// ─── V2 tools (Task A4.13): 'v2tool:<id>' → aktives Tool umschalten. Der
|
||||
// bestehende CanvasArea-Sync aus A4.1 routet es an den Dispatcher (Flag aktiv).
|
||||
if (action.startsWith('v2tool:')) {
|
||||
const toolId = action.slice('v2tool:'.length);
|
||||
setActiveTool(toolId);
|
||||
setCommandHistory((prev) => [...prev, { prefix: '·', text: `V2-Werkzeug aktiv: ${toolId}`, type: 'info' }]);
|
||||
return;
|
||||
}
|
||||
|
||||
// ─── Background ───
|
||||
if (action === 'background-import') { setBgImportOpen(true); return; }
|
||||
|
||||
@@ -1564,6 +1573,11 @@ const CADEditor: React.FC<CADEditorProps> = ({ projectId, token, onNavigateBack
|
||||
activeTab={activeRibbonTab}
|
||||
onTabChange={setActiveRibbonTab}
|
||||
onAction={handleRibbonAction}
|
||||
onIsV2ToolActive={(toolId: string) =>
|
||||
import.meta.env.VITE_TOOL_DISPATCHER === 'v2' &&
|
||||
activeTool === toolId &&
|
||||
!!pluginRegistry.getToolV2(toolId)
|
||||
}
|
||||
canvasBgColor={canvasBgColor}
|
||||
gridColor={gridColor}
|
||||
rulerEnabled={rulerEnabled}
|
||||
|
||||
Reference in New Issue
Block a user