mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-01 03:44:12 -04:00
Backend (Tauri): - Add AppState with current_library_id and selected_file_ids - Persist library ID to disk for app restarts - Add Tauri commands: get/set_current_library_id, get/set_selected_file_ids - Emit library-changed and selected-files-changed events to all windows - Inject window globals to all windows (not just main) Platform abstraction: - Add library ID methods: getCurrentLibraryId, setCurrentLibraryId, onLibraryIdChanged - Add window management: showWindow, closeWindow, onWindowEvent, getCurrentWindowLabel - Add selected files methods: getSelectedFileIds, setSelectedFileIds, onSelectedFilesChanged - Implement all methods in Tauri platform layer App layer: - Query library ID on window mount from platform state - Listen for library-changed events and update client - Fix event emission to trigger hooks (emitEvent: true) - Remove direct Tauri imports from App.tsx This enables: ✅ Library ID persists across app restarts ✅ All windows (main, inspector, quick preview) sync library ID ✅ Inspector receives selected files from main window in real-time ✅ Popout windows get current state on mount ✅ Clean platform abstraction - zero Tauri code in interface 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>