fix: add failed tag locate and filter controls
Add a failed-tag discovery flow for background worker failures. Changes: - Add a Failed Tags toolbar filter that appears when tag failures exist. - Add Locate buttons for failed tag tasks in the background worker prompt. - Route Locate to the affected folder and filter the gallery to images with tagger errors. - Fetch and display failed tag filenames/errors in the expanded worker details. - Add a backend query and gallery filter flag for images with failed AI tagging. - Improve subtle-light contrast for failed worker chips, filenames, and Locate/Retry buttons. - Also slightly increases the title bar update indicator pulse size for better visibility.
This commit is contained in:
@@ -38,6 +38,7 @@ pub struct GetImagesParams {
|
||||
pub favorites_only: Option<bool>,
|
||||
pub rating_min: Option<i64>,
|
||||
pub embedding_failed_only: Option<bool>,
|
||||
pub tagging_failed_only: Option<bool>,
|
||||
pub sort: Option<String>,
|
||||
pub offset: Option<i64>,
|
||||
pub limit: Option<i64>,
|
||||
@@ -329,6 +330,7 @@ pub async fn get_images(
|
||||
let favorites_only = params.favorites_only.unwrap_or(false);
|
||||
let rating_min = params.rating_min.unwrap_or(0);
|
||||
let embedding_failed_only = params.embedding_failed_only.unwrap_or(false);
|
||||
let tagging_failed_only = params.tagging_failed_only.unwrap_or(false);
|
||||
|
||||
let total = db::count_images(
|
||||
&conn,
|
||||
@@ -338,6 +340,7 @@ pub async fn get_images(
|
||||
favorites_only,
|
||||
rating_min,
|
||||
embedding_failed_only,
|
||||
tagging_failed_only,
|
||||
)
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
@@ -349,6 +352,7 @@ pub async fn get_images(
|
||||
favorites_only,
|
||||
rating_min,
|
||||
embedding_failed_only,
|
||||
tagging_failed_only,
|
||||
sort,
|
||||
offset,
|
||||
limit,
|
||||
@@ -594,6 +598,34 @@ pub async fn retry_failed_embeddings(
|
||||
db::retry_failed_embedding_jobs(&conn, params.folder_id).map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct FailedImageItem {
|
||||
pub image_id: i64,
|
||||
pub filename: String,
|
||||
pub path: String,
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_failed_tagging_images(
|
||||
db: State<'_, DbState>,
|
||||
folder_id: i64,
|
||||
) -> Result<Vec<FailedImageItem>, String> {
|
||||
let conn = db.get().map_err(|e| e.to_string())?;
|
||||
db::get_failed_tagging_images(&conn, folder_id)
|
||||
.map(|rows| {
|
||||
rows.into_iter()
|
||||
.map(|(image_id, filename, path, error)| FailedImageItem {
|
||||
image_id,
|
||||
filename,
|
||||
path,
|
||||
error,
|
||||
})
|
||||
.collect()
|
||||
})
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn semantic_search_images(
|
||||
db: State<'_, DbState>,
|
||||
|
||||
Reference in New Issue
Block a user