42 Commits

Author SHA1 Message Date
Jamie Pine
6b5b37fe93 refactor: update wire method strings and improve code formatting 2025-10-20 11:03:54 -07:00
Jamie Pine
63397de4f5 yes 2025-10-11 10:49:32 -07:00
Jamie Pine
bc636a1fdb remove auto generated swift types 2025-10-11 10:31:43 -07:00
Jamie Pine
94a52dd2df cleanup 2025-10-11 08:48:11 -07:00
Jamie Pine
18397a312c feat: Implement device disconnection and reconnection fixes
- Added `session_keys` to the `Disconnected` state to preserve encryption keys for reconnection.
- Enhanced `set_device_connected` method to handle transitions from `Disconnected` to `Connected` states.
- Updated device query to include `Disconnected` devices, ensuring they remain visible in the device list.
- Improved overall device state management for seamless reconnection and stability in device connections.
2025-10-04 23:58:58 -07:00
Jamie Pine
910dce67f5 feat: Add new documentation and enhance CLI functionality
- Introduced three new markdown files: CLI_LIBRARY_SYNC_COMPLETE.md, IMPLEMENTATION_COMPLETE.md, and LIBRARY_SYNC_SETUP_IMPLEMENTATION.md for comprehensive documentation.
- Updated various CLI domain modules to improve argument handling and output formatting.
- Enhanced device, index, job, library, location, network, and search modules for better integration and user experience.
- Refactored code across multiple domains to improve maintainability and clarity.
2025-10-04 21:31:47 -07:00
Jamie Pine
f9238545a3 feat: Add device management commands and enhance device listing functionality
- Introduced `DevicesCmd` for managing device operations within the CLI, allowing users to list devices from the library database.
- Implemented `DevicesListArgs` to support detailed device information retrieval, including offline status and capabilities.
- Updated the command handling logic to integrate device operations seamlessly with existing commands.
- Refactored device-related queries and outputs to improve data handling and presentation in the CLI.
- Enhanced the overall structure of device management code for better maintainability and clarity.
2025-10-04 20:18:03 -07:00
Jamie Pine
b46487acff feat: Enhance JobManager with event listening and job refresh capabilities
- Replaced initial job polling with event listening for job updates, improving responsiveness.
- Introduced a manual job refresh method to allow users to refresh jobs on demand.
- Updated polling mechanism to reduce frequency, relying on events for most updates.
- Added methods to pause and resume polling, enhancing control over job monitoring.
- Improved job handling logic to update existing jobs or add new ones based on event data.
2025-10-04 18:57:05 -07:00
Jamie Pine
32bcf8dc26 feat: Implement photo performance optimization and introduce new photo management features
- Added a comprehensive document detailing performance optimizations for the photo grid, addressing issues with loading and caching.
- Introduced `PhotoThumbnailCache` for efficient thumbnail management, leveraging `PHCachingImageManager` and `NSCache`.
- Updated `PhotoManager2` to utilize a singleton pattern for shared access and improved photo loading strategies.
- Enhanced `PhotosViewModel` and `PhotosView` to support pagination and optimized thumbnail loading for smoother user experience.
- Created new views and components for managing photo backups and displaying photo details, including a job monitor for background tasks.
- Refactored existing code to improve structure and maintainability, ensuring better performance with large photo libraries.
2025-10-04 15:24:49 -07:00
Jamie Pine
255c89806e feat: Add entitlements for local network access and update Info.plist for mDNS support 2025-10-02 17:24:52 -07:00
Jamie Pine
1e8447dfb0 feat: Add Device Pairing Navigation and Enhance Core Management 2025-09-29 14:36:20 -07:00
Jamie Pine
4f5954cab9 refactor: Simplify JSON-RPC Handling and Enhance Daemon Integration 2025-09-29 14:36:17 -07:00
Jamie Pine
54d36ab3f7 refactor: Update Embedded Core Management and Library Handling 2025-09-29 14:36:03 -07:00
Jamie Pine
f7d383f4f6 feat: Enhance Error Handling and Logging in Directory Listing
- Added error logging to the console in `BrowserModels.swift` for better debugging of directory listing failures.
- Refactored `addressing.rs` to remove unnecessary print statements and improve clarity in the deserialization process.
- Implemented a new conversion method in `entry.rs` to handle database model to domain entry transformations, ensuring proper path construction and UUID generation.
- Updated `directory_listing.rs` to streamline file data retrieval and enhance error handling during directory queries.
- Refactored `SpacedriveAPI.swift` to improve API structure and method naming for better clarity in file and library operations.
2025-09-27 00:48:43 -07:00
Jamie Pine
6576d06f53 feat: Add Directory Listing Functionality to File Management
- Introduced `FileListArgs` struct to handle directory listing arguments, including path, limit, hidden files inclusion, and sort order.
- Enhanced `FileCmd` enum to support a new `List` command for listing directory contents.
- Implemented `list_directory` function to query and display directory contents, integrating sorting and filtering options.
- Updated `run` function to handle the new directory listing command, providing a user-friendly output format with a table display.
- Improved error handling for invalid sort options during directory listing.
2025-09-26 22:08:04 -07:00
Jamie Pine
79728fdb10 feat: Enhance Library Management and UI Components
- Introduced a new `LibraryCard` and `EmptyLibraryCard` components for improved library selection UI in the macOS app.
- Updated `LibrarySelector` to display current library information and allow users to switch libraries through a new button.
- Enhanced `MenuBarManager` to dynamically update the libraries menu based on available libraries and current selection.
- Refactored `DaemonConnector` to handle library-related events and refresh library statistics accordingly.
- Improved `LibraryInfo` structure to include optional statistics, enhancing data representation for libraries.
- Updated various UI components to utilize new library statistics, providing users with better insights into their libraries.
2025-09-25 05:29:09 -07:00
Jamie Pine
5be8b54c0b feat: Enhance CLI and macOS App with New Features and Improvements
- Introduced a `format_bytes` function in the CLI to improve byte size formatting for better readability in output.
- Updated the `run_client_command` function to display library sizes using the new formatting function, enhancing user experience.
- Added a new test target in `Package.swift` for improved testing capabilities of the Spacedrive macOS app.
- Refactored various SwiftUI components to improve code clarity and maintainability, including adjustments to view modifiers and layout.
- Enhanced the `ConnectivityCard` and `JobRowView` components with better state management and UI improvements for a more cohesive user experience.
- Improved logging and error handling in the `DaemonConnector` and `InspectorViewModel` for better traceability and debugging.
2025-09-24 17:50:37 -07:00
Jamie Pine
d3210baf85 refactor: Consolidate API Structures and Improve JSON Handling
- Renamed and reorganized API structures for better clarity, merging related functionalities into cohesive groups (e.g., `CoreAPI`, `VolumesAPI`, `TagsAPI`, `MediaAPI`, `FilesAPI`, `JobsAPI`).
- Updated method signatures to align with new action and query formats, ensuring consistency across the API.
- Enhanced JSON handling by implementing a custom `JSONValue` type for improved serialization and deserialization.
- Refactored job-related methods to utilize the updated action context, enhancing the overall job management experience.
2025-09-24 15:02:44 -07:00
Jamie Pine
84c58125d6 refactor: Update JSON Handling and Job Action Context in Swift Code
- Replaced `JsonValue` with `JSONValue` across multiple files for improved JSON handling consistency.
- Enhanced `JobInfo` structure to support optional `actionInput` and `context` properties, allowing for more flexible job action context management.
- Updated job action handling in `JobModels.swift` to utilize new computed properties for better clarity in action descriptions.
- Refactored `SpacedriveAPI` to align with the new JSON structure, ensuring all API methods correctly handle the updated types.
- Improved Codable conformance for `JSONValue`, facilitating seamless JSON serialization and deserialization.
2025-09-24 14:46:49 -07:00
Jamie Pine
5c1ccc9abd feat: Introduce ConnectivityCard Component and Enhance Job Information Structure
- Added a new `ConnectivityCard` SwiftUI component to display daemon connectivity and service status, improving user interface for monitoring services.
- Enhanced `JobInfo` structure to include action context fields, allowing for richer job information and better tracking of job actions.
- Updated `JobRowView` to utilize the new `displayName` property for jobs, providing clearer context in the job list.
- Refactored `JobManager` to support action context during job dispatching, improving job management capabilities.
- Introduced new computed properties in `JobInfo` for better job name and context information display, enhancing user experience in job monitoring.
2025-09-24 14:46:36 -07:00
Jamie Pine
4971ccfdcf feat: Enhance DaemonConnector and InspectorViewModel with Logging and Error Handling
- Integrated OS logging into DaemonConnector and InspectorViewModel for improved traceability of operations.
- Added detailed logging for query execution and file loading processes, enhancing debugging capabilities.
- Introduced custom error handling in InspectorViewModel to manage file loading errors more effectively.
- Updated query methods to log success and failure cases, providing better insights into application behavior.
2025-09-24 04:50:48 -07:00
Jamie Pine
ccda02d95e feat: Add File Information Retrieval and Device ID Initialization
- Implemented functionality to retrieve file information using a new `FileInfoArgs` struct and `FileCmd::Info` command in the CLI.
- Enhanced the `run_client_command` function to initialize the device ID from a `device.json` file if it exists, improving device management.
- Updated the `FileCmd` enum to include the new `Info` command for better command handling in the file domain.
2025-09-24 04:29:33 -07:00
Jamie Pine
35b2fe0054 refactor: Streamline Library ID Management and Enhance Logging
- Removed unnecessary DispatchQueue.main.async calls in DaemonConnector for setting the current library ID, simplifying the code.
- Added debug logging in RpcServer to track method execution and incoming requests, improving traceability.
- Updated SpacedriveClient to log outgoing query requests, enhancing visibility into API interactions.
- Deleted the obsolete generate_client.sh script, cleaning up the Swift client package.
2025-09-23 23:08:58 -07:00
Jamie Pine
74b7beb9c2 refactor: Simplify Library Management in DaemonConnector and Swift Client
- Removed the setupLibraryManagement method and integrated its functionality directly into the loadLibraries method for better clarity.
- Enhanced library loading to automatically select the first library if none is currently selected, improving user experience.
- Updated the SpacedriveClient to streamline the switchToLibrary method, ensuring it uses the async method for library switching.
- Refactored DaemonRequest cases to align with the new action and query method signatures, enhancing consistency across the API.
2025-09-23 22:40:45 -07:00
Jamie Pine
c1fff9b27b feat: Implement CLI Configuration Management for Library ID
- Introduced a new `CliConfig` struct for managing CLI-specific configurations, including the current library ID.
- Added methods to load, save, set, and clear the current library ID within the CLI context.
- Updated the `Context` struct to integrate `CliConfig`, ensuring library ID management is consistent across the application.
- Enhanced command implementations to utilize the new CLI configuration features, improving user experience and functionality.
2025-09-23 22:17:10 -07:00
Jamie Pine
579d732ece feat: Enhance Swift API Code Generation with Type Name Extraction
- Updated the Swift API code generation to utilize specific input and output type names for actions and queries, improving accuracy in generated code.
- Refactored the `OperationTypeInfo` and `QueryTypeInfo` traits to include `input_type_name` and `output_type_name`, enhancing type clarity.
- Added debug logging for type name extraction to facilitate easier troubleshooting and verification of type mappings.
- Modified the Swift client structure to reflect changes in action and query method signatures, ensuring consistency across the API.
2025-09-23 21:53:47 -07:00
Jamie Pine
8faa71bbf5 feat: Implement Library Selector Component for macOS
- Added a new `LibrarySelector` SwiftUI component to display and manage the current library selection.
- Integrated the component with the `SharedAppState` to reflect the current library and available libraries.
- Enhanced the `DaemonConnector` to load and manage libraries, including switching and refreshing libraries.
- Updated the `JobMonitorView` to include the `LibrarySelector`, improving the user interface for library management.
2025-09-23 21:53:41 -07:00
Jamie Pine
d78bd7b5ea feat: Add Library Management Example and enhance SpacedriveClient with library operations
- Introduced a new example file `LibraryManagementExample.swift` demonstrating library management features such as switching, creating, and clearing libraries.
- Enhanced `SpacedriveClient` with methods for managing the current library, including `getCurrentLibraryId`, `setCurrentLibrary`, `clearCurrentLibrary`, and improved error handling for library operations.
- Added functionality to switch libraries by ID and name, retrieve current library info, and get jobs associated with the current library, improving usability and functionality of the client.
2025-09-23 20:15:55 -07:00
Jamie Pine
6803328657 feat: Automate Swift API code generation and enhance type extraction
- Introduced a new function to automatically generate Swift API code based on extracted types, improving the integration between Rust and Swift.
- Enhanced the build process to check for the existence of necessary directories and handle errors gracefully during API code generation.
- Updated the Swift client structure to include newly generated API methods, ensuring comprehensive coverage of available operations.
- Refactored type extraction logic to support the new API generation, improving clarity and organization in the generated Swift code.
2025-09-23 20:10:38 -07:00
Jamie Pine
ed2a5814fa feat: Enhance Swift type generation with Codable conformance
- Refactored the Swift type generation process to include Codable conformance for SpacedriveApi, CoreAction, LibraryAction, CoreQuery, and LibraryQuery, improving serialization and deserialization capabilities.
- Removed unused parameters from the `generate_swift_api_code` function to streamline the code.
- Deleted the obsolete `test_api_structure.rs` file, cleaning up the project structure.
- Updated generated Swift code to ensure consistency and clarity in type definitions.
2025-09-23 19:49:20 -07:00
Jamie Pine
7d1e1adc0f feat: Enhance Swift type generation and API structure
- Introduced a new function `create_spacedrive_api_structure` to generate a comprehensive API structure for better type extraction.
- Refactored the Swift type generation process to utilize the new API structure, improving the clarity and organization of generated code.
- Added detailed logging for API structure summary, enhancing visibility into the generated types and their organization.
- Created a new file `test_api_structure.rs` for testing the API structure generation, ensuring robustness and correctness in type extraction.
2025-09-23 19:10:50 -07:00
Jamie Pine
d267a7a297 feat: Enhance Swift type generation with rspc-inspired extraction system
- Updated the Swift type generation process to utilize a new rspc-inspired type extraction system, allowing for automatic discovery of operations and queries.
- Improved the output format to include detailed information about discovered operations and queries, enhancing usability and verification.
- Refactored the main function to streamline type registration and generation, ensuring comprehensive coverage of the Spacedrive API.
- Updated generated Swift code header to reflect the new extraction methodology, maintaining clarity for future developers.
2025-09-23 18:26:54 -07:00
Jamie Pine
9793466153 refactor: Remove Codable conformance from enums in Swift client
- Updated several enums in the Swift client to remove Codable conformance, simplifying their structure and improving type safety.
- This change aligns with recent updates in the event handling and type definitions, ensuring consistency across the codebase.
2025-09-22 15:04:01 -07:00
Jamie Pine
45c39b02a2 refactor: Simplify logging in DaemonConnector and enhance type safety
- Removed manual logging to a debug file in favor of direct console output for job list fetching and library retrieval, improving clarity during debugging.
- Updated the Swift type definitions for various enums to conform to Codable, enhancing serialization capabilities and type safety across the codebase.
- Streamlined the generated Swift types by removing unnecessary imports and ensuring consistency with the latest Rust core changes.
2025-09-22 14:11:30 -07:00
Jamie Pine
22339d82ee refactor: Update Swift type generation and remove obsolete test files
- Modified the Swift type generation script to include a new RustDuration struct for decoding Rust Duration format, enhancing type safety.
- Updated the generated Swift types to reflect changes in duration handling and improved documentation.
- Removed obsolete test files related to enum variants and event decoding, streamlining the codebase and focusing on relevant functionality.
2025-09-22 01:48:51 -07:00
Jamie Pine
f599f1b86c refactor: Revise event handling and type definitions in Swift client
- Updated the DaemonConnector to utilize a new type-safe Event enum, improving clarity and maintainability.
- Refactored job event handling to use structured data types for job progress and completion, enhancing real-time tracking.
- Removed the obsolete generate_event_samples.rs file to streamline the codebase.
- Enhanced serialization and deserialization processes for various data structures to ensure compatibility with the Rust daemon output.
- Updated Swift type generation to reflect changes in event structure and improve type safety.
2025-09-22 01:16:59 -07:00
Jamie Pine
b4dd9a9454 refactor: Update event handling and type definitions in Swift client
- Removed manual type definitions in favor of generated types from SpacedriveClient, enhancing type safety.
- Refactored event handling in DaemonConnector to utilize a new type-safe Event enum for better clarity and maintainability.
- Updated job management logic to align with the new event structure, improving real-time job tracking and state management.
- Enhanced serialization and deserialization processes for various data structures to ensure compatibility with the Rust daemon output.
- Removed obsolete schema generation binary and updated Cargo.toml to reflect changes in dependencies and project structure.
2025-09-22 00:06:06 -07:00
Jamie Pine
ae19c0cd97 refactor: Update type handling and schema generation for Swift client
- Removed the `codegen` module and its associated files to streamline the codebase.
- Introduced a new binary for generating Swift types using Specta, enhancing type safety and integration.
- Updated various data structures to utilize the `specta` crate for type generation.
- Refactored existing types to remove `JsonSchema` derives in favor of `specta::Type`, improving compatibility with the new generation system.
- Enhanced the `Cargo.toml` to exclude unnecessary crates and improve workspace organization.
2025-09-21 19:13:38 -07:00
Jamie Pine
6dfecac83e feat: Enhance job management and event handling in DaemonConnector
- Introduced new data structures for library and job information to align with the Rust daemon output.
- Implemented real-time job tracking by fetching the current job list and subscribing to job events.
- Enhanced event handling to manage job states (started, progress, completed, failed, paused, resumed) effectively.
- Improved logging for connection status and job events to aid in debugging and user experience.
- Updated JobInfo model to allow mutable properties for better state management during job updates.
2025-09-21 13:39:22 -07:00
Jamie Pine
3a94a773db refactor: Update event handling and Swift client generation
- Enhanced the `Event` enum documentation for clarity on its purpose.
- Modified the Swift client generation script to create event samples for enum generation.
- Updated the Swift client to utilize the new `EventElement` type for event handling.
- Improved error handling and logging in the event subscription process.
- Refactored the types generated for Swift to align with the new event structure.
2025-09-21 11:44:40 -07:00
Jamie Pine
e5bc6bb9b9 refactor: Update schema generation and type handling
- Renamed `common_types` to `core_types` in `UnifiedSchema` for clarity.
- Updated schema extraction methods to reflect the new naming convention.
- Enhanced the `register_schema_type` macro for better type registration in schema generation.
- Added `JsonSchema` derives to various structs to support schema extraction.
- Improved logging in `generate_schemas` to provide accurate output details.
- Updated documentation to reflect changes in schema structure and type handling.
2025-09-21 10:40:22 -07:00
Jamie Pine
487cc53e63 feat: Implement JSON Schema generation for client types
- Added `schemars` dependency to facilitate JSON Schema generation.
- Introduced a new `generate_schemas` binary for extracting and writing unified JSON schemas.
- Enhanced existing modules to support schema generation, including updates to `build.rs` for change detection.
- Updated various data structures with `JsonSchema` derives to enable schema extraction.
- Created comprehensive documentation for the client generation system design, detailing architecture and usage.
- Added TypeScript and Swift client generation scripts, ensuring type-safe access to the Spacedrive daemon API.
2025-09-21 10:40:13 -07:00