Repository navigation
Tag editor: suggest existing names as you type - #1008
Merged
Merged
Conversation
The tag editor's publisher, imprint, series, volume, credit, story arc, universe and tag inputs only offered the opened group's own values, so correcting a name meant retyping the library's spelling exactly; a typo silently created a new row. New admin endpoint GET /api/v4/admin/tag-names/<field>?q= returns at most 100 existing names containing q, prefix matches first, with a `complete` flag. Imprint, series and volume narrow to the form's parent names. A TagNameCombobox wrapper fetches only when its menu opens or the user types with it open (debounced, aborting the stale request). Results cache per field, scope and query in the metadata store until the dialog closes, and a complete result for a shorter prefix answers longer queries without another request. Free text is still accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UgiA5Rda3grk8WEu1YhY4S
ajslater
marked this pull request as ready for review
November 7, 2026 02:05
ajslater
pushed a commit
that referenced
this pull request
Nov 7, 2026
Its feature commit landed in develop as b2e0c02; this keeps the tree unchanged so the branch can be pushed without rewriting history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UgiA5Rda3grk8WEu1YhY4S
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The admin tag editor's Publisher, Imprint, Series and Volume inputs only offered the opened group's own values. The tag rows, Credits, Story Arcs and Universe inputs offered nothing. The importer matches names exactly, so a typo while correcting a name quietly creates a new row. Every named-tag input now suggests existing library names as you type, and nothing loads when the editor opens.
Backend
GET /api/v4/admin/tag-names/<field>?q=…(codex/views/admin/tagnames.py), admin only.q(case-insensitive), prefix matches first, plus acompleteflag. It fetchesLIMIT+1rows, so it needs no COUNT.creditsmaps toCreditPersonandstory_arcstoStoryArc, using the UI constants incodex/views/settings.py. Anything else returns 404.AdminTagNamesInputSerializer/AdminTagNamesSerializerincodex/serializers/admin/tagging.py. Query params are capped atMAX_NAME_LEN.Frontend
getTagNamesinsrc/api/v4/admin.js.complete, it answers longer queries without a request, and Vuetify's filter narrows it.clearMetadata().TagNameComboboxwrapper. Attributes,v-model, listeners and slots pass through to the inner combobox.update:searchon model assignment, on a pick and after each chip add.hide-no-datato false so an empty list can still open the menu, and shows a no-data text.filtered-order="prefix".edit-panel.vueuses it for publisher, imprint, series, volume, per-role credits, the enabled tag rows, story arcs and universe name. The group's own values come first in each list.Test plan
tests/test_admin_tag_names.py(16 tests): non-staff 403, unknown field 404, prefix-first ordering,%/_matched literally, blank imprint excluded, series deduped across imprints, imprint and series scoping, volume scoped by series and sorted as numbers, null volume excluded,completefalse over a patched limit, credits/story arcs models, over-longq400.frontend/tests/unit/metadata-store-tag-names.test.js(9) andtag-name-combobox.test.js(10), including one that types into the real input to check the menu opens beforeupdate:search.edit-panel-*.test.js: 113 pass.bin/lint-python.sh(ruff, basedpyright, vulture, complexipy/radon, codespell); ESLint and Prettier on the changed frontend files.ty check .reports only the tworenamed-rule-in-ignore-commentwarnings already on develop.tag-namesrequests when the editor opens;publisher?q=request;danarrows to "Dark Horse" with no new request;imprint?publisher=DC Comicsand lists only Black Label and Vertigo;bat, and still takes "Zatanna" as a new chip on Enter;Generated by Claude Code