Skip to content

SearchMatchDetails Component ​

File Information ​

  • Path: app/components/search/SearchMatchDetails.vue
  • Purpose: Body of the "Matched In" hover menu: lists the tags, custom fields or description text that made a search result match.
  • Type: Search Component

Overview ​

Rendered inside the v-menu of SearchMatchChip. It takes one SearchMatch and renders one of three layouts. All derived state comes from useSearchMatchDetails.

match.kindTitleBody
tagMatched tagsone v-chip per tag (match.value first, then match.others). A tag with a built link renders as <a target="_blank" rel="noopener noreferrer"> to /{brand}/search?q=<encrypted>; without one it is plain text
custom_fieldMatched custom fieldsone v-chip.chip-custom per field, shown as Label: value; the label part is omitted when label is empty
descriptionMatched in descriptionthe full description as match.parts; runs with hit: true are wrapped in <mark class="search-match-hit">

Tag links open in a new tab so the current search is not lost. Clicking a linked tag fires the Amplitude TAG_CLICKED event ('tag clicked') with source: 'search-match'.

Props ​

PropTypeRequiredDescription
matchSearchMatchYesOne entry from the asset's search_matches
assetIdstring | numberNoSent as asset_id on the tag-click event (stringified, null when absent)

SearchMatch (app/types/search.ts):

typescript
type SearchMatch =
  | { kind: 'tag'; value: string; others: string[] }
  | { kind: 'custom_field'; label: string; value: string; others: CustomFieldMatch[] }
  | { kind: 'description'; snippet: string; parts: TextPart[] }

Events ​

None.

Usage Example ​

vue
<!-- SearchMatchChip.vue -->
<SearchMatchDetails :match="match" :asset-id="assetId" />