diff --git a/frontend/scripts/build-tokens.ts b/frontend/scripts/build-tokens.ts index a14d91de5..d1ed014b1 100644 --- a/frontend/scripts/build-tokens.ts +++ b/frontend/scripts/build-tokens.ts @@ -84,6 +84,7 @@ const NAME_OVERRIDES = { alphaStripWidth: "--r-alpha-strip-w", listRowHeight: "--r-list-row-h", listHeaderHeight: "--r-list-header-h", + listSelectWidth: "--r-list-select-w", listRowDetailHeight: "--r-list-row-detail-h", }, colorBrand: { diff --git a/frontend/src/v2/components/Collections/CollectionListHeader.vue b/frontend/src/v2/components/Collections/CollectionListHeader.vue index 359866bc1..5e201f2bf 100644 --- a/frontend/src/v2/components/Collections/CollectionListHeader.vue +++ b/frontend/src/v2/components/Collections/CollectionListHeader.vue @@ -3,9 +3,10 @@ // list-mode view. Mirrors GameListHeader's anatomy: each sortable // column is a button that toggles asc → desc → asc on the parent's // sort state via the `sort` event. -import { RIcon, RMenu, RMenuItem } from "@v2/lib"; +import { RIcon } from "@v2/lib"; import { computed } from "vue"; import { useI18n } from "vue-i18n"; +import ListSortMenu from "@/v2/components/shared/ListSortMenu.vue"; import { useBreakpoint } from "@/v2/composables/useBreakpoint"; import { COLLECTION_LIST_COLUMNS, @@ -36,15 +37,9 @@ const gridStyle = { gridTemplateColumns: COLLECTION_LIST_GRID_TEMPLATE }; // Phones and tablets drop the columns (the rows go compact), so the sort // key they carried moves into a menu — same as the gallery's list header. const { smAndDown } = useBreakpoint(); -const compact = computed(() => smAndDown.value); -const sortableColumns = computed(() => - COLLECTION_LIST_COLUMNS.filter((col) => col.sortKey), -); -const sortLabel = computed(() => - t( - sortableColumns.value.find((col) => col.key === props.sortKey)?.labelKey ?? - sortableColumns.value[0]?.labelKey ?? - "common.name", +const sortOptions = computed(() => + COLLECTION_LIST_COLUMNS.flatMap((col) => + col.sortKey ? [{ key: col.sortKey, label: t(col.labelKey) }] : [], ), ); @@ -60,46 +55,16 @@ function handleClick(col: CollectionListColumn) {