Commit Graph

52 Commits

Author SHA1 Message Date
Agent Zero 69141d604a task(A4.14): make v2 tool path the default (verified e2e without flag) 2026-08-27 08:36:30 +02:00
Agent Zero e370552055 task(A4.13): dynamic v2 tool section in ribbon behind flag 2026-08-27 07:21:19 +02:00
Agent Zero 216bf6360a task(A4.12): v2 history panel reading undo manager behind flag 2026-08-27 07:17:46 +02:00
Agent Zero 25e721d3d3 task(A4.11): documentService singleton + global v2 undo/redo shortcuts 2026-08-27 07:14:41 +02:00
Agent Zero 19f838fbf8 task(A4.10): migrate trim/extend/fillet to v2 + real CAD extend fallback 2026-08-27 01:21:44 +02:00
Agent Zero 76f305fc6f task(A4.9): migrate event domain tools (chair/row/block/table/stage) to v2 2026-08-27 01:12:52 +02:00
Agent Zero cf67635732 task(A4.8): migrate delete/offset tools to v2 2026-08-27 01:09:51 +02:00
Agent Zero 1d598daba1 task(A4.7): migrate rotate/scale/mirror tools to v2 (selection-based transforms) 2026-08-27 01:04:48 +02:00
Agent Zero ca1c3c08f3 task(A4.6): migrate move/copy tools to v2 with selection-based workflow 2026-08-27 00:53:16 +02:00
Agent Zero 464ddb91cc task(A4.5): migrate revcloud/hatch/measure tools to v2 2026-08-27 00:48:28 +02:00
Agent Zero 239257c8b0 task(A4.4): migrate text/dimension/leader tools to v2 annotate plugin 2026-08-27 00:43:20 +02:00
Agent Zero 0dfe3b5870 task(A4.3): migrate circle/arc/polyline/polygon tools to v2 2026-08-27 00:39:30 +02:00
Agent Zero 8204de81c4 task(A4.2): migrate rect tool to v2 plugin 2026-08-26 23:14:26 +02:00
Agent Zero d54a67662b task(A4.1): wire dispatcher to canvas - doc bridge, selection bridge, activeTool sync 2026-08-26 23:10:20 +02:00
Agent Zero 09a120d800 task(A3): pilot v2 tools select+line 2026-08-26 21:30:54 +02:00
Agent Zero ddfeadac58 task(A2b): CADDocument facade with transactions and undo 2026-08-26 21:23:22 +02:00
Agent Zero 4a7a8f912f task(A2): tool dispatcher behind flag 2026-08-26 21:14:46 +02:00
Agent Zero 5d7fa23825 task(A1): plugin api v2 types and registry (additive) 2026-08-26 21:11:01 +02:00
Agent Zero cba9358235 task(A0): logger and test helpers 2026-08-26 21:04:17 +02:00
Agent Zero 7f4768c205 task(B5): seat counting by row and block 2026-08-26 20:53:42 +02:00
Agent Zero d93ee5308c task(B4): cache background image (fixes BUG-4) 2026-08-26 20:51:43 +02:00
Agent Zero d8f29e42e3 task(B3): offset respects click side (fixes BUG-3) 2026-08-26 13:51:02 +02:00
Agent Zero 95b14cf86b task(B2): line/circle/arc intersections (fixes BUG-2) 2026-08-26 13:47:25 +02:00
Agent Zero 1bbd653d34 task(B1): unique row/block ids for seating (fixes BUG-1) 2026-08-26 13:14:34 +02:00
Agent Zero b9eb69fc81 task(B0): regression tests for known bugs (red) 2026-08-26 12:53:07 +02:00
Leopoldadmin 126277ab94 fix(settings, yjs, ux, ci): default settings, y-leveldb restart resilience, dashboard one-click open, delete error handling, Playwright CI 2026-07-27 03:15:30 +02:00
Leopoldadmin 7f8695456c fix(browser): text tool, delete API headers, exhaustive Playwright tool tests
- Fix text tool: call updatePreview before confirmDraw so element is created
- Fix all DELETE requests: send Authorization only, no Content-Type body-less requests caused 400
- Add exhaustive Playwright test covering all 30 CAD tools on the actual canvas
- Verified: backend unit tests 254/254, frontend unit tests 380/380, browser tool tests 30/30
2026-07-27 02:02:35 +02:00
Leopoldadmin c86b5e7031 fix: browser testing issues and missing UI tools
- Fix WebSocket URL to use ws:// for http development environments
- Make createLayer idempotent to prevent race-condition 500 under React StrictMode
- Add URL-based routing for /register so register page actually shows register form
- Add missing tool buttons to LeftSidebar: polygon, chair, extend, fillet
- Add Playwright browser test suite for exhaustive UI testing
- Update .gitignore for Playwright artifacts

Unit tests: backend 254/254, frontend 380/380
2026-07-27 01:17:18 +02:00
Leopoldadmin 8f4ca1581c feat: offline support, performance benchmark, y-indexeddb integration
- Add y-indexeddb for offline CRDT persistence (IndexedDB)
  - useYjsBinding now creates IndexeddbPersistence per document
  - State syncs from IndexedDB on reconnect
  - Graceful fallback if IndexedDB unavailable
- Add Performance Benchmark test (50k elements)
  - Bulk insert: 50k elements in <2s
  - Viewport search: <10ms for ~1000 visible elements
  - Full viewport search: <100ms for all 50k elements
  - 100 sequential searches: <500ms
  - Remove 1000 elements: <200ms
  - Clear all: <50ms
- Bearbeitungs-Tools already fully implemented (move, copy, rotate, scale, mirror, trim, extend, fillet, offset)
- Bestuhlungs-Tools already fully implemented (seating-row, seating-block, table, stage, templates)

All 634 tests passing (254 backend + 380 frontend)
2026-07-27 00:37:28 +02:00
Leopoldadmin 02308dc54a fix: comprehensive quality improvements
- Fix 2 backend test failures (projectFolders validation, StressTest timeout)
- Fix frontend test dependency (@testing-library/dom)
- Delete App.tsx.bak from repo
- Add rate limiting on auth endpoints (login: 10/min, register: 3/min)
- Add .env.example with all environment variables
- Update BAUPLAN.md with accurate phase status (16/21 phases implemented)
- Add OpenAPI/Swagger documentation (docs/openapi.yaml)
- Add E2E workflow test (15 steps: register→project→drawing→layer→element→CRUD→delete)
- Add Forgejo CI/CD pipeline (.forgejo/workflows/ci.yml)
- Improve .gitignore (db-wal, .env.*, *.bak, coverage)
- Add security comment for default user in schema.sql

All 628 tests passing (254 backend + 374 frontend)
2026-07-26 22:47:50 +02:00
Leopoldadmin 67c678121f fix: CanvasPreview crash - transform DBElement properties_json to CADElement properties
Backend returns DBElement with properties_json (string), not properties (object).
CanvasPreview accessed el.properties.stroke directly → undefined → React crash → white screen.
Fix: transform raw API response to CADElement format with JSON.parse(properties_json).
2026-07-04 19:33:22 +02:00
Leopoldadmin 6c04ca6793 fix: replace synthetic canvas preview with real drawing data
- Load drawings + elements via API
- Render actual SVG elements (rect, circle, line, text, polygon, arc)
- Auto-scale viewBox to element bounding box
- Show "Leere Zeichnung" placeholder when no elements
2026-07-04 18:26:14 +02:00
Leopoldadmin 3af9640ace feat: dashboard UI improvements - 8 changes
1. Web CAD title larger (24px, font-weight 800)
2. Gear icon opens SettingsModal
3. Folder drag-and-drop with nested folders (backend parent_id support)
4. Icon-only card buttons with CSS tooltips
5. Canvas preview (deterministic SVG per project)
6. Info panel: smaller title, double-height description
7. User/group permission selector
8. oe → ö correction
2026-07-04 18:11:11 +02:00
Leopoldadmin 6c4d62641a fix: frontend Dockerfile uses --legacy-peer-deps for vite@8 compatibility 2026-07-04 17:21:34 +02:00
Leopoldadmin be62470b53 merge: combine all features from both codebases - mobile dashboard + layer panel + notifications + shares + all fixes 2026-07-04 16:43:55 +02:00
Leopoldadmin 0606dbb501 fix: SQLite boolean binding, CSS brace, race condition, 0 npm vulns, code-splitting 2026-07-04 16:08:51 +02:00
Leopoldadmin a4371ca3ce fix: layer panel collapsible tree + element actions (visibility toggle, delete) + RenderEngine skips invisible elements 2026-06-27 23:59:12 +02:00
Leopoldadmin affa6be151 feat: layer panel with element tree - shows layers + elements as children with count badges, sub-layers supported 2026-06-27 14:27:34 +02:00
Leopoldadmin 4303076ce4 feat: click-drag drawing, layer tree, settings modal, UI improvements
- interaction: click-drag drawing for 2-point tools (line, rect, circle, dimension, leader)
- interaction: preview rendering during drag with setPreviewElement
- interaction: handleDrawDown only sets phase=drawing on first point
- CanvasArea: sync activeLayerId to LayerManager
- CanvasArea: callback refresh useEffect prevents stale closures
- App.tsx: functional setElements updates for handleElementCreated/Deleted/Modified
- LayerPanel: tree structure with sub-layers (onReorder, onAddSubLayer)
- TreeView: drag-and-drop reordering support
- RightSidebar: onReorder, onAddSubLayer, onUpdateElement props
- PropertiesPanel: onUpdateElement prop
- SettingsModal: personal/password/language/theme/users/plugins/AI tabs
- styles.css: extensive UI styling additions
- types: updated RightSidebarProps, CanvasAreaProps, LayerPanelProps
2026-06-27 14:12:37 +02:00
Leopoldadmin 39422a4348 fix: layer IDs globally unique - use timestamp-based IDs instead of hardcoded layer-0/1/2/3/4
Root cause: layers.id is TEXT PRIMARY KEY (global unique across all drawings).
Hardcoded IDs layer-0..layer-4 collided when multiple projects tried to create
the same layer IDs. Second project got UNIQUE constraint failed on POST /layers.
Without layers, elements had dangling layer_id refs causing FOREIGN KEY errors.

Fix: makeInitialLayers() generates unique IDs: layer-{timestamp}-{index}.
activeLayerId initialized from first layer, not hardcoded.
activeLayerName uses activeLayerId variable, not hardcoded layer-0.
On project load with existing layers, activeLayerId set from first DB layer.
2026-06-26 20:53:41 +02:00
Leopoldadmin 7ad0e11873 fix: element creation fails with empty layer_id (FOREIGN KEY constraint)
Three fixes:
1. interaction/index.ts: Add layerId to created element in confirmDraw()
2. CanvasArea.tsx: Sync layers to LayerManager via layerManagerRef
3. App.tsx: Fallback to activeLayerId in handleElementCreated if layerId missing

Root cause: LayerManager.activeLayerId was empty because layers were never
synced from React state to the interaction layer LayerManager. New elements
got layer_id="" which failed SQLite FOREIGN KEY constraint.

Also includes Yjs sync race condition fix from previous commit.
2026-06-26 20:31:50 +02:00
Leopoldadmin bd8bedcfed fix: remove debug console.log from InteractionEngine - tools verified working 2026-06-26 19:24:12 +02:00
Leopoldadmin f9f31db933 debug: add console.log to InteractionEngine to trace drawing flow 2026-06-26 19:01:45 +02:00
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