Commit Graph

627 Commits

Author SHA1 Message Date
Jeff Emmett cc1928852f fix: use tldraw tick event for synchronous pinned shape updates
Replace requestAnimationFrame polling with tldraw's 'tick' event which
fires synchronously with the render cycle. This ensures the pinned shape
position is updated BEFORE rendering, eliminating the visual lag where
the shape appeared to "chase" the camera during zooming.

Changes:
- Use editor.on('tick') instead of requestAnimationFrame polling
- Remove throttling (no longer needed with tick event)
- Reduce position tolerance from 0.5 to 0.01 for more precise tracking
- Simplify code by removing unnecessary camera tracking refs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 20:12:08 -05:00
Jeff Emmett 6f57c767f4 fix: prevent ValidationError by not setting undefined values in shape.meta
When unpinning a shape, the previous code set pinnedAtZoom, originalX, and
originalY to undefined in shape.meta. This caused a ValidationError because
tldraw requires JSON serializable values (undefined is not valid JSON).

Fixed by using object destructuring to exclude these properties from meta
instead of setting them to undefined.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 20:04:55 -05:00
Jeff Emmett 6e29384a79 fix: improve pinned shape zoom behavior - maintain constant visual size
- Pinned shapes now stay exactly the same size visually during zoom
- Uses CSS transform scale instead of changing w/h props
- Content inside shapes renders identically at all zoom levels
- Stores pinnedAtZoom in shape.meta for reference
- Returns to original position smoothly when unpinned
- Removed size-changing logic that was causing content reflow issues

The transform approach ensures text, UI elements, and all content
inside pinned shapes remain pixel-perfect regardless of canvas zoom.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 20:00:29 -05:00
Jeff Emmett 5d9f41c64b refactor: reorder context menu and remove Collections
- Move "Create Tool" to top of context menu
- Move "Shortcut to Frames" to second position
- Remove "Collections" submenu (functionality still available via keyboard shortcuts)
- Cleaner menu structure prioritizing creation tools

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 19:49:35 -05:00
Jeff Emmett 865d6f7681 feat: replace MycrozineTemplate with MycroZineGenerator in toolbar and context menu
- Updated CustomToolbar.tsx to use MycroZineGenerator tool
- Updated CustomContextMenu.tsx to use MycroZineGenerator in Create Tool submenu
- Updated overrides.tsx with MycroZineGenerator tool definition
- Removed all references to old MycrozineTemplate

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 19:44:08 -05:00
Jeff Emmett 0256f97034 feat: add MycroZine Generator shape with 5-phase workflow
Implements interactive 8-page zine creation tool:
- Phase 1: Ideation - chat UI for topic/content planning
- Phase 2: Drafts - generates 8 pages, spawns on canvas
- Phase 3: Feedback - approve/edit individual pages
- Phase 4: Finalizing - regenerate pages with feedback
- Phase 5: Complete - print layout download, template save

Features:
- Style selector (punk-zine, minimal, collage, retro, academic)
- Tone selector (rebellious, playful, informative, poetic)
- Chat-based ideation workflow
- Page grid with approval/feedback UI
- LocalStorage template persistence
- Punk green (#00ff00) theme

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 19:35:28 -05:00
Jeff Emmett eb778a1848 Update task task-055 2025-12-15 19:34:43 -05:00
Jeff Emmett 30d23ba56f Update task task-055 2025-12-15 19:27:36 -05:00
Jeff Emmett 6db2d9c576 fix: improve backwards compatibility for older JSON imports
- Add validation for highlight shapes (same as draw)
- Improve segment validation to check for NaN/Infinity in point coordinates
- Add more custom shape types to valid shapes list
- Fix arrow shape validation (use start/end props instead of points array)
- Fix line shape validation (uses object format for points, not array)
- Better error messages for invalid shapes

Prevents "No nearest point found" errors when importing older files
with malformed path geometry data.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 19:13:20 -05:00
Jeff Emmett c2469a375d perf: optimize bundle size with lazy loading and dependency removal
- Add route-level lazy loading for all pages (Default, Board, Dashboard, etc.)
- Remove gun, webnative, holosphere dependencies (175 packages removed)
- Stub HoloSphereService for future Nostr integration (keeps h3-js for holon calculations)
- Stub FileSystemContext (webnative removed)
- Defer Daily.co initialization until needed
- Add loading spinner for route transitions
- Remove large-utils manual chunk from vite config

Initial page load significantly reduced - heavy Board component (7.5MB)
now loads on-demand instead of upfront.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 18:59:52 -05:00
Jeff Emmett 356630d8f1 Create task task-055 2025-12-15 18:41:25 -05:00
Jeff Emmett 7d9f63430a Update task task-053 2025-12-15 18:41:25 -05:00
Jeff Emmett 4c51b0a602 Create task task-053 2025-12-15 18:41:10 -05:00
Jeff Emmett 14624b1372 Update task task-054 2025-12-15 18:40:44 -05:00
Jeff Emmett 0dab90d6e6 Update task task-053 2025-12-15 18:40:44 -05:00
Jeff Emmett 6e40934db3 Create task task-054 2025-12-15 18:40:33 -05:00
Jeff Emmett e960f5c061 Create task task-053 2025-12-15 18:40:33 -05:00
Jeff Emmett 173f80600c feat: re-enable Map tool and add GPS location sharing
- Re-enable Map tool in CustomToolbar and CustomContextMenu
- Add GPS location sharing state and UI to MapShapeUtil
- Show collaborator locations on map with colored markers
- Add toggle button to share/stop sharing your location
- Cleanup GPS watch and markers on component unmount

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 18:39:26 -05:00
Jeff Emmett e94ceb39c9 fix: resolve user identity caching issues on logout/login
- Preserve tldraw-user-id-* and crypto keys on logout (prevents duplicate cursors)
- Add session-logged-in event for immediate tool enabling after login
- Add session-cleared event for component state cleanup
- Clear only session-specific data (permissions, graph cache, room ID)
- CryptIDDropdown: reset connections state on logout
- useNetworkGraph: clear graph cache on logout

The key fix is preserving tldraw user IDs across login/logout cycles.
Previously, clearing these IDs caused each login to create a new presence
record while old ones persisted in Automerge, resulting in stacked cursors.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 18:34:41 -05:00
Jeff Emmett 65eee48665 feat: improve keyboard shortcuts UI with Command Palette
- Add openCommandPalette() export function for manual triggering
- Update ? button to open the colorful Command Palette modal instead of dropdown
- Add support for manual opening with Escape and click-outside to close
- Clean up unused shortcut dropdown code and state
- Maintain Ctrl+Shift hold behavior for quick access

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 16:31:35 -05:00
Jeff Emmett eb5698343a Update task task-052 2025-12-15 14:26:10 -05:00
Jeff Emmett 6c81f77ab3 fix: use verified jeffemmett.com domain for admin request emails
Changed from email from 'noreply@canvas.jeffemmett.com' (unverified) to
'Canvas <noreply@jeffemmett.com>' (verified in Resend).

Also added RESEND_API_KEY secret to Cloudflare Worker.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 14:25:44 -05:00
Jeff Emmett b680cc7637 Update task task-052 2025-12-15 13:32:12 -05:00
Jeff Emmett fedd62c87b feat: integrate board protection settings into existing settings dropdown
- Remove separate BoardSettingsDropdown button from UI panel
- Add board protection toggle and editor management to existing settings dropdown
- Show protection section only for admins (board owner or global admin)
- Add ability to toggle view-only mode for protected boards
- Add editor management UI with invite and remove functionality
- Fix TypeScript type annotations for API responses

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 13:05:45 -05:00
Jeff Emmett 6d96c2bbe2 feat: add BoardSettingsDropdown to top-right UI panel
Added the board settings dropdown between ShareBoardButton and StarBoardButton.
Provides access to:
- Board protection toggle (view-only mode)
- Editor management for protected boards
- Admin request functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 12:54:12 -05:00
Jeff Emmett 73071eb6f7 Update task task-052 2025-12-15 12:45:46 -05:00
Jeff Emmett 52503167c8 feat: flip permissions model - everyone edits by default, protected boards opt-in
NEW PERMISSION MODEL:
- All users (including anonymous) can now EDIT by default
- Boards can be marked as "protected" by admin - only listed editors can edit
- Global admins (jeffemmett@gmail.com) have admin on ALL boards
- Added BoardSettingsDropdown with view-only toggle for admins

Backend changes:
- Added is_protected column to boards table
- Added global_admins table
- New getEffectivePermission logic prioritizes: token > global admin > owner > protection status
- New API endpoints: /auth/global-admin-status, /admin/request, /boards/:id/info, /boards/:id/editors
- Admin request sends email via Resend API

Frontend changes:
- BoardSettingsDropdown component with protection toggle and editor management
- Updated AuthContext and Board.tsx to default to 'edit' permission
- isReadOnly now only true for protected boards where user is not an editor

Task: task-052

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 12:43:14 -05:00
Jeff Emmett 9276d85709 Create task task-052 2025-12-15 12:23:11 -05:00
Jeff Emmett 2988b84689 feat: add Drawfast tool, improve share UI, and various UI enhancements
New features:
- Add Drawfast tool and shape for quick drawing
- Add useLiveImage hook for real-time image generation
- Improve ShareBoardButton with better UI and functionality

UI improvements:
- Refactor CryptIDDropdown for cleaner interface
- Enhance components.tsx with better tool visibility handling
- Add context menu and toolbar enhancements
- Update MycelialIntelligenceBar styling

Backend:
- Add board permissions API endpoints
- Update worker with new networking routes
- Add html2canvas dependency

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 00:03:12 -05:00
Jeff Emmett 6f68fcd4ae feat: improve social network presence handling and cleanup
- Add "(you)" indicator on tooltip when hovering current user's node
- Ensure current user always appears in graph even with no connections
- Add new participants immediately to graph (no 30s delay)
- Implement "leave" message protocol for presence cleanup:
  - Client sends leave message before disconnecting
  - Server broadcasts leave to other clients on disconnect
  - Clients remove presence records on receiving leave
- Generate consistent user colors from CryptID username (not session ID)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 00:01:28 -05:00
Jeff Emmett 4a7c6e6650 Update task task-051 2025-12-14 23:58:34 -05:00
Jeff Emmett 78450a9e39 Create task task-051 2025-12-14 23:58:28 -05:00
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