Autocomplete existing tags in the upload and manage forms

A small shared widget (static/tagcomplete.js) completes the tag after the last
comma from the existing tag list, keeping earlier tags intact. It is wired to
every comma-separated tag input: the upload form, and the manage page's per-row
edit field and bulk add/remove fields.

Suggestions come from /tags.json, which the generator already writes on every
build and nginx serves statically, so no server change is needed; the list is
fetched once, cached, and invalidated after an edit that may add a tag. Keyboard
navigation (up/down, enter/tab, escape) and click selection are supported.
This commit is contained in:
puttaalu committed 2026-10-18 22:39:13 +02:00
1 parent bf75c9fe8e
commit c4aa345914
4 files changed
+183 -3

No files matched your search

+23
View File
@@ -476,3 +476,26 @@ body {
font-family: var(--serif);
margin-top: 16px;
}
/* Tag autocomplete dropdown (tagcomplete.js), shared by upload and manage. */
.tagac-menu {
position: absolute;
z-index: 50;
background: var(--bg1);
border: 1px solid var(--bg2);
max-height: 220px;
overflow-y: auto;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.tagac-item {
padding: 7px 11px;
font-family: var(--serif);
font-size: 14px;
color: var(--fg2);
cursor: pointer;
}
.tagac-item.sel,
.tagac-item:hover {
background: var(--bg2);
color: var(--fg);
}