Skip to content

Wire entity_tags read path and adopt TypedTagBadge UI #347

Description

@joestump

Part of #303 (EPIC: Unified Tag Taxonomy Completion). Governing: ADR-0025, SPEC unified-tag-taxonomy REQs "Denormalized Entity Tags Table" scenario, "UI Tag Visual Differentiation". Depends on: #308 (backfill wiring), #311 (renumber lands first for clean references).

The taxonomy is currently write-only: entity_tags has zero read call sites, and TypedTagBadge has zero call sites — the fast-filter path and the UI the spec mandates are unimplemented (audit CRITICAL ×2).

Requirements

  • Implement the entity_tags read path: tag filtering for artists/albums/tracks queries entity_tags per the spec scenario ("Filter artists by AI tag → system queries entity_tags → returns matching artist IDs")
  • Adopt TypedTagBadge on Artist/Album/Track show pages, replacing the ad-hoc badges with wrong classes (AI tags render badge-secondary; spec MUSTs badge-accent + sparkles; genres badge-neutral vs spec'd badge-primary) (internal/views/artists/show.templ:261-276, albums/show.templ:309, tracks/show.templ:296; component at components/tags.templ:12)
  • Use TypedTagGroup (currently unused) to group tags by type per the SHOULD (artists/show.templ:263-276)
  • Remove the stale TODO(SPEC-0014): Replace with TypedTagBadge after Tag schema PR #255 merges comments (PR Tag Schema & Data Model #255 merged long ago)
  • Spec/code location drift: TypedTagBadge lives in components/tags.templ, spec says ui.templ — amend the spec (coordinate with EPIC: Spec Governance Cleanup #304 reconciliation)

Acceptance Criteria

  • Tag browsing/filtering works against entity_tags for all three entity types
  • Show pages render typed badges with spec-correct classes and grouping

Security Checklist

  • Auth middleware applied to all new/modified endpoints
  • Input validation on all request parameters
  • Output encoding for user-supplied data rendered in templates
  • Rate limiting considered for new endpoints
  • Request body size limits enforced

Branch

feature/347-entity-tags-read-path-typedtagbadge

PR Convention

PR title references the story; body ends with Closes #347, references the parent epic and governing artifacts above.

🤖 Posted on behalf of @joestump by Claude.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendGo backend codebugSomething isn't workingfrontendFrontend / UI issuesqueuedIssue is queued for workstoryStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions