task(A4.14): make v2 tool path the default (verified e2e without flag)
This commit is contained in:
@@ -19,6 +19,7 @@ import MobileDrawers from './components/MobileDrawers';
|
||||
import BackgroundImport from './components/BackgroundImport';
|
||||
import HistoryPanel from './components/HistoryPanel';
|
||||
import V2HistoryPanel from './components/V2HistoryPanel';
|
||||
import { V2_TOOLS_ENABLED } from './kernel/featureFlags';
|
||||
import SettingsModal from './components/SettingsModal';
|
||||
import InlineTextEditor from './components/InlineTextEditor';
|
||||
import { BackgroundService, type BackgroundConfig } from './services/backgroundService';
|
||||
@@ -1574,7 +1575,7 @@ const CADEditor: React.FC<CADEditorProps> = ({ projectId, token, onNavigateBack
|
||||
onTabChange={setActiveRibbonTab}
|
||||
onAction={handleRibbonAction}
|
||||
onIsV2ToolActive={(toolId: string) =>
|
||||
import.meta.env.VITE_TOOL_DISPATCHER === 'v2' &&
|
||||
V2_TOOLS_ENABLED &&
|
||||
activeTool === toolId &&
|
||||
!!pluginRegistry.getToolV2(toolId)
|
||||
}
|
||||
@@ -1743,7 +1744,7 @@ const CADEditor: React.FC<CADEditorProps> = ({ projectId, token, onNavigateBack
|
||||
onApply={handleBgApply}
|
||||
backgroundService={bgServiceRef.current}
|
||||
/>
|
||||
{historyPanelOpen && (import.meta.env.VITE_TOOL_DISPATCHER === 'v2' ? (
|
||||
{historyPanelOpen && (V2_TOOLS_ENABLED ? (
|
||||
<V2HistoryPanel
|
||||
onClose={() => setHistoryPanelOpen(false)}
|
||||
/>
|
||||
|
||||
@@ -17,6 +17,7 @@ import { logger } from '../utils/logger';
|
||||
import { CADDocument } from '../kernel/document/CADDocument';
|
||||
import { YjsDocument } from '../crdt/YjsDocument';
|
||||
import { setActiveDocument, getActiveDocument } from '../kernel/document/documentService';
|
||||
import { V2_TOOLS_ENABLED } from '../kernel/featureFlags';
|
||||
import { pluginRegistry } from '../plugins';
|
||||
|
||||
const CanvasArea: React.FC<CanvasAreaProps> = ({
|
||||
@@ -53,10 +54,9 @@ const CanvasArea: React.FC<CanvasAreaProps> = ({
|
||||
canvas, zoomPan, renderEngine, snapEngine, selectionEngine, spatialIndex, layerManager,
|
||||
);
|
||||
|
||||
// ── Task A2/A4: V2-Tool-Dispatcher hinter Feature-Flag ──
|
||||
// Flag VITE_TOOL_DISPATCHER=v2: aktiviert den InteractionDispatcher UND
|
||||
// verdrahtet ihn mit einem lokalen CADDocument + SelectionBridge (Task A4.1).
|
||||
if (import.meta.env.VITE_TOOL_DISPATCHER === 'v2') {
|
||||
// ── Task A2/A4.14: V2-Pfad ist seit Verifikation STANDARD — Opt-out via
|
||||
// VITE_TOOL_DISPATCHER=legacy. Siehe kernel/featureFlags.ts.
|
||||
if (V2_TOOLS_ENABLED) {
|
||||
const ydoc = new YjsDocument();
|
||||
ydoc.data.layers.set('layer-0', {
|
||||
id: 'layer-0', name: 'Standard', visible: true, locked: false,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
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: <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg> },
|
||||
@@ -38,8 +39,8 @@ const RibbonBar: React.FC<RibbonBarProps> = ({
|
||||
</div>
|
||||
|
||||
<div className="ribbon-content" id="ribbon-content">
|
||||
{/* ===== V2 TOOLS (Task A4.13, nur bei aktivem Dispatcher-Flag) ===== */}
|
||||
{activeTab === 'canvas' && import.meta.env.VITE_TOOL_DISPATCHER === 'v2' && (
|
||||
{/* ===== V2 TOOLS (Task A4.13/A4.14: Standard aktiv — Opt-out via VITE_TOOL_DISPATCHER=legacy) ===== */}
|
||||
{activeTab === 'canvas' && V2_TOOLS_ENABLED && (
|
||||
<div style={{
|
||||
display: 'flex', flexWrap: 'wrap', gap: '6px', alignItems: 'center',
|
||||
padding: '8px 4px', width: '100%',
|
||||
@@ -51,6 +52,7 @@ const RibbonBar: React.FC<RibbonBarProps> = ({
|
||||
return (
|
||||
<button
|
||||
key={tool.manifest.id}
|
||||
data-v2tool={tool.manifest.id}
|
||||
title={tool.manifest.description ?? tool.manifest.label}
|
||||
onClick={() => onAction(`v2tool:${tool.manifest.id}`)}
|
||||
style={{
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* featureFlags – Zentrale Feature-Schalter (Task A4.14).
|
||||
*
|
||||
* V2_TOOLS_ENABLED: Ab v2.0 ist der Plugin-first-Pfad (InteractionDispatcher,
|
||||
* CADDocument, dynamisches Ribbon, V2HistoryPanel) STANDARDMÄSSIG AKTIV.
|
||||
* Opt-out für den Legacy-Pfad: VITE_TOOL_DISPATCHER=legacy setzen.
|
||||
*
|
||||
* Begründung Historie: Vor A4.14 war V2 opt-in ('v2' explizit nötig), weil
|
||||
* noch keine Browser-Verifikation existierte. Die Playwright-Verifikation
|
||||
* (phase-a-verify.test.ts, grün) hat das Risiko entwertet.
|
||||
*/
|
||||
|
||||
/** Ist der V2-Werkzeugpfad (Dispatcher/CADDocument) aktiv? Default: ja. */
|
||||
export const V2_TOOLS_ENABLED: boolean =
|
||||
import.meta.env.VITE_TOOL_DISPATCHER !== 'legacy';
|
||||
Reference in New Issue
Block a user