Commit Graph

507 Commits

Author SHA1 Message Date
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
Jeff Emmett 26ebed5c5d chore: exclude open-mapping from build, fix TypeScript errors
- Add src/open-mapping/** to tsconfig exclude (21K lines, to harden later)
- Delete MapShapeUtil.backup.tsx
- Fix ConnectionStatus type in OfflineIndicator
- Fix data type assertions in MapShapeUtil (routing/search)
- Fix GoogleDataService.authenticate() call with required param
- Add ts-expect-error for Automerge NetworkAdapter 'ready' event
- Add .wasm?module type declaration for Wrangler imports
- Include GPS location sharing enhancements in MapShapeUtil

TypeScript now compiles cleanly. Vite build needs NODE_OPTIONS for memory.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 12:16:29 -08:00
Jeff Emmett 698d3a2c71 Update task task-024 2025-12-04 21:35:10 -08:00
Jeff Emmett a1bef4174a chore: add D1 database ID and refactor MapShape
- Add production D1 database ID for cryptid-auth
- Refactor MapShapeUtil for cleaner implementation
- Add map layers module
- Update UI components

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 21:32:46 -08:00
Jeff Emmett e9fef27f82 Update task task-024 2025-12-04 21:29:10 -08:00
Jeff Emmett 79626b0b0e Update task task-024 2025-12-04 20:01:59 -08:00
Jeff Emmett a5148e9f38 Update task task-027 2025-12-04 19:53:01 -08:00
Jeff Emmett 4b2e81a35b Update task task-037 2025-12-04 19:52:54 -08:00
Jeff Emmett 07425ba15b Update task task-024 2025-12-04 19:52:54 -08:00
Jeff Emmett bf4d8095e7 Merge feature/open-mapping: Automerge CRDT sync and open-mapping module
Key changes:
- Automerge CRDT infrastructure for offline-first sync
- Open-mapping collaborative route planning module
- MapShape integration with canvas
- Connection status indicator
- Binary document persistence in R2
- Resolved merge conflicts with PrivateWorkspace feature

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:48:38 -08:00
Jeff Emmett f73e223349 Update task task-024 2025-12-04 19:45:28 -08:00
Jeff Emmett 2dd8f90d5b feat: implement binary Automerge CRDT sync and open-mapping module
Binary Automerge Sync:
- CloudflareAdapter: binary sync messages with documentId tracking
- Message buffering for early server messages before documentId set
- Worker sends initial sync on WebSocket connect
- Removed JSON HTTP POST sync in favor of native Automerge protocol
- Multi-client binary sync verified working

Worker CRDT Infrastructure:
- automerge-init.ts: WASM initialization for Cloudflare Workers
- automerge-sync-manager.ts: sync state management per peer
- automerge-r2-storage.ts: binary document persistence to R2
- AutomergeDurableObject: integrated CRDT sync handling

Open Mapping Module:
- Collaborative map component with real-time sync
- MapShapeUtil for tldraw canvas integration
- Presence layer with location sharing
- Privacy system with ZK-GPS protocol concepts
- Mycelium network for organic route visualization
- Conic sections for map projection optimization
- Discovery system (spores, hunts, collectibles, anchors)
- Geographic transformation utilities

UI Updates:
- ConnectionStatusIndicator for offline/sync status
- Map tool in toolbar
- Context menu updates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:45:02 -08:00
Jeff Emmett 17250fe056 Update task task-027 2025-12-04 19:42:48 -08:00
Jeff Emmett be08a49e27 Update task task-005 2025-12-04 19:41:18 -08:00
Jeff Emmett f81994714b Update task task-039 2025-12-04 19:41:04 -08:00
Jeff Emmett b01bfb830d Update task task-039 2025-12-04 19:40:55 -08:00
Jeff Emmett d4a0950eff feat: add Google integration to user dropdown and keyboard shortcuts panel
- Add Google Workspace integration directly in user dropdown (CustomPeopleMenu)
  - Shows connection status (Connected/Not Connected)
  - Connect button to trigger OAuth flow
  - Browse Data button to open GoogleExportBrowser modal
- Add toggleable keyboard shortcuts panel (? icon)
  - Shows full names of tools and actions with their shortcuts
  - Organized by category: Tools, Custom Tools, Actions, Custom Actions
  - Toggle on/off by clicking, closes when clicking outside
- Import GoogleExportBrowser component for data browsing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:21:21 -08:00
Jeff Emmett 6012b3dad9 Update task task-039 2025-12-04 18:45:13 -08:00
Jeff Emmett 682a0bf8d9 Update task task-039 2025-12-04 18:35:47 -08:00
Jeff Emmett 74ddadc5cb Update task task-039 2025-12-04 18:28:48 -08:00
Jeff Emmett 1d591e4648 Update task task-039 2025-12-04 18:21:01 -08:00
Jeff Emmett b3be1863ae Create task task-039 2025-12-04 18:12:01 -08:00
Jeff Emmett 3829ae2c52 Update task task-038 2025-12-04 18:00:58 -08:00
Jeff Emmett b06d55dfb3 Create task task-038 2025-12-04 18:00:52 -08:00
Jeff Emmett e341c45c55 Update task task-035 2025-12-04 18:00:10 -08:00
Jeff Emmett af669beac2 feat: implement Phase 5 - permission flow and drag detection for data sovereignty
- Add VisibilityChangeModal for confirming visibility changes
- Add VisibilityChangeManager to handle events and drag detection
- GoogleItem shapes now dispatch visibility change events on badge click
- Support both local->shared and shared->local transitions
- Auto-detect when GoogleItems are dragged outside PrivateWorkspace
- Session storage for "don't ask again" preference

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:59:58 -08:00
Jeff Emmett 90f2f260f5 Update task task-025 2025-12-04 17:53:08 -08:00
Jeff Emmett a9f262d591 feat: Add GoogleItemShape with privacy badges (Phase 4)
Privacy-aware item shapes for Google Export data:

- GoogleItemShapeUtil: Custom shape for Google items with:
  - Visual distinction: dashed border + shaded overlay for LOCAL items
  - Solid border for SHARED items
  - Privacy badge (🔒 local, 🌐 shared) in top-right corner
  - Click badge to trigger visibility change (Phase 5)
  - Service icon, title, preview, date display
  - Optional thumbnail support for photos
  - Dark mode support

- GoogleItemTool: Tool for creating GoogleItem shapes

- Updated ShareableItem type to include `service` and `thumbnailUrl`

- Updated usePrivateWorkspace hook to create GoogleItem shapes
  instead of placeholder text shapes

Items added from GoogleExportBrowser now appear as proper
GoogleItem shapes with privacy indicators inside the workspace.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:52:54 -08:00
Jeff Emmett 00dd109df7 Update task task-032 2025-12-04 17:42:07 -08:00
Jeff Emmett 9b9d4d2ad9 Update task task-024 2025-12-04 17:41:56 -08:00
Jeff Emmett 0190275066 Update task task-037 2025-12-04 17:41:42 -08:00
Jeff Emmett 0ddadb9358 Update task task-037 2025-12-04 17:01:26 -08:00
Jeff Emmett 03d328ab3a Update task task-025 2025-12-04 16:54:39 -08:00
Jeff Emmett c4b148df94 feat: Add Private Workspace zone for data sovereignty (Phase 3)
- PrivateWorkspaceShapeUtil: Frosted glass container shape with:
  - Dashed indigo border for visual distinction
  - Pin/collapse/close buttons in header
  - Dark mode support
  - Position/size persistence to localStorage
  - Helper functions for zone detection

- PrivateWorkspaceTool: Tool for creating workspace zones

- usePrivateWorkspace hook:
  - Creates/toggles workspace visibility
  - Listens for 'add-google-items-to-canvas' events
  - Places items inside the private zone
  - Persists visibility state

- PrivateWorkspaceManager: Headless component that manages
  workspace lifecycle inside Tldraw context

Items added from GoogleExportBrowser will now appear in the
Private Workspace zone as placeholder text shapes (Phase 4
will add proper GoogleItemShape with visual badges).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:54:27 -08:00
Jeff Emmett e76ad650dd Create task task-037 2025-12-04 16:49:08 -08:00
Jeff Emmett 8f5da80ed9 Update task task-025 2025-12-04 16:46:41 -08:00
Jeff Emmett d182d25e8c Update task task-033 2025-12-04 16:46:28 -08:00
Jeff Emmett 5786848714 refactor: Rename GoogleDataBrowser to GoogleExportBrowser
- Rename component file and interface for consistent naming
- Update all imports and state variables in UserSettingsModal
- Better reflects the purpose as a data export browser

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:46:10 -08:00
Jeff Emmett 15e77532b9 Create task task-036 2025-12-04 16:45:11 -08:00