mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-30 11:23:07 -04:00
feat: Revamp Window Management and UI Components for macOS App
- Updated `SpacedriveApp` to implement multiple window groups, including a main companion window, browser window, icon showcase, and inspector, each with custom title bars and shared state management. - Introduced `NativeTrafficLights` and `CustomTitleBar` components to enhance window appearance and functionality, integrating native macOS traffic lights seamlessly. - Refactored `AppDelegate` to initialize app state and manage window configurations based on development settings. - Enhanced `SharedAppState` to support dynamic window opening based on user preferences and development configurations. - Added new `BrowserView` and associated components for improved file browsing experience, including sidebar navigation and content display. - Updated `SpacedriveColors` to reflect the use of native macOS colors for traffic lights, simplifying color management across the app.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use tracing::info;
|
||||
use tracing::{info, warn};
|
||||
|
||||
use crate::infra::daemon::rpc::RpcServer;
|
||||
use crate::Core;
|
||||
|
||||
@@ -499,6 +499,7 @@ impl LocationWatcher {
|
||||
let metrics = self.metrics.clone();
|
||||
|
||||
let (tx, mut rx) = mpsc::channel(self.config.event_buffer_size);
|
||||
let tx_clone = tx.clone();
|
||||
|
||||
// Create file system watcher
|
||||
let mut watcher = notify::recommended_watcher(move |res| {
|
||||
@@ -514,15 +515,12 @@ impl LocationWatcher {
|
||||
// Convert notify event to our WatcherEvent
|
||||
let watcher_event = WatcherEvent::from_notify_event(event);
|
||||
|
||||
// Use spawn_blocking to avoid blocking the notify callback
|
||||
// This ensures we never drop events - we wait for buffer space
|
||||
let tx_clone = tx.clone();
|
||||
tokio::spawn(async move {
|
||||
if let Err(e) = tx_clone.send(watcher_event).await {
|
||||
error!("Failed to send watcher event (receiver dropped): {}", e);
|
||||
// This should only happen if the receiver is dropped
|
||||
}
|
||||
});
|
||||
// Send event directly to avoid runtime context issues
|
||||
// Use try_send since we're in a sync context
|
||||
if let Err(e) = tx_clone.try_send(watcher_event) {
|
||||
error!("Failed to send watcher event: {}", e);
|
||||
// This could happen if the channel is full or receiver is dropped
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
error!("File system watcher error: {}", e);
|
||||
|
||||
Reference in New Issue
Block a user