diff --git a/frontend/src/features/upload/UploadPage.tsx b/frontend/src/features/upload/UploadPage.tsx index 6da93fe..aa208e4 100644 --- a/frontend/src/features/upload/UploadPage.tsx +++ b/frontend/src/features/upload/UploadPage.tsx @@ -28,7 +28,13 @@ import { RATING_LABELS, } from "@/lib/e621"; import { formatBytes } from "@/lib/format"; -import type { E621IqdbCandidate, Rating, TempUpload } from "@/lib/types"; +import type { + E621IqdbCandidate, + Rating, + TempUpload, + UploadCompletion, + UploadStagingResult, +} from "@/lib/types"; import { postProcessUploads, uploadStatusQueryKey, @@ -272,6 +278,21 @@ function TempCard({ ) : null} + {temp.status === "error" ? ( +
+ + +
+ ) : null} + ) : null, )} + {column( + "Failed", + failed, + "No failed uploads.", + (temp) => ( + setModalId(temp.temp_id)} + onRetry={() => retry(temp)} + onDismiss={() => dismiss(temp)} + /> + ), + failed.length > 0 ? ( + + ) : null, + )} {modalId ? ( diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts index e19c2e6..ec1bb06 100644 --- a/frontend/src/lib/types.ts +++ b/frontend/src/lib/types.ts @@ -388,6 +388,28 @@ export interface TempUpload { updated_at: string; } +/** One upload the pipeline indexed while the page was watching. */ +export interface UploadCompletion { + id: string; + filename: string; + j_id: string; + resolution: string; + post_id: number | null; + thumbnail_url: string | null; + at: string; +} + +/** Response of POST /api/uploads/ — a pending row or an instant completion. */ +export interface UploadStagingResult { + temp_id: string; + original_filename: string; + status: "pending" | "visual_match" | "completed" | "error"; + resolution: string; + library_j_id: string | null; + preview_url: string | null; + e621_post_id?: number | null; +} + /** Progress of the server-side staged-upload pipeline. */ export interface UploadStatus { status: "idle" | "running" | "paused" | "error"; @@ -400,6 +422,8 @@ export interface UploadStatus { error: string; outstanding: number; waiting: { md5: number; visual: number; iqdb: number }; + /** Session notification feed: indexed uploads, newest first. */ + recent_completions: UploadCompletion[]; updated_at: string | null; }