Skip to content

Render disambiguatingTags in search results to distinguish same-named variants #175

Description

@wizzomafizzo

Context

zaparoo-core #969 (merged) adds a disambiguatingTags field to media.search and media.browse responses: the subset of a result's tags whose values differ across same-named siblings of that title, ordered by display importance. This is the server-side half of solving indistinguishable duplicate cards in the image grid — the client just needs to render it.

Current behaviour

SearchResultGame (src/lib/models.ts) doesn't have the field yet. SearchResults.tsx works around duplicate names by falling back to the raw filename:

// SearchResults.tsx (~lines 172-183)
const isDuplicate = duplicateNames.has(game.name);
... isDuplicate ? filenameFromPath(game.path) || game.name : game.name

That's noisy (full filenames with brackets) and inconsistent.

Proposal

  1. Add disambiguatingTags?: TagInfo[] to SearchResultGame (and the browse-entry model) in src/lib/models.ts.
  2. In SearchResults.tsx / VirtualSearchResults.tsx, when present, render the disambiguating tags as a compact badge row / subtitle on the card, and prefer this over the filename fallback for distinguishing same-named entries. The existing TagList component (already used for game.tags) could be reused with the disambiguating subset.

Notes:

  • Tags are pre-sorted by importance server-side, so render left-to-right and truncate; no client-side ranking needed.
  • A type only appears when it actually differs across siblings, so the field is empty for non-duplicated titles.

Acceptance

Regional / multi-disc / revision / arcade build-date variants of the same game show distinct badges (e.g. region:eu, builddate:1996-10-04) instead of identical cards or raw filenames.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions