|
1 | 1 | --- |
2 | 2 | id: task-211.02 |
3 | 3 | title: Create library-plugin for library management commands |
4 | | -status: In Progress |
| 4 | +status: Done |
5 | 5 | assignee: [] |
6 | 6 | created_date: '2026-01-27 04:22' |
7 | | -updated_date: '2026-01-27 08:03' |
| 7 | +updated_date: '2026-01-27 08:26' |
8 | 8 | labels: |
9 | 9 | - performance |
10 | 10 | - rust |
@@ -40,10 +40,10 @@ Extract library management commands into a dedicated Tauri plugin. |
40 | 40 |
|
41 | 41 | ## Acceptance Criteria |
42 | 42 | <!-- AC:BEGIN --> |
43 | | -- [ ] #1 Plugin compiles independently |
44 | | -- [ ] #2 All library commands work via plugin |
45 | | -- [ ] #3 No regression in library browsing/management |
46 | | -- [ ] #4 Plugin registered in lib.rs with .plugin() |
| 43 | +- [x] #1 Plugin compiles independently |
| 44 | +- [x] #2 All library commands work via plugin |
| 45 | +- [x] #3 No regression in library browsing/management |
| 46 | +- [x] #4 Plugin registered in lib.rs with .plugin() |
47 | 47 | <!-- AC:END --> |
48 | 48 |
|
49 | 49 | ## Implementation Notes |
@@ -126,4 +126,33 @@ Create a new parent task for "Extract shared types into mt-core crate" as a prer |
126 | 126 |
|
127 | 127 | Delete the broken skeleton: |
128 | 128 | - `src-tauri/plugins/tauri-plugin-library/Cargo.toml` |
| 129 | + |
| 130 | +## Completed (2026-01-27) |
| 131 | + |
| 132 | +Successfully extracted library commands into tauri-plugin-library. |
| 133 | + |
| 134 | +### Files Created |
| 135 | +- `src-tauri/plugins/tauri-plugin-library/Cargo.toml` |
| 136 | +- `src-tauri/plugins/tauri-plugin-library/build.rs` |
| 137 | +- `src-tauri/plugins/tauri-plugin-library/src/lib.rs` |
| 138 | +- `src-tauri/plugins/tauri-plugin-library/src/commands.rs` (14 commands) |
| 139 | +- `src-tauri/plugins/tauri-plugin-library/src/models.rs` |
| 140 | +- `src-tauri/plugins/tauri-plugin-library/src/scanner.rs` |
| 141 | + |
| 142 | +### Files Modified |
| 143 | +- `src-tauri/Cargo.toml` - Added plugin to workspace and dependencies |
| 144 | +- `src-tauri/src/lib.rs` - Registered plugin, removed library command handlers |
| 145 | + |
| 146 | +### Key Technical Decisions |
| 147 | +1. Plugin uses `mt-core` for shared types (Database, ArtworkCache, models) |
| 148 | +2. Commands use generic `<R: Runtime>` for functions needing `AppHandle<R>` |
| 149 | +3. Events emitted via `tauri::Emitter` trait directly |
| 150 | +4. All 14 library commands ported with identical signatures |
| 151 | + |
| 152 | +### Verification |
| 153 | +- `cargo check` - Compiles cleanly |
| 154 | +- `cargo test` - All 275 tests pass |
| 155 | + |
| 156 | +### Previous Implementation Notes |
| 157 | +The earlier notes about circular dependencies were resolved by task 211.11 which created the `mt-core` shared crate. |
129 | 158 | <!-- SECTION:NOTES:END --> |
0 commit comments