[GrandComicsDatabase/gcd-django] Keyword Manager: New Interface for Browsing and Duplicate Analysis (PR #768)

5 views
Skip to first unread message

Simone Nardi

unread,
Sep 23, 2026, 11:30:54 AM (7 days ago) Sep 23
to GrandComicsDatabase/gcd-django, Subscribed

Overview

Introduces a dedicated interface for exploring existing keywords, reviewing their usage, and identifying potential duplicates: a first step toward more structured vocabulary management, while keeping Django, MySQL, and django-taggit.

Features

  • Complete keyword browsing, including unused keywords.
  • Search by name, usage filters, alphabetical sorting or sorting by number of associations, and pagination.
  • Stable ID-based detail view, with counts by object type and links to catalog items.
  • Filters, sorting, and pagination state are preserved while navigating.
  • Potential duplicate detection, comparing case differences, leading/trailing whitespace, and Unicode-equivalent forms. Each group displays the original names, IDs, and usage counts, with no automatic merging.
  • Responsive UI shared across the list, detail, and duplicate views, with consistent buttons and readable tables.
  • Access restricted to authenticated users, with all operations limited to read-only browsing.

Validation and Scope

  • 16 tests passing, executed using a dummy database backend.
  • Queries were verified during development within a read-only MySQL transaction, which was rolled back afterward.
  • No migrations, schema changes, or data writes.
  • Changes are limited to the eight files belonging to the Keyword Manager.

Future Improvements and Analysis to Discuss

  • Name canonicalization and controlled merge management.

  • Macro-categories, parent/child hierarchies, and cycle prevention.

  • Aliases and translations, with optional language identification.

  • Integration of the canonical vocabulary with search, autocomplete, and review workflows.

  • Evaluation of standards for controlled vocabularies and knowledge organization, in particular:

    • SKOS — Simple Knowledge Organization System: concepts, preferred and alternative labels, hierarchical and associative relationships.
    • ISO 25964: thesaurus construction and management, and interoperability with other vocabularies.
    • ISO 639 and BCP 47: representation of languages and language variants for labels.
  • Evaluation of potential links to external vocabularies and persistent identifiers.

These areas are proposals for discussion, not standards that have already been adopted or features included in this PR. The goal remains to develop a solution that is proportionate to the catalog’s needs and compatible with the existing stack.


You can view, comment on, or merge this pull request online at:

  https://github.com/GrandComicsDatabase/gcd-django/pull/768

Commit Summary

  • 82e696a Fix full-catalog homepage and series search performance
  • 5d7e153 Update apps/gcd/views/search.py
  • 1010273 Fix Italian catalog terminology and add gettext to development image
  • ef36af6 Merge catalog performance fixes into local Italian development branch
  • ee8702a feat(select): add bulk copy and reorderable cover and story cache
  • f76a20f fix(select): accept cover checkboxes when removing cached covers
  • 8a0d4dc fix: address bulk copy identity and search review findings
  • d981f3a fix(oi): use cache for bulk copy tokens without schema changes
  • ae07c45 feat(keywords): add read-only keyword manager and duplicate review

File Changes

(26 files)

Patch Links:

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768@github.com>

gemini-code-assist[bot]

unread,
Sep 23, 2026, 11:35:20 AM (7 days ago) Sep 23
to GrandComicsDatabase/gcd-django, Subscribed

@gemini-code-assist[bot] commented on this pull request.

Code Review

This pull request introduces a read-only keyword management interface with duplicate detection, and significantly enhances the indexing data cache to support bulk copying, bulk removal, and drag-and-drop reordering of remembered stories and covers. It also optimizes series search queries to prevent dependent subqueries in MySQL, improves publication date rendering to tolerate missing issue pointers, and updates localization files. The reviewer suggests extracting the similar parsing and validation logic for cached object choices in copy_cached_sequences into a reusable helper function to reduce code duplication and improve maintainability.


In apps/oi/views.py:

> +        for choice in choices:
+            try:
+                choice_kind, object_id = choice.split('_')
+                object_id = int(object_id)
+            except ValueError:
+                return HttpResponseBadRequest('Invalid cached object.')
+            if choice_kind != kind or object_id <= 0:
+                return HttpResponseBadRequest('Invalid selection category.')
+            selected.add(object_id)
+        cached_ids = get_ordered_cached_ids(request, 'cached_%s' % (
+            'stories' if kind == 'story' else 'covers'))
+        if not selected.issubset(set(cached_ids)):
+            return HttpResponseBadRequest('A selected object is no longer cached.')
+        story_ids = [pk for pk in cached_ids if pk in selected] if kind == 'story' else []
+        covers = set(selected) if kind == 'cover' else set()
+        for choice in cover_choices:
+            if not choice:
+                continue
+            try:
+                category, pk = choice.split('_')
+                pk = int(pk)
+            except ValueError:
+                return HttpResponseBadRequest('Invalid cover selection.')
+            if category != 'cover' or pk <= 0:
+                return HttpResponseBadRequest('Invalid cover selection.')
+            covers.add(pk)

medium

The logic for parsing and validating the choices and cover_choices from the POST data is quite similar. To improve maintainability and reduce code duplication, you could extract this parsing and validation logic into a helper function. This function could accept a list of choice strings and an expected object 'kind', then return a validated set of integer IDs, raising an exception for any invalid input. This would make the view cleaner and the validation logic more reusable.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/review/5293140757@github.com>

Simone Nardi

unread,
Sep 23, 2026, 11:40:40 AM (7 days ago) Sep 23
to GrandComicsDatabase/gcd-django, Push

@ProfNardi pushed 1 commit.

  • fb23640 refactor(oi): share cached selection parsing and validation

—
View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/before/ae07c4545d5250ba73ff6ee9637c497b847dbf08/after/fb2364037d895b5fb03155158a393592508eda26@github.com>

Simone Nardi

unread,
Sep 24, 2026, 3:44:06 AM (7 days ago) Sep 24
to GrandComicsDatabase/gcd-django, Subscribed
ProfNardi left a comment (GrandComicsDatabase/gcd-django#768)

Just a quick note: the database import script

./bin/dev setup --dump ~/Downloads/current.zip

doesn't import the taggit_tag and taggit_taggeditem tables, which remain empty.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/c5809963255@github.com>

Simone Nardi

unread,
Sep 24, 2026, 3:57:38 PM (6 days ago) Sep 24
to GrandComicsDatabase/gcd-django, Push

@ProfNardi pushed 1 commit.

  • 7dbfe86 Merge beta into PR 768 and resolve imports and Italian metadata

—
View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/before/fb2364037d895b5fb03155158a393592508eda26/after/7dbfe862405d86afcbb174659a8cfcc29af30b31@github.com>

Simone Nardi

unread,
Sep 24, 2026, 4:12:33 PM (6 days ago) Sep 24
to GrandComicsDatabase/gcd-django, Push

@ProfNardi pushed 1 commit.

  • 588e2d9 Add read-only keyword manager and duplicate review

—
View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/before/7dbfe862405d86afcbb174659a8cfcc29af30b31/after/588e2d97c35b6782cab5e7b31e922100aadf9567@github.com>

Simone Nardi

unread,
Sep 25, 2026, 1:31:21 PM (5 days ago) Sep 25
to GrandComicsDatabase/gcd-django, Push

@ProfNardi pushed 1 commit.

  • c0485bd Use existing Tailwind styles for keyword management

—
View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/before/588e2d97c35b6782cab5e7b31e922100aadf9567/after/c0485bd0274efe8c7196487f8d411543a1c3df31@github.com>

Simone Nardi

unread,
Sep 26, 2026, 11:42:42 PM (4 days ago) Sep 26
to GrandComicsDatabase/gcd-django, Push

@ProfNardi pushed 1 commit.

  • da5ea68 Add live keyword search and inline details with HTMX

—
View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/768/before/c0485bd0274efe8c7196487f8d411543a1c3df31/after/da5ea68ceb4445de309fc56704236ea17413fd60@github.com>

Reply all
Reply to author
Forward
0 new messages