Commit Graph

55 Commits

Author SHA1 Message Date
A0 Orchestrator 061f862960 fix: dashboard readability + editable info panel + drag&drop visual feedback 2026-07-03 18:05:56 +02:00
A0 Orchestrator aae93fe36b feat: dashboard 3-column layout — project folders treeview, project cards with open button, info panel 2026-07-03 17:21:42 +02:00
A0 Orchestrator d80e5990e4 fix: remove left footer symbols + right sidebar edge toggle/resize + rename tab to Einstellungen 2026-07-03 11:51:07 +02:00
A0 Orchestrator eefd99ee48 fix: right sidebar header + left sidebar toggle + ribbon color pickers + ribbon height 2026-07-03 10:52:38 +02:00
A0 Orchestrator a6d2e2d718 feat: logo link to dashboard + ribbon tab Zeichenfläche + settings System tab + ruler 2026-07-02 14:46:32 +02:00
A0 Orchestrator 587efcecd5 fix: sidebar collapse + responsive tool grid + remove zoom tool 2026-07-02 12:38:55 +02:00
A0 Orchestrator 0bf9c61793 feat: leftsidebar collapsible tool groups + scroll + resizable width 2026-07-02 10:52:40 +02:00
A0 Orchestrator 0463a793bc feat: units system — mm/cm/m switchable, configurable grid, real measurements, formatted display 2026-07-02 08:46:07 +02:00
A0 Orchestrator 72e3d1da24 fix: rotate/scale press-drag-release + object-center pivot 2026-07-02 07:51:13 +02:00
A0 Orchestrator 137f5f3a27 fix: transform tools — move/copy press-drag-release, correct coordinate calculation 2026-07-02 05:24:15 +02:00
A0 Orchestrator 9f749e8ebd feat: layer-tree selection sync + group folders in tree + ribbonbar readability 2026-07-02 00:47:28 +02:00
A0 Orchestrator 2eead4c1aa fix: selection bugs — arrow tool click select, box-select on empty drag, preserve selection on tool switch 2026-07-01 23:46:57 +02:00
A0 Orchestrator 7b19a99b24 feat: global block library tree + grouping tool — 19 files, 588 tests green 2026-07-01 21:02:31 +02:00
A0 Orchestrator 405e55e818 fix: drawing persistence bug — sync activeLayerId on project load + create default layer when none exist 2026-07-01 14:23:44 +02:00
A0 Orchestrator b503f75fe2 fix: LOW issues #37-#50 — remove mock data, type auth functions, ImageElement interface, remove dead code, implement zoom/format/search, cleanup 2026-06-30 14:37:59 +02:00
A0 Orchestrator ee664750e6 fix: MEDIUM issues #31-#36 — inline text editor, image/paste persist, input validation on all routes, useEffect deps, online count fix 2026-06-30 14:03:22 +02:00
A0 Orchestrator 172f933456 fix: MEDIUM issues #23-#30 — stale deps, export modal, cache race, StrictMode dedup, SeatingService ref, SVG import persist, group-as-block multi-select, session expiry 2026-06-30 13:15:54 +02:00
A0 Orchestrator d09b1dfc2e fix: HIGH issues #13,#14,#18,#19,#20 — frontend state/sync: copy-paste selection, dynamic activeLayer, group creation, Yjs awareness protocol, connect sync 2026-06-30 12:42:49 +02:00
A0 Orchestrator 5a21fc0bfa fix: HIGH issues #12,#15,#16,#17,#21 — backend persistence for import/layers/blocks + owner filtering 2026-06-30 12:16:49 +02:00
Leopoldadmin 707214447b merge: cherry-pick e1b96310 (security + type-safety + auth middleware) from web-cad
Brings the following 28.06 improvements into web-cad-neu:
- backend/src/auth/authMiddleware.ts: shared requireAuth/requireAdmin middleware
- backend/src/routes/users.ts: admin role checks (critical security fix)
- 6 routes (projects, drawings, elements, layers, blocks, settings): requireAuth
- server.ts: per-route auth (defense-in-depth alongside global hook)
- 6 test files: auth setup + 401 tests
- Frontend: type safety fixes (App.tsx, RenderEngine, SnapEngine, etc.)
- 10 components: SVG stroke-width/linecap/linejoin -> camelCase
- PropertiesPanel: formatPos/formatDim/parseNum helpers
- LayerPanel: aria-labels
- WORKLOG.md: historical worklog from 28.06

Conflicts resolved (4 blocks, all kept HEAD + e1b96310 improvements):
- LayerPanel.tsx: kept HEAD display:flex + e1b96310 aria-label
- PropertiesPanel.tsx: kept HEAD onDelete handler + e1b96310 formatPos helpers
- PropertiesPanel.tsx: kept HEAD delete button (feature) + full inline styles
- Topbar.tsx: kept HEAD onClick + e1b96310 camelCase SVG attrs

Refs: CODE_ANALYSIS.md (Issue #1 partially improved), e1b96310
2026-06-30 11:32:33 +02:00
Leopoldadmin 4a5377cb53 fix(frontend): layers/blocks local-first merge + push effects (quality review fixes) 2026-06-30 00:09:22 +02:00
Leopoldadmin baba0cbb38 fix(frontend): remote sync improvements, save all elements, block drop backend sync (Issues #9, #10, #11) 2026-06-29 23:56:59 +02:00
Leopoldadmin 275b863f03 fix(frontend): loadFromState race condition + plugin stale closure (Issues #7, #8) 2026-06-29 23:50:18 +02:00
Leopoldadmin 8493138b4b fix(crdt): sync groups and bgConfig via Yjs (Issue #6) 2026-06-29 23:42:03 +02:00
Leopoldadmin cf62a777d2 fix(backend+frontend): WebSocket auth, Yjs persistence fix, keep docs in memory (Issues #2, #4, #5) 2026-06-29 23:33:58 +02:00
Leopoldadmin 463aa2ef77 fix: collab sync overwrites blocks with empty array
- collab.blocks sync had no guard against empty arrays
- when project loads, collab syncs empty blocks from server
- this overwrites createDefaultBlocks() with empty array
- added if (collab.blocks.length > 0) guard, same as layers
2026-06-29 16:44:38 +02:00
Leopoldadmin 1b2d6815cb fix: remove Bibliothek from left sidebar (was always on right)
- Removed BlockLibrary section from LeftSidebar.tsx
- Removed unused BlockLibrary import
- Removed unused block-related props from LeftSidebar destructuring
- Bibliothek belongs in right sidebar as a tab (already existed there)
2026-06-29 13:35:50 +02:00
Leopoldadmin 2c6f7b2e8b fix: Bibliothek section always visible in left sidebar
- LeftSidebar was hiding entire Bibliothek section when blocks array was empty
- Removed blocks.length > 0 conditional wrapper
- Added blocks || [] fallback to prevent crash
- Library tree now visible even with no blocks
2026-06-29 13:13:43 +02:00
Leopoldadmin ba978cd13c feat: delete function, sidebar collapse, layer drag&drop, library tree
- Delete: trash button in PropertiesPanel + existing Delete key support
- Left sidebar: desktop collapse toggle button
- Right sidebar: desktop collapse toggle + SVG icon size fix (replaced emoji)
- Layer panel: drag&drop enabled (reorder, move to layers, sub-layers)
- Library tree: BlockLibrary added to left sidebar
- App.tsx: handleReorderLayer, handleAddSubLayer, handleUpdateElement
- styles.css: collapse + drag&drop visual indicators
2026-06-29 10:44:53 +02:00
Leopoldadmin 6b0b637636 fix: collab sync no longer overwrites layers with empty array
- Root cause: App.tsx collab sync effect called setLayers(collab.layers)
  even when collab.layers was empty, wiping out initialLayers
- Effect: RenderEngine.render() iterates layers to draw elements;
  with 0 layers, no elements render (appear to disappear)
- Fix: guard against empty collab.layers

Fixes: drawing tools work on desktop and mobile, objects persist after release
2026-06-29 00:34:39 +02:00
Leopoldadmin db2b70f15b fix: touch release confirms drawing tool
- Add pointercancel listener (treated same as pointerup)
- Remove e.preventDefault() from pointerdown/pointerup (was suppressing touch events)
- Expand onMouseUp tool list: arc, polygon, revcloud now confirm on release

Fixes: object disappears on touch release, tools work same on mobile as desktop
2026-06-28 23:54:07 +02:00
Leopoldadmin 88ddebcd86 fix: drawing tools use pointer events for mouse+touch support
- InteractionEngine: pointerdown on canvas, pointermove/pointerup on document

- Pointer capture for smooth dragging outside canvas

- CSS: touch-action: none on canvas to prevent browser touch interception

- Fixes: tools not working on desktop (mouseup lost outside canvas) and mobile (no touch support)
2026-06-28 23:15:48 +02:00
Leopoldadmin 3f93a236e1 fix: add close buttons to mobile sidebars
- RightSidebar: added onCollapse prop and close button in header

- LeftSidebar: wired existing onCollapse prop in App.tsx

- CSS: show .leftbar-toggle and .rightbar-close on mobile

- Both buttons call setMobile{Left,Right}Open(false) to close overlays
2026-06-28 22:35:33 +02:00
Leopoldadmin 8c878e4bba fix: hide empty MobileDrawers overlays that covered real sidebar content on mobile
- MobileDrawers component rendered empty drawer-left/drawer-right overlays
- These had drawer-body with 0 children, covering the real leftbar/rightbar
- Real sidebars with actual content now visible as slide-in overlays
2026-06-28 18:26:47 +02:00
Leopoldadmin 0785efbbc5 fix: mobile sidebar tool labels visible + scrollable overflow
- overflow-y: auto on mobile sidebars so all tools are reachable
- Re-enable tool-section-label, tool-btn-label, leftbar-title on mobile
- Tool grid 2-column with labels for better mobile UX
2026-06-28 18:19:35 +02:00
Leopoldadmin 7b4a45df49 fix: mobile sidebar slide-in overlay with hamburger and panel toggle buttons
- LeftSidebar/RightSidebar: added className prop for 'open' class
- Topbar: wired hamburger onClick + added mobile-drawer-toggle button for right panel
- App.tsx: added SettingsModal import/state/render, passed className props to sidebars
- styles.css: mobile sidebars now fixed slide-in overlays (translateX) instead of display:none
- ui.types.ts: added className to RightSidebarProps, onOpenLeftDrawer/onOpenRightDrawer to TopbarProps
- Tested at 390px viewport: both sidebars slide in correctly, transform verified via DOM
2026-06-28 17:55:26 +02:00
Leopoldadmin e2bba8b882 fix: add Content-Type header to createProjectShare API call 2026-06-28 14:37:49 +02:00
Leopoldadmin e9b6f188c8 fix: security and UX improvements for notifications and shares
- Add ownership checks on all notification and share routes (403 Forbidden)
- Validate permission field (only view/edit/admin allowed)
- Remove user_id from POST notifications (only self-notifications)
- Add getNotification/getProjectShare to DB interface + adapter
- Add res.ok checks on all frontend API calls
- Add click-outside handler for notification dropdown
- Add initial notification load on mount for badge count
- Add email validation + duplicate check in ShareDialog
- Add Enter key handler in ShareDialog
- Add submitting state to prevent double-click
- Guard against null token in Dashboard
2026-06-28 14:16:50 +02:00
Leopoldadmin 20432f4b47 feat: add notifications and project shares features
- Backend: notifications + shares routes, DB tables, SqliteAdapter methods
- Frontend: NotificationPanel (bell icon + dropdown), ShareDialog, Dashboard integration
- Styles: notification + share dialog CSS
2026-06-28 13:59:49 +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