Open
Conversation
Add "garden pattern" synchronization where a primary device (desktop) acts as a "garden" hub and portals (laptop/phone) sync via WebRTC P2P when on same network. Key Features: - Yjs CRDT-based sync for conflict-free replication - WebRTC P2P connection with BroadcastChannel fallback - Legend State <-> Yjs bidirectional sync adapter - Zero-server architecture (uses public signaling servers) - Optional encryption with shared password - Real-time connection status and peer count indicators Architecture: - YjsGardenSync adapter bridges Legend State observables with Yjs shared types - Automatic lifecycle management based on settings - All 7 entity collections synced: moments, areas, habits, cycles, phase configs, crystallized routines, and metric logs UI Integration: - Garden Sync settings section in SettingsDrawer - Enable/disable toggle with device role selector (Garden/Portal) - Room name generator and input (6-char code: ABC123) - Optional password for encrypted sync - Connection status indicator with peer count - Debug mode toggle for development Commands: - :garden - Open garden sync settings via Vim command mode - Cmd+K -> "Garden Sync Settings" in command palette Technical Details: - Dependencies: yjs@13.6.27, y-webrtc@10.3.0, y-protocols@1.0.6 - Sync managed in StoreInitializer with useEffect lifecycle - Settings persisted to localStorage via Legend State - Status and peer count exposed as observables for UI reactivity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WebrtcProvider expects password to be string | undefined, not string | null. Convert null to undefined using nullish coalescing operator. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Change generic type to any for Legend State observable compatibility - Fix WebRTC provider event types (status, peers, synced) - Use object spread instead of assign for observable updates - Fix peer counting logic All production code TypeScript errors resolved. Test file errors remain but are unrelated to garden sync implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add dual-mode support to Garden Sync: - WebRTC mode: P2P sync for web browsers (existing) - WebSocket mode: Local server sync for Tauri desktop (new) Changes: - Auto-detect environment (Tauri vs Web) and choose appropriate mode - Add y-websocket provider for local server connections - Create tauri-utils for environment detection - Update YjsGardenSync to support both WebRTC and WebSocket providers - Different event handling for each provider type - Show sync mode in settings UI (WebSocket for Tauri, WebRTC for Web) WebSocket mode: - Connects to ws://localhost:8765 by default - Desktop runs as Garden (server) - Phone/laptop connects as Portal (client) - Reliable local network sync without NAT/firewall issues Next steps for Tauri branch: - Implement Rust WebSocket server using yrs crate - Run server on port 8765 - Handle Yjs sync protocol - Optional: Add mDNS service advertisement 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add detailed guide for implementing WebSocket server in Tauri branch: - Rust dependencies and setup - Yjs server implementation with yrs crate - WebSocket connection handling - Yjs sync protocol explanation - mDNS service advertisement (optional) - Testing instructions - Simplified Node.js alternative - Architecture diagrams This guide explains what needs to be built on the Tauri side to enable reliable local-network Garden Sync between desktop and mobile devices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add "garden pattern" synchronization where a primary device (desktop) acts as a "garden" hub and portals (laptop/phone) sync via WebRTC P2P when on same network.
Key Features:
Architecture:
UI Integration:
Commands:
Technical Details:
🤖 Generated with Claude Code
Description
Brief description of the changes in this PR.
Type of Change
Related Issues
Closes #(issue number)
Testing
pnpm test)pnpm lint)Screenshots (if applicable)
Add screenshots or GIFs demonstrating the changes.
Checklist
Philosophy Alignment
How does this change align with Zenborg's principles?