feat: expand media discovery and AI workflows #8

Merged
LyAhn merged 25 commits from codex/5-discovery-features into main 2026-06-07 22:43:16 +00:00
Showing only changes of commit f93a80bc87 - Show all commits
+19 -12
View File
@@ -102,7 +102,12 @@ export function Lightbox() {
void getImageTags(selectedImage.id) void getImageTags(selectedImage.id)
.then(setImageTags) .then(setImageTags)
.catch(() => setImageTags([])); .catch(() => setImageTags([]));
}, [selectedImage?.id, getImageTags]); }, [selectedImage?.id, selectedImage?.ai_tagged_at, getImageTags]);
// Reset the queued state once the worker finishes so the button is usable again
useEffect(() => {
if (selectedImage?.ai_tagged_at) setTaggingQueued(false);
}, [selectedImage?.ai_tagged_at]);
useEffect(() => { useEffect(() => {
const viewport = imageViewportRef.current; const viewport = imageViewportRef.current;
@@ -359,17 +364,19 @@ export function Lightbox() {
{ratingPill(selectedImage.ai_rating).label} {ratingPill(selectedImage.ai_rating).label}
</span> </span>
) : null} ) : null}
<button {selectedImage.media_kind === "image" ? (
className="rounded-md border border-white/10 bg-white/5 px-2 py-0.5 text-[10px] text-gray-400 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-40" <button
disabled={!(taggerModelStatus?.ready ?? false) || taggingQueued} className="rounded-md border border-white/10 bg-white/5 px-2 py-0.5 text-[10px] text-gray-400 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-40"
title={!(taggerModelStatus?.ready ?? false) ? "WD Tagger model not downloaded" : "Queue AI tagging for this image"} disabled={!(taggerModelStatus?.ready ?? false) || taggingQueued}
onClick={() => { title={!(taggerModelStatus?.ready ?? false) ? "WD Tagger model not downloaded" : "Queue AI tagging for this image"}
setTaggingQueued(true); onClick={() => {
void queueTaggingForImage(selectedImage.id).catch(() => undefined); setTaggingQueued(true);
}} void queueTaggingForImage(selectedImage.id).catch(() => undefined);
> }}
{taggingQueued ? "Queued" : "AI tags"} >
</button> {taggingQueued ? "Queued" : "AI tags"}
</button>
) : null}
</div> </div>
</div> </div>