From 0f3da7308da1164050c661734e3102c3f99403a9 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 31 Aug 2026 13:40:40 +0200 Subject: [PATCH] fix: the left arrow no longer skips over what you just tagged --untagged hid an item the moment it gained a tag, including from the back button, so the one photo you most want to return to -- the one you just mis-tagged -- was the one you could not reach. The only way back was to restart without --untagged. Anything drawn this session stays navigable. Forward still skips work done in earlier sessions, which is the point of the flag. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01WBrE1b9HvFw3xvG9bJiDFt --- tool/tagger.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool/tagger.html b/tool/tagger.html index 453bf7e..62bde74 100644 --- a/tool/tagger.html +++ b/tool/tagger.html @@ -189,8 +189,14 @@ function isVideo(name) { // Which items this session presents. The server never filters: /media/{index} // and /api/tag both index the full list, so a shorter list here would show // item i of the album while tagging item i of the filtered set. +// Anything seen this session stays navigable even once it has tags. Without +// this, tagging an item removes it from the set and the left arrow jumps +// straight over your own work -- so a mis-tag is unreachable and the only way +// back is to restart without --untagged. +const visited = new Set(); + function shown(index) { - return !state.untagged_only || !state.files[index].keys.length; + return !state.untagged_only || !state.files[index].keys.length || visited.has(index); } function step(from, direction) { @@ -201,6 +207,7 @@ function step(from, direction) { } function draw() { + visited.add(at); const item = state.files[at]; document.getElementById("progress").textContent = `${at + 1} / ${state.files.length} — ${item.name}`;