Commit Graph

545 Commits

Author SHA1 Message Date
Jeff Emmett fafad35cb0 feat: add offline storage fallback for browser reload
When the browser reloads without network connectivity, the canvas now
automatically loads from local IndexedDB storage and renders the last
known state.

Changes:
- Board.tsx: Updated render condition to allow rendering when offline
  with local data (isOfflineWithLocalData flag)
- useAutomergeStoreV2: Added isNetworkOnline parameter and offline fast
  path that immediately loads records from Automerge doc without waiting
  for network patches
- useAutomergeSyncRepo: Passes isNetworkOnline to useAutomergeStoreV2
- ConnectionStatusIndicator: Updated messaging to clarify users are
  viewing locally cached canvas when offline

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 23:57:26 -05:00
Jeff Emmett f06c5c7537 Create task task-050 2025-12-14 13:32:20 -05:00
Jeff Emmett 4236f040f3 feat: add user dropdown menu, fix auth tool visibility, improve network graph
- Add dropdown menu when clicking user nodes in network graph with options:
  - Connect with <username>
  - Navigate to <username> (pan to cursor)
  - Screenfollow <username> (follow camera)
  - Open <username>'s profile
- Fix tool visibility for logged-in users (timing issue with read-only mode)
- Fix 401 errors by correcting localStorage key from 'cryptid_session' to 'canvas_auth_session'
- Remove "(anonymous)" suffix from usernames in tooltips
- Simplify node colors to use user's profile/presence color
- Clear permission cache on logout to prevent stale state
- Various UI improvements to auth components and network graph

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 18:41:53 -05:00
Jeff Emmett f277aeec12 Update task task-017 2025-12-11 07:15:44 -08:00
Jeff Emmett 9491c6a5c1 Create task task-049 2025-12-10 14:24:07 -08:00
Jeff Emmett b5e558d35f Update task task-048 2025-12-10 14:22:25 -08:00
Jeff Emmett 03280bc9cd Create task task-048 2025-12-10 14:22:15 -08:00
Jeff Emmett 9273d741b9 feat: add version history, Resend email, CryptID registration flow
- Switch email service from SendGrid to Resend
- Add multi-step CryptID registration with passwordless explainer
- Add email backup for multi-device account access
- Add version history API endpoints (history, snapshot, diff, revert)
- Create VersionHistoryPanel UI with diff visualization
  - Green highlighting for added shapes
  - Red highlighting for removed shapes
  - Purple highlighting for modified shapes
- Fix network graph connect/trust buttons
- Enhance CryptID dropdown with better integration buttons
- Add Obsidian vault connection modal

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 14:21:50 -08:00
Jeff Emmett 2e9c5d583c Update task task-047 2025-12-10 10:28:27 -08:00
Jeff Emmett 12e696e3a4 Create task task-047 2025-12-10 10:28:22 -08:00
Jeff Emmett 8f22b8baa7 feat: improve mobile touch/pen interactions across custom tools
- Add onTouchStart/onTouchEnd handlers to all interactive elements
- Add touchAction: 'manipulation' CSS to prevent 300ms click delay
- Increase minimum touch target sizes to 44px for accessibility
- Fix ImageGen: Generate button, Copy/Download/Delete, input field
- Fix VideoGen: Upload, URL input, prompt, duration, Generate button
- Fix Transcription: Start/Stop/Pause buttons, textarea, Save/Cancel
- Fix Multmux: Create Session, Refresh, session list, input fields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 10:27:44 -08:00
Jeff Emmett 354dcb7dea Update task task-046 2025-12-08 01:03:18 -08:00
Jeff Emmett 5a7d739926 feat: add maximize button to all tool shapes
Add useMaximize hook to all shapes using StandardizedToolWrapper:
- MapShapeUtil, MultmuxShapeUtil, MarkdownShapeUtil
- ObsNoteShapeUtil, ImageGenShapeUtil, VideoGenShapeUtil
- HolonShapeUtil, PromptShapeUtil, EmbedShapeUtil
- FathomMeetingsBrowserShapeUtil, FathomNoteShapeUtil
- HolonBrowserShapeUtil, ObsidianBrowserShapeUtil
- TranscriptionShapeUtil, VideoChatShapeUtil

All tools now have maximize/fullscreen functionality via the
standardized header bar.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 01:02:57 -08:00
Jeff Emmett aa6201e013 Create task task-046 2025-12-08 00:51:43 -08:00
Jeff Emmett fd7c015b9e feat: add maximize button to StandardizedToolWrapper
- Add maximize/fullscreen button to standardized header bar
- Create useMaximize hook for shape utils to enable fullscreen
- Shape fills viewport when maximized, restores on Esc or toggle
- Implement on ChatBoxShapeUtil as example (other shapes can add easily)
- Button shows ⤢ for maximize, ⊡ for exit fullscreen

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 00:51:23 -08:00
Jeff Emmett 89289dc5c8 Create task task-045 2025-12-08 00:48:02 -08:00
Jeff Emmett 5125cd9e3a fix: offline-first loading from IndexedDB when server is down
- Remove blocking await adapter.whenReady() that prevented offline mode
- Load from IndexedDB immediately without waiting for network
- Set handle and mark as ready BEFORE network sync for instant UI
- Background server sync with 5-second timeout
- Continue with local data if network is unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 00:48:02 -08:00
Jeff Emmett d54ceeb8e3 Update task task-044 2025-12-08 00:48:02 -08:00
Jeff Emmett 81140bd397 feat: add invite/share feature with QR code, URL, NFC, and audio connect
- Add InviteDialog component with tabbed interface for sharing boards
- Add ShareBoardButton component to toolbar
- Integrate qrcode.react for QR code generation
- Implement Web NFC API for NFC tag writing
- Add placeholder for audio connect feature (coming soon)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 05:35:30 +01:00
Jeff Emmett 633607fe25 feat: unified top-right menu with grey oval container
- Created single grey oval container for all top-right menu items
- Order: CryptID -> Star -> Gear -> Question mark
- Added vertical separator lines between each menu item
- Consistent styling with rounded container and subtle shadow
- Removed separate styling for individual buttons

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:17:17 -08:00
Jeff Emmett 548ec0733e feat: dark theme social network graph with arrows + responsive MI bar
Social Network Graph:
- Dark/black theme with semi-transparent background
- Arrow markers on edges showing connection direction
- Color-coded arrows: grey (default), yellow (connected), green (trusted)
- Updated header, stats, and icon button colors for dark theme

MI (Mycelial Intelligence) Bar:
- Responsive width: full width on mobile, percentage on narrow, fixed on desktop
- Position: moves to bottom on mobile (above toolbar), stays at top on desktop
- Smooth transitions when resizing
- Smaller max height on mobile (300px vs 400px)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:09:33 -08:00
Jeff Emmett 27c82246ef fix: graceful fallback for network graph API errors + Map fixes
Network Graph:
- Add graceful fallback when API returns 401 or other errors
- Falls back to showing room participants as nodes
- Prevents error spam in console for unauthenticated users

Map Shape (linter changes):
- Add isFetchingNearby state for loading indicator
- Improve addAnnotation to accept name/color options
- Add logging for Find Nearby debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:47:19 -08:00
Jeff Emmett 34d7fd71a6 Create task task-044 2025-12-07 15:26:04 -08:00
Jeff Emmett 997be8c916 feat: redesign top-right UI, fix Map interactions and schema validation
UI Changes:
- Add CryptIDDropdown component with Google integration under Integrations
- Remove user presence avatars (moved to network graph)
- New top-right layout: CryptID -> Star -> Gear dropdown -> Question mark
- Settings gear shows dropdown with dark mode toggle + All Settings link
- Network graph label changed to "Social Network"
- Network graph shows for all users including anonymous
- Solo users see themselves as a lone node

Map Shape Fixes:
- Fix stale closure bug: tool clicks now work using activeToolRef
- Fix wheel scroll: native event listener prevents tldraw capture
- Add pointerEvents: 'auto' to map container for proper mouse interaction

Bug Fix:
- Add Map shape sanitization in AutomergeToTLStore for pinnedToView/isMinimized
- Prevents "Expected boolean, got undefined" errors on old Map data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 15:21:48 -08:00
Jeff Emmett b525b14dda Update task task-001 2025-12-07 12:50:32 -08:00
Jeff Emmett df9655bb10 feat: add StandardizedToolWrapper and fix map interactions
- Wrap map component in StandardizedToolWrapper with header bar
- Add onPointerDown={stopPropagation} to all sidebar interactive elements
- Add handleMapWheel that forwards wheel zoom to map component
- Add pinnedToView, tags, isMinimized props for consistency
- Fix TypeScript type for stopPropagation handler

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 12:44:48 -08:00
Jeff Emmett 8771fb04b7 Merge branch 'feature/mapshapeutil-fixes' into dev
Resolve conflict by taking feature branch MapShapeUtil changes for:
- Higher z-index on map buttons
- pointer-events: auto for clickability
- handleWheel with preventDefault for map zoom

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 11:49:44 -08:00
Jeff Emmett 637f05b715 fix: enable open-mapping module with TypeScript fixes
- Fix unused parameter errors (prefix with underscore)
- Fix TrustCircleManager API: add getTrustLevel/setTrustLevel methods
- Fix MyceliumNetwork method calls: addNode→createNode, addHypha→createHypha
- Fix createCommitment signature to use CommitmentParams object
- Fix GeohashCommitment type with proper geohash field
- Fix PRECISION_CELL_SIZE usage (returns {lat,lng} object)
- Add type assertions for fetch response data
- Fix MapCanvas attributionControl type
- Fix GPSCollaborationLayer markerStyle merge with defaults
- Update MapShapeUtil with better event handling:
  - Raise z-index to 10000 for all map buttons
  - Add pointerEvents: auto for button clickability
  - Add handleWheel with preventDefault to enable map zoom
  - Add capturePointerEvents for proper interaction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 11:48:49 -08:00
Jeff Emmett d491d3ea72 Update task task-004 2025-12-06 22:43:37 -08:00
Jeff Emmett 494f2fa025 Update task task-024 2025-12-06 22:43:25 -08:00
Jeff Emmett 48c7e1decb fix: MapShapeUtil cleanup errors and schema validation
- Add isMountedRef to track component mount state
- Fix map initialization cleanup with named event handlers
- Add try/catch blocks for all MapLibre operations
- Fix style change, resize, and annotations effects with mounted checks
- Update callbacks (observeUser, selectSearchResult, findNearby) with null checks
- Add legacy property support (interactive, showGPS, showSearch, showDirections, sharingLocation, gpsUsers)
- Prevents 'getLayer' and 'map' undefined errors during component unmount
- Complete Mapus-style UI with sidebar, search, find nearby, annotations, and drawing tools

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 22:42:59 -08:00
Jeff Emmett 8d4562848a fix: MapShapeUtil cleanup errors and schema validation
- Add isMountedRef to track component mount state
- Fix map initialization cleanup with named event handlers
- Add try/catch blocks for all MapLibre operations
- Fix style change, resize, and annotations effects with mounted checks
- Update callbacks (observeUser, selectSearchResult, findNearby) with null checks
- Add legacy property support (interactive, showGPS, showSearch, showDirections, sharingLocation, gpsUsers)
- Prevents 'getLayer' and 'map' undefined errors during component unmount
- Complete Mapus-style UI with sidebar, search, find nearby, annotations, and drawing tools

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 22:39:45 -08:00
Jeff Emmett 23c1705d97 Update task task-024 2025-12-06 22:32:53 -08:00
Jeff Emmett 88e4a034e1 Create task task-043 2025-12-06 22:31:37 -08:00
Jeff Emmett bb3c531513 Update task task-024 2025-12-06 22:21:50 -08:00
Jeff Emmett 623190fb6a Update task task-024 2025-12-05 23:22:36 -08:00
Jeff Emmett 70085852d8 feat: add canvas users to CryptID connections dropdown
Shows all collaborators currently on the canvas with their connection status:
- Green border: Trusted (edit access)
- Yellow border: Connected (view access)
- Grey border: Not connected

Users can:
- Add unconnected users as Connected or Trusted
- Upgrade Connected users to Trusted
- Downgrade Trusted users to Connected
- Remove connections

Also fixes TypeScript errors in networking module.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 23:08:16 -08:00
Jeff Emmett bb22ee62d2 Update task task-027 2025-12-05 22:55:21 -08:00
Jeff Emmett 6775dcca93 fix: correct networking imports and API response format
- Fix useSession → useAuth import (matches actual export)
- Fix GraphEdge properties: source/target instead of fromUserId/toUserId
- Add missing trustLevel, effectiveTrustLevel to edge response
- Add myConnections to NetworkGraph type
- Prefix unused myConnections param with underscore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-05 22:51:58 -08:00
Jeff Emmett e30dd4d1ec Update task task-041 2025-12-05 22:46:57 -08:00
Jeff Emmett fad0c8af9a Create task task-042 2025-12-05 22:46:50 -08:00
Jeff Emmett 5af19bbbb2 feat: integrate read-only mode for board permissions
- Add permission fetching and state management in Board.tsx
- Fetch user's permission level when board loads
- Set tldraw to read-only mode when user has 'view' permission
- Show AnonymousViewerBanner for unauthenticated users
- Banner prompts CryptID sign-up with your specified messaging
- Update permission state when user authenticates
- Wire up permission API routes in worker/worker.ts
  - GET /boards/:boardId/permission
  - GET /boards/:boardId/permissions (admin)
  - POST /boards/:boardId/permissions (admin)
  - DELETE /boards/:boardId/permissions/:userId (admin)
  - PATCH /boards/:boardId (admin)
- Add X-CryptID-PublicKey to CORS allowed headers
- Add PUT, PATCH, DELETE to CORS allowed methods

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-05 22:45:31 -08:00
Jeff Emmett 633dfcb294 Update task task-024 2025-12-05 22:40:20 -08:00
Jeff Emmett 9b350a9863 Update task task-018 2025-12-05 22:39:25 -08:00
Jeff Emmett 1359283a79 Update task task-041 2025-12-05 22:38:33 -08:00
Jeff Emmett 9d513e37bd feat: implement user permissions system (view/edit/admin)
Phase 1 of user permissions feature:
- Add board permissions schema to D1 database
  - boards table with owner, default_permission, is_public
  - board_permissions table for per-user permissions
- Add permission types (PermissionLevel) to worker and client
- Implement permission API handlers in worker/boardPermissions.ts
  - GET /boards/:boardId/permission - check user's permission
  - GET /boards/:boardId/permissions - list all (admin only)
  - POST /boards/:boardId/permissions - grant permission (admin)
  - DELETE /boards/:boardId/permissions/:userId - revoke (admin)
  - PATCH /boards/:boardId - update board settings (admin)
- Update AuthContext with permission fetching and caching
  - fetchBoardPermission() - fetch and cache permission for a board
  - canEdit() - check if user can edit current board
  - isAdmin() - check if user is admin for current board
- Create AnonymousViewerBanner component with CryptID signup prompt
- Add CSS styles for anonymous viewer banner
- Fix automerge sync manager to flush saves on peer disconnect

Permission levels:
- view: Read-only, cannot create/edit/delete shapes
- edit: Can modify board contents
- admin: Full access + permission management

Next steps:
- Integrate with Board component for read-only mode
- Wire up permission checking in Automerge sync
- Add permission management UI for admins

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-05 22:27:12 -08:00
Jeff Emmett 8e9f6fbd19 Update task task-041 2025-12-05 22:24:37 -08:00
Jeff Emmett 96abf73e48 Create task task-041 2025-12-05 22:17:54 -08:00
Jeff Emmett 776ea78543 Update task task-027 2025-12-05 14:05:24 -08:00
Jeff Emmett 9df6943c30 Create task task-040 2025-12-05 13:58:56 -08:00