4221 Commits

Author SHA1 Message Date
Jamie Pine
e42e43e4e8 Refactor PeerList UI and imports
- Standardize imports and formatting in PeerList - Move online status
into header and show last seen - Use inline layout for received/changes
stats - Preserve existing behavior when there are no peers
2025-11-25 10:03:47 -08:00
Jamie Pine
2cb1611cb1 Switch to shared sync for spaces and related entities
- Add apply_shared_change handlers for Space, SpaceGroup, and SpaceItem
to upsert by UUID and delete by UUID

- Update registry to use shared_with_query and call apply_shared_change;
remove deletion hooks

- Enhance SyncMonitorPopover to display a colored state badge in a
header bar
2025-11-25 10:03:17 -08:00
Jamie Pine
8b8bade25c Add device-owned space models to sync registry 2025-11-25 09:15:20 -08:00
Jamie Pine
b4ee11e631 Add timeAgo utility to format relative times 2025-11-25 09:11:40 -08:00
Jamie Pine
48e5c6665a Improve sync activity UI and registry sync order 2025-11-25 09:09:15 -08:00
Jamie Pine
7a71718eda Introduce sync activity API and UI monitor
- Add SyncActivityType enum and GetSyncActivity input/output - Implement
SyncActivityAggregator to emit state, activity, and errors - Wire
aggregator into SyncService startup to run in background - Build
frontend SyncMonitor UI: popover, peer list, activity feed, hooks -
Extend TS client types with sync.activity endpoints
2025-11-25 07:00:26 -08:00
Jamie Pine
d2d94e3b72 Merge DB-tracked volumes and emit UI events
- Wire library manager into VolumeManager to enable merging tracked
volumes from the database into runtime state - Validate visibility
before tracking: reject non-user-visible volumes - Merge DB metadata for
tracked volumes (library_id, display_name) into detected volumes and
emit ResourceChanged for user-visible ones - Emit ResourceChanged on
adds and updates; emit ResourceDeleted on removals for user-visible
volumes to support UI reactivity - Generate stable UUIDs for new volumes
from fingerprints (APFS and macOS)
2025-11-25 05:16:40 -08:00
Jamie Pine
69e825fe06 Revert sync to November 14th - Add new sync tests
1. Watermark Messages: - Nov 16: Simple - single my_state_watermark,
single state_watermark in response - Main: Complex - per-resource
my_resource_watermarks HashMap, resource counts, content hashes 2.
DataAvailableNotification: - Nov 16: Doesn't exist - Main: New message
type that triggers watermark exchanges 3. FK Mapper: - Nov 16: Sets
missing FKs to NULL, applies all records - Main: Marks records with
missing FKs as failed, filters them out 4. Watermark Storage (internal,
not in messages): - Nov 16: Single last_watermark per resource - Main:
Dual watermarks - cursor_watermark and
2025-11-24 14:27:32 -08:00
Jamie Pine
742e9f32bf Add Empty type and centralized icon utilities 2025-11-24 07:05:47 -08:00
Jamie Pine
8808e85f4e Add paired devices support across CLI, core, and UI
- Add show_paired flag to device listing (CLI arg and input) - Extend
LibraryDeviceInfo with is_paired and is_connected; include Paired
devices in library listing when requested - Add Devices group to UI
(DevicesGroup) and hook into SpaceGroup - Extend device queries/types to
support show_paired and paired devices - Refactor Dockerfile to
multi-stage Bun + Rust builds; reuse web assets - Remove obsolete
core/ops/entries/mod.rs
2025-11-24 05:22:54 -08:00
Jamie Pine
bcab31462e Add Spacedrive server with embedded daemon
- Introduce an Axum-based HTTP server with an embedded daemon and a
JSON-RPC proxy to the daemon via a Unix socket - Bundle web UI assets
into the server with an assets feature and a build.rs that builds the
frontend using pnpm - Add multi-stage Dockerfile, docker-compose.yml,
and a Distroless runtime image - Provide TrueNAS deployment support with
a build script and setup guide - Add a new web UI (apps/web) with a
Vite-based dev/build flow and a web platform shim for the frontend -
Implement server logic (apps/server/src/main.rs): health, auth, /rpc
proxy and data-dir/socket-path wiring - Include server-specific
Cargo.toml and a comprehensive server README - Add architecture and
memory-focused docs to guide usage and design - Minor core tweak:
simplify location/resource event emission in
core/src/location/manager.rs to align with new flow - Tauri app: adjust
menus to add an Edit submenu and remove unused items
2025-11-23 11:01:01 -08:00
Jamie Pine
8a3387ca69 Add memory system with archive and UI integration 2025-11-23 03:33:19 -08:00
Jamie Pine
d2163d842d Enable ephemeral indexing and update docs 2025-11-22 05:57:51 -08:00
Jamie Pine
bd504a721e Add tagging UI and tag system components 2025-11-22 05:12:55 -08:00
Jamie Pine
672d3d32ef Seed ancestor cache and remove ghost-folder test 2025-11-21 09:20:49 -08:00
Jamie Pine
08f2d551ff Fix ghost folder bug by scoping indexing to path
- Scope the closure query to the indexing path by resolving its entry_id
from directory_paths and use that for descendants; fall back to the
location root if not found. - Seed all ancestors between the location
root and the indexing path into the in-memory cache during the
processing phase to ensure correct parent links. - Seed ancestor
directories into the create path cache to prevent ghost folders on
subpath indexing. - Add test core/tests/indexing_move_folder_bug_test.rs
reproducing the ghost-folder bug when moving a folder into a managed
location and asserting correct parent linkage.
2025-11-21 09:18:03 -08:00
Jamie Pine
008d05414a Refactor file handling in Explorer component
- Updated file type checks from `file.kind.type` to `file.kind` for consistency across various components in the Explorer views.
- Enhanced the `Thumb` component to conditionally hide the icon based on thumbnail loading status.
- Adjusted the `HeroStats` component for improved readability and structure.
- Added a new `iconScale` prop to the `FileInspector` component's thumbnail for better visual scaling.
2025-11-21 08:01:37 -08:00
Jamie Pine
553fadd2d4 Switch to ts-client types from root package 2025-11-20 21:43:48 -08:00
Jamie Pine
8c14803eae identify srt 2025-11-20 12:25:18 -08:00
Jamie Pine
63aa0f73cc Add KeyboardHandler component that wires into the Explorer keyboard -
Integrate KeyboardHandler into ExplorerLayout to enable global keys -
Memoize Explorer state flow (useCallback/useMemo) to reduce re-renders -
Propagate selection state through GridView/FileCard via new
SelectionContext props - Memoize TopBar using React.memo to prevent
unnecessary updates
2025-11-20 11:44:06 -08:00
Jamie Pine
86570a65ed Add job count hook and refactor JobManager UI
- Introduce useJobCount to track active and running jobs via query and
event subscriptions. - Refactor JobManagerPopover to render a separate
content component and rely on the new hook for counts. - Add
JobManagerPopoverContent to render filtered JobList with pause/resume
callbacks and dynamic height. - Update useJobManager to subscribe to job
events via a single filtered subscription, replacing per-event handlers.
- Extend client types to support event_type filtering for subscriptions.
- Tidy up UI logs and minor rendering tweaks in QuickPreview and
ContentRenderer, including folder icon handling. - Adjust storage
overview to use real volume fields and drop dummy data paths
2025-11-20 08:57:10 -08:00
Jamie Pine
32ccf21228 Add SelectionContext and integrate with Explorer 2025-11-20 06:29:23 -08:00
Jamie Pine
8f1737eeab feat: enhance file selection and navigation in Explorer component
- Updated the Explorer context to include additional parameters for file selection and navigation functions, allowing for more flexible file handling.
- Modified the FileCard and FileRow components to pass the complete list of files during selection, improving multi-file operations.
- Refactored the GridView and ListView components to utilize the updated file selection logic, ensuring consistent behavior across views.
- Removed unused directory query logic to streamline the component structure and improve performance.
2025-11-20 05:16:51 -08:00
Jamie Pine
d31ba54080 chore: update subproject commit and add blank lines for consistency
- Updated the subproject commit reference to indicate a dirty state.
- Added blank lines to various files for improved readability and consistency across the codebase.
2025-11-20 04:38:22 -08:00
Jamie Pine
8d751b0713 feat: enhance event filtering and subscription management
- Added `include_descendants` option to event filters, allowing recursive path matching for resource events.
- Updated `affects_path` method to support descendant matching, improving event handling accuracy.
- Refactored subscription logic to utilize the new filtering capabilities, ensuring only relevant events are processed.
- Introduced tests for event filtering to validate exact vs. recursive matching, enhancing reliability of event-driven updates.
- Updated related components to leverage the new filtering options, improving overall performance and user experience.
2025-11-20 04:38:01 -08:00
Jamie Pine
a4e8ed1cbb feat: add .taurignore file and enhance package.json scripts
- Created a new .taurignore file to specify ignored directories for Tauri app changes, improving build efficiency.
- Added a new script "tauri:dev:no-watch" to package.json for running the Tauri development server without file watching, providing more flexibility during development.
- Updated assetProtocol scope in tauri.conf.json to include "/Volumes/**", enhancing asset handling for mounted volumes.
2025-11-19 01:53:26 -08:00
Jamie Pine
08912e141e feat: implement library opening functionality and filesystem watcher
- Added a new "Open Library" menu item to the application, allowing users to select a library folder.
- Implemented the backend logic to handle library opening, including JSON-RPC requests to the daemon.
- Introduced a filesystem watcher in the LibraryManager to monitor library directory changes, enabling automatic opening and closing of libraries based on filesystem events.
- Enhanced error handling for library operations and added relevant logging for better traceability.
- Updated the LibraryError enum to include filesystem watcher errors, improving error reporting.
2025-11-18 18:40:56 -08:00
Jamie Pine
28988eed1b feat: add HLC constructor and enhance indexing tests
- Introduced a new constructor for the HLC struct to allow explicit initialization with timestamp, counter, and device ID.
- Updated indexing tests to improve error handling for entry IDs and added a comprehensive test for reindexing after offline changes, ensuring all original and new files are detected correctly.
2025-11-18 18:23:59 -08:00
Jamie Pine
85012ac165 feat: add proxy generation policy to job configurations
- Introduced a new ProxyPolicy struct to manage video scrubbing settings, including options for enabling and regenerating proxy files.
- Updated JobPolicies to include the new proxy policy with default values.
- Enhanced FileInspector to filter batch events by resource ID for improved event handling.
- Modified useNormalizedCache to skip path validation checks when resourceId is provided, optimizing resource handling.
2025-11-18 05:48:23 -08:00
Jamie Pine
2f6c8a985d feat: enhance location update process and event emission
- Updated the LocationUpdateAction to clone the location before building the ActiveModel, ensuring data integrity during updates.
- Implemented a new event emission for ResourceChanged, providing real-time updates to the UI upon location changes.
- Enhanced error handling for missing entry IDs and directory paths, improving robustness in the update process.
- Refactored the LocationInspector component to include new quick actions for reindexing locations, enhancing user interaction.
- Removed redundant isGlobalList flags from various components to streamline the codebase.
2025-11-18 05:38:37 -08:00
Jamie Pine
e103265e20 feat: enhance location path validation and event routing logic
- Added critical safety checks to validate that indexing paths are within specified location boundaries, preventing potential data loss from incorrect event routing.
- Improved event routing logic in the LocationWatcher to match events to the longest valid location path, ensuring accurate event handling in scenarios with multiple locations.
- Enhanced logging for successful path validation and event routing, providing better insights into the processing flow.
- Introduced unit tests to verify path matching functionality across multiple locations, ensuring robustness in event handling.
2025-11-18 03:39:42 -08:00
Jamie Pine
5a6c3eb5a0 feat: add database migration step to ensure schema consistency
- Implemented a migration step in the LibraryManager to ensure the database schema is up to date before proceeding with operations.
- This change enhances the reliability of the application by preventing potential schema-related issues during runtime.
2025-11-18 02:36:31 -08:00
Jamie Pine
ad63cba189 chore: update subproject commit and add blank lines for consistency
- Updated the subproject commit reference to indicate a dirty state.
- Added blank lines to various files for improved readability and consistency across the codebase.
2025-11-18 02:31:20 -08:00
Jamie Pine
5d1aa8aaa3 fix: update volume tracking and visibility logic
- Marked volumes as user-visible based on specific criteria to prevent redundant or non-useful system volumes from being displayed.
- Enhanced the volume tracking actions to ensure only user-visible volumes are included in tracking and untracking operations.
- Updated the storage overview component to filter and display only user-visible volumes, improving user experience and clarity.
- Refactored related code for better maintainability and readability, ensuring consistent handling of volume visibility across the application.
2025-11-18 01:52:33 -08:00
Jamie Pine
ef25390441 feat: add unique bytes tracking and cache refresh functionality for volumes
- Introduced a new `unique_bytes` field in the volume model to track deduplicated content size.
- Implemented a volume refresh action to recalculate unique bytes for all volumes owned by the device, emitting a cache refresh event to invalidate frontend caches.
- Updated the storage overview component to display unique bytes and other volume statistics.
- Enhanced the event system to handle cache invalidation events, ensuring real-time updates across the application.
- Added necessary migrations and database updates to support the new volume tracking features.
2025-11-17 23:37:48 -08:00
Jamie Pine
298b069a65 refactor: streamline event and log handling in the CLI and core
- Refactored the event monitoring logic in the CLI to improve readability and maintainability.
- Updated the event summarization function to enhance formatting and clarity of event messages.
- Introduced a dedicated log streaming mechanism in the core, separating log handling from event processing.
- Enhanced the RPC server to support real-time log subscriptions, allowing for more efficient log message delivery.
- Cleaned up legacy log event handling, ensuring a clearer distinction between events and logs in the system.
2025-11-17 09:22:41 -08:00
Jamie Pine
7769576a6c feat: introduce dedicated log streaming bus for improved log handling
- Added a new LogBus to separate log message streaming from the main event bus, reducing overhead and preventing event pollution.
- Updated the Core struct to include a logs field for the new LogBus.
- Modified the RPC server to register the LogBus for real-time log message broadcasting.
- Enhanced the log emitter to utilize the new LogBus, ensuring efficient log message handling and subscriber management.
- Cleaned up related code and comments for clarity and maintainability.
2025-11-17 08:51:50 -08:00
Jamie Pine
ca8bb8534e feat: add events monitoring functionality to CLI
- Introduced a new Events domain for monitoring events in real-time, allowing users to filter events by type, library ID, job ID, and device ID.
- Updated the CLI to include an Events command, enabling users to access the new monitoring features.
- Enhanced the Cargo.lock and related modules to support the new functionality, ensuring seamless integration with existing systems.
- Added necessary arguments and command handling for the Events command in the CLI.
2025-11-17 08:25:00 -08:00
Jamie Pine
c6cda350be feat: media proxy and thumbstrip functionality
- Introduced new modules and actions for generating media proxies and thumbstrips, improving media handling capabilities.
- Added configuration, error handling, and processing logic for both proxy and thumbstrip generation.
- Updated existing media operations to integrate new functionalities, ensuring seamless media processing and user experience.
- Enhanced tests to cover new features and ensure reliability in media operations.
2025-11-17 04:24:05 -08:00
Jamie Pine
91b6808c5e refactor: remove unused StateSyncHandler dead code
The StateSyncHandler was a leftover from an earlier architecture where
protocol handlers were meant to be separate. The current implementation
bypasses it entirely by having the network protocol handler directly
call PeerSync::get_device_state() which properly uses the registry.

Backfill has been working fine because it completely avoids this code path.

Changes:
- Remove StateSyncHandler struct and all its methods from protocol_handler.rs
- Remove state_handler field from BackfillManager
- Update exports in mod.rs
- Clean up imports in backfill.rs

This eliminates the confusing TODO comments about serialization that
were already implemented elsewhere.
2025-11-17 00:42:37 -08:00
Jamie Pine
be1c957f96 refactor: improve device filtering and broadcasting logic for synchronization
- Added logic to exclude the current device from sync partners, ensuring that only other paired devices are considered.
- Enhanced the filtering process to ensure devices have valid NodeId mappings, improving the accuracy of synchronization partners.
- Implemented concurrency limiting for broadcast tasks to prevent network overload, enhancing overall performance and reliability.
- Improved logging to provide detailed insights into the computed sync partners and broadcasting status.
2025-11-16 15:23:33 -08:00
Jamie Pine
91f8503426 refactor: enhance foreign key mapping and watermark management for improved synchronization
- Introduced a new `.ignore` file to prevent auto-reload on core directory changes.
- Updated foreign key mapping logic to mark records with missing dependencies for retry, ensuring parent relationships are preserved.
- Enhanced watermark management by migrating to a dual watermark schema, allowing for better tracking of validated states and recovery points.
- Added content hash computation for device-owned resources to facilitate update detection during synchronization.
- Improved logging to provide insights into filtered records and watermark promotions, enhancing overall synchronization accuracy.
2025-11-16 15:03:26 -08:00
Jamie Pine
06721c6d46 refactor: include timestamp in state change messages for improved synchronization accuracy
- Added logic to extract and parse a timestamp from change data, ensuring that state change messages include accurate timing information.
- Updated the BufferedUpdate structure to accommodate the new timestamp field, enhancing the clarity and utility of synchronization events.
2025-11-16 14:08:57 -08:00
Jamie Pine
efe52f7f1f refactor: increase sync event bus capacity and optimize state change broadcasting
- Updated the sync event bus capacity from 10,000 to 100,000 events to better handle bulk indexing and stress scenarios.
- Enhanced the state change broadcasting logic by grouping changes by model type, allowing for more efficient processing and reducing network load through batched StateBatch messages.
- Improved logging to reflect the new capacity and efficiency gains in the broadcasting process.
2025-11-16 14:07:46 -08:00
Jamie Pine
887c2d1c0d refactor: update indexed_at timestamp for synchronization consistency
- Added logic to update the indexed_at timestamp in both entry and aggregation phases to ensure that changes are picked up during incremental sync.
2025-11-16 13:30:38 -08:00
Jamie Pine
93b857b3d8 refactor: clean up entry synchronization logic and improve backfill handling
- Removed outdated sync readiness rules from the entry model, simplifying the logic for determining synchronization eligibility.
- Enhanced the backfill manager's method for handling shared resources, improving code clarity and maintainability.
- Updated subproject commit reference to indicate a dirty state, reflecting recent changes.
2025-11-16 12:24:35 -08:00
Jamie Pine
e5c87ffda5 refactor: optimize entry filtering in database queries
- Replaced complex subquery logic with raw SQL for filtering entries based on device ownership, improving query performance and readability.
- Enhanced error handling for UUID synchronization to ensure data consistency.
- Streamlined code by consolidating delete and count operations in the entry closure rebuild process.
- Improved logging in the backfill manager to provide better insights into state changes and record processing.
2025-11-16 11:58:13 -08:00
Jamie Pine
231380f095 refactor: enhance backfill logic to support surgical recovery for device-owned resources
- Introduced a sentinel value "SKIP_SHARED" to allow surgical recovery that skips shared backfill, focusing on device-owned resources only.
- Updated the backfill manager to handle the new logic, improving efficiency in synchronization processes.
- Enhanced logging to clarify the conditions under which shared backfill is skipped, providing better insights into the recovery process.
2025-11-16 11:30:56 -08:00
Jamie Pine
83d8c94c6c refactor: streamline mismatch resource tracking in PeerSync
- Moved the initialization of mismatched resource tracking outside the block for improved clarity and efficiency in watermark comparison checks.
- Enhanced code organization by reducing redundancy in the mismatch handling logic, ensuring better maintainability and readability.
- Improved comments to clarify the purpose of tracking mismatched resources during synchronization processes.
2025-11-16 11:19:23 -08:00
Jamie Pine
8f5a81699e refactor: optimize watermark comparison logic in PeerSync
- Updated the catch-up logic to skip watermark comparisons when count validation confirms synchronization, preventing unnecessary catch-up operations.
- Enhanced comments to clarify the rationale behind the changes, emphasizing the importance of accurate state management in synchronization processes.
- Improved logging to provide insights into the decision-making process regarding watermark-based catch-up.
2025-11-16 11:17:14 -08:00