diff --git a/CLAUDE.md b/CLAUDE.md index e49d19e..8c6c247 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,6 +32,7 @@ Two-crate workspace (`resolver = "2"`, edition 2021) plus a Tauri app: - **onyx-core** — Pure Rust library. Storage trait with `FileSystemStorage` implementation, `TaskRepository` (main API), data models, config, error types. No CLI/UI dependencies. `keyring` feature-gated behind `keyring-storage` (default on) for Android compatibility. - **onyx-cli** — CLI frontend using clap. Commands are in `src/commands/` (init, workspace, list, task, group). Output formatting in `src/output.rs`. - **apps/tauri/** — Tauri v2 GUI. Svelte 5 frontend in `src/`, Rust backend in `src-tauri/` with Tauri commands that call into `onyx-core`. `notify` crate feature-gated for Android. + ### Key patterns - **Storage trait** (`storage.rs`): Strategy pattern for task persistence. `FileSystemStorage` reads/writes markdown files with YAML frontmatter and JSON metadata files. diff --git a/PLAN.md b/PLAN.md index cd7b2b4..2648619 100644 --- a/PLAN.md +++ b/PLAN.md @@ -856,17 +856,17 @@ npm run tauri ios build #### Desktop & Mobile - [x] Multiple task lists (folders) - [x] Switch between lists -- [ ] Subtasks support -- [ ] Due dates with date picker +- [x] Subtasks support +- [x] Due dates with date picker - [ ] Rich markdown editor for task notes -- [ ] Move tasks between lists +- [x] Move tasks between lists - [ ] Change storage folder location in settings - [ ] Search functionality - [x] Theme selection (light/dark mode) #### Desktop-Specific - [x] Drag & drop reordering -- [ ] Keyboard shortcuts +- [x] Keyboard shortcuts - [ ] Multiple windows (optional) #### Mobile-Specific diff --git a/docs/API.md b/docs/API.md index f3aa738..30b69ea 100644 --- a/docs/API.md +++ b/docs/API.md @@ -441,10 +441,9 @@ Key test areas: ## Thread Safety -**Note:** The current implementation is not thread-safe. If you need concurrent access: +The `Storage` trait requires `Send + Sync`, and `TaskRepository` wraps `Box`, so repository instances can be shared across threads behind a `Mutex`. The Tauri GUI uses `Mutex` for this purpose. -1. Use external synchronization (e.g., `Mutex`) -2. Create separate repository instances per thread (file system will handle locking) -3. Consider implementing a service layer with proper locking +For concurrent access: -Future versions may include built-in concurrency support. +1. Wrap `TaskRepository` in `Mutex` or `RwLock` (the Tauri app does this) +2. Or create separate repository instances per thread (file system handles locking)