Commit Graph

9 Commits

Author SHA1 Message Date
Leopoldadmin 7e530dd09a fix: stale closure bug preventing canvas tools from creating elements
- CanvasArea: add useEffect to refresh InteractionEngine callbacks when props change
- App.tsx: handleElementCreated/Deleted/Modified now use functional setElements updates
- Root cause: CanvasArea init useEffect had empty deps, capturing stale callbacks at mount
- handleElementCreated used [...elements, el] with stale elements=[] closure
- Each new element replaced all previous ones instead of appending
- All 343 tests pass, tsc clean
2026-06-26 18:57:09 +02:00
Leopoldadmin 3bec3938d0 fix: ribbon tabs now show per-tab content; add all missing handleRibbonAction handlers
- RibbonBar: conditional rendering per activeTab (start/insert/format/view/tools/ki)
- App.tsx: add onNavigateBack prop for new/open navigation
- App.tsx: implement handlers for new, open, save, copy, paste, zoom-fit, zoom-100, grid, layer, measure, search, plugins, ki, ki-draw, ki-analyze
- App.tsx: implement insert-line, insert-rect, insert-circle, insert-text, insert-freehand, insert-image
- App.tsx: implement format-* placeholder actions
- App.tsx: add clipboard state for copy/paste
- All 343 tests pass, tsc clean
2026-06-26 18:49:16 +02:00
Leopoldadmin ef23463a74 fix: CSS layout - .main → .app-body selector mismatch caused sidebar full-width
The component uses className="app-body" but CSS targeted .main for the grid layout.
This caused leftbar, canvas, and rightbar to all render at full viewport width
instead of the 3-column grid (leftbar 64px | canvas 1fr | rightbar 240px).
2026-06-26 18:37:20 +02:00
Leopoldadmin 6d15a692af fix: WebSocket wss:// same-origin URL + try/catch to prevent crash on HTTPS
- Change DEFAULT_WS_URL from ws://hostname:3001 to wss://window.location.host
- Wrap WebSocket constructor in try/catch to prevent React crash on connection error
- Fixes white page when opening a project (CADEditor crashed on insecure ws:// from HTTPS page)
2026-06-26 17:58:06 +02:00
Leopoldadmin 1bcfaffdd4 fix: replace hardcoded localhost:3001 with relative API URL + add canvas mock and integration test
- Fix frontend Network error: API_BASE now defaults to empty string (same-origin)
- Fix 3 files: api.ts, AuthContext.tsx, Dashboard.tsx
- Add Canvas 2D context mock in tests/setup.ts for jsdom
- Fix -0 vs +0 in ZoomPanController.getViewport()
- Add IntegrationWorkflow.test.ts (35 tests, full CAD workflow)
2026-06-26 17:48:24 +02:00
Leopoldadmin 89b91a1050 test: T29-T31 component tests (20) + frontend stresstest (7) + backend DB stresstest (6) with 50k elements 2026-06-26 16:20:09 +02:00
Leopoldadmin f853372c90 test: add Vitest setup with 115 tests (backend + frontend) 2026-06-26 14:19:50 +02:00
Leopoldadmin 19884b7b5d fix: use Docker resolver for backend DNS in nginx.conf 2026-06-26 11:01:03 +02:00
Leopoldadmin 4ec76fe406 feat: initial commit web-cad-neu with docker-compose, frontend and backend 2026-06-26 10:50:24 +02:00