diff --git a/frontend/src/v2/components/GameDetails/InfoGrid.vue b/frontend/src/v2/components/GameDetails/InfoGrid.vue index 044aa3c3d..2d14946e9 100644 --- a/frontend/src/v2/components/GameDetails/InfoGrid.vue +++ b/frontend/src/v2/components/GameDetails/InfoGrid.vue @@ -7,7 +7,15 @@ // hover affordance so they read as candidates for click-to-filter. // Sections with no items are omitted so the grid doesn't show empty // columns. +// +// A section carrying a `filter` renders its chips as links into the +// global search scoped to that value (`/search?genres=Adventure`), the +// pivot-to-search v1 offered from the same rows. Links (not click +// handlers) so middle-click / open-in-new-tab work and the chips join +// keyboard + spatial navigation as `a[href]`. import { RIcon } from "@v2/lib"; +import { ROUTES } from "@/plugins/router"; +import type { FilterType } from "@/stores/galleryFilter"; defineOptions({ inheritAttrs: false }); @@ -17,11 +25,19 @@ export type InfoGridSection = { /** Leading icon for the section header — gives each category a * semantic cue (e.g. tags for genres, building for companies). */ icon?: string; + /** Gallery filter these items map to. Set it to make the chips + * clickable pivots into a filtered search. */ + filter?: FilterType; }; const props = defineProps<{ sections: InfoGridSection[] }>(); const visible = () => props.sections.filter((s) => s.items.length > 0); + +const searchLocation = (filter: FilterType, item: string) => ({ + name: ROUTES.SEARCH, + query: { [filter]: item }, +});