From 9509a1e355226cf4cff1d34eae3df083d353bab0 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Thu, 30 Jul 2026 21:03:54 -0400 Subject: [PATCH] fix(v2): pivot to a filtered search from the overview info grid Genre / company / franchise / collection chips were plain spans with a hover affordance but no behavior, dropping the pivot-to-search v1 offered from the same rows. Sections now carry the gallery filter their items map to, and the chips render as links into the search view scoped to that value. Links rather than click handlers, so middle-click and open-in-new- tab work and the chips join keyboard / spatial navigation. Fixes #4011 Co-Authored-By: Claude Opus 5 (1M context) --- .../v2/components/GameDetails/InfoGrid.vue | 38 +++++++++++++++---- frontend/src/v2/views/GameDetails.vue | 12 ++++-- 2 files changed, 39 insertions(+), 11 deletions(-) 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 }, +});