- 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)
- 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
- 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
- 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
- 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
- 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
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.
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.
- 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
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).
- 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)