fix(aliases): modal raw-key bug + alias visibility/management #101

Merged
bvandeusen merged 1 commits from dev into main 2026-06-12 14:02:01 -04:00
Owner

Aliases created from the modal never resolved: create sent the normalized display name while resolution keys on the raw booru model key — so the mapping was stored under a key nothing looks up, and the prediction kept reappearing unaliased. The raw key wasn't even in the /suggestions response, so the modal couldn't send it.

  • Suggestion carries raw_name (the model key an alias must use) + via_alias; both serialized.
  • Modal alias-create sends raw_name (the fix). Aliased suggestions show an "alias" badge + "Remove alias"; "Treat as alias for…" hidden for centroid hits / already-aliased rows.
  • Tag-side management: TagCard ⋮ → "Aliases…" lists the model keys that fold into a tag, with remove (GET /api/tags/<id>/aliases). Creation stays in the modal suggestion flow.

Tests: full API round-trip locking the raw-key contract; list_for_tag (service + API); via_alias/raw_name on existing service tests. No migration. CI green on dev (run 977).

🤖 Generated with Claude Code

Aliases created from the modal never resolved: create sent the normalized display name while resolution keys on the raw booru model key — so the mapping was stored under a key nothing looks up, and the prediction kept reappearing unaliased. The raw key wasn't even in the /suggestions response, so the modal couldn't send it. - `Suggestion` carries `raw_name` (the model key an alias must use) + `via_alias`; both serialized. - Modal alias-create sends `raw_name` (the fix). Aliased suggestions show an "alias" badge + "Remove alias"; "Treat as alias for…" hidden for centroid hits / already-aliased rows. - Tag-side management: TagCard ⋮ → "Aliases…" lists the model keys that fold into a tag, with remove (`GET /api/tags/<id>/aliases`). Creation stays in the modal suggestion flow. Tests: full API round-trip locking the raw-key contract; `list_for_tag` (service + API); `via_alias`/`raw_name` on existing service tests. No migration. CI green on dev (run 977). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-12 14:01:56 -04:00
fix(aliases): store modal alias under raw model key + make aliases visible/manageable
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 22s
CI / backend-lint-and-test (push) Successful in 35s
CI / integration (push) Successful in 3m7s
5c3f8ebd70
The headline bug: aliases created from the modal NEVER resolved. Create
sent the normalized display name ('Sword', 'Uchiha Sasuke') while
resolution keys on the raw booru model key ('sword', 'uchiha_sasuke',
case-sensitive) — so the mapping was stored under a key nothing looks up,
and the prediction kept reappearing unaliased. The raw key wasn't even in
the /suggestions response, so the modal couldn't send it.

- Suggestion now carries raw_name (the model key an alias must use) and
  via_alias (surfaced via an operator alias); both serialized by the API.
- Modal alias-create sends raw_name, not display_name (the fix). Aliased
  suggestions show an 'alias' badge and a 'Remove alias' action; 'Treat as
  alias for…' is hidden for centroid hits (no model key) and already-aliased
  rows.
- Tag-side management: TagCard ⋮ → 'Aliases…' opens a dialog listing the
  model keys that fold into a tag, with remove (GET /api/tags/<id>/aliases +
  AliasService.list_for_tag). Creation stays in the modal suggestion flow.

Tests: full API round-trip locking the raw-key contract (raw_name exposed →
alias authored with it → resolves + via_alias on a later image);
list_for_tag (service + API); via_alias/raw_name on the existing service
suggestion tests. No migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bvandeusen merged commit 3eb08e926b into main 2026-06-12 14:02:01 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#101