feat(sidebar): reorder folder groups by drag and persist sort order

This commit is contained in:
xintaofei
2026-04-23 00:42:58 +08:00
parent 2dbdaa9c74
commit f1ce7179ea
25 changed files with 519 additions and 182 deletions

View File

@@ -589,6 +589,17 @@ pub async fn remove_folder_from_workspace(
.map_err(AppCommandError::from)
}
#[cfg(feature = "tauri-runtime")]
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
pub async fn reorder_folders(
db: tauri::State<'_, AppDatabase>,
ids: Vec<i32>,
) -> Result<(), AppCommandError> {
folder_service::reorder_folders(&db.conn, ids)
.await
.map_err(AppCommandError::from)
}
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
pub async fn create_folder_directory(path: String) -> Result<(), AppCommandError> {
std::fs::create_dir_all(&path).map_err(AppCommandError::io)