feat(folders): add rename, missing-folder recovery, and right-click context menu

- Backend: new `rename_folder` command (updates display name only, not path)
  and `update_folder_path` command (rewrites image paths in DB before reindexing
  so thumbnails/embeddings are not regenerated unnecessarily)
- DB: `rename_folder` and `update_folder_path` helpers; `scan_error` column on
  folders table to surface indexing failures without silently dropping images
- Store: `renameFolder` and `updateFolderPath` actions
- Sidebar: right-click context menu on each folder row (Reindex, Rename, Locate
  Folder, Remove from app); inline rename input on Enter/Escape/blur; missing-
  folder recovery banner with Locate/Remove; hover icon buttons (reindex + remove
  with Confirm/Cancel) preserved alongside the context menu
This commit is contained in:
2026-06-07 09:16:56 +01:00
parent 7871d52d39
commit 4e5923ba84
5 changed files with 258 additions and 125 deletions
+14
View File
@@ -325,6 +325,20 @@ pub async fn reindex_folder(
Ok(())
}
#[tauri::command]
pub async fn rename_folder(
db: State<'_, DbState>,
folder_id: i64,
new_name: String,
) -> Result<(), String> {
let new_name = new_name.trim().to_string();
if new_name.is_empty() {
return Err("Folder name cannot be empty".to_string());
}
let conn = db.get().map_err(|e| e.to_string())?;
db::rename_folder(&conn, folder_id, &new_name).map_err(|e| e.to_string())
}
#[tauri::command]
pub async fn update_folder_path(
app: AppHandle,