diff --git a/frontend/scripts/build-tokens.ts b/frontend/scripts/build-tokens.ts index 14b801a90..a14d91de5 100644 --- a/frontend/scripts/build-tokens.ts +++ b/frontend/scripts/build-tokens.ts @@ -82,9 +82,9 @@ const NAME_OVERRIDES = { collectionCoverWidthXs: "--r-coll-cover-w-xs", collectionCoverHeightXs: "--r-coll-cover-h-xs", alphaStripWidth: "--r-alpha-strip-w", - alphaStripWidthXs: "--r-alpha-strip-w-xs", listRowHeight: "--r-list-row-h", listHeaderHeight: "--r-list-header-h", + listRowDetailHeight: "--r-list-row-detail-h", }, colorBrand: { fav: "--r-color-fav", diff --git a/frontend/src/v2/components/Collections/CollectionListHeader.vue b/frontend/src/v2/components/Collections/CollectionListHeader.vue index 66c7687be..359866bc1 100644 --- a/frontend/src/v2/components/Collections/CollectionListHeader.vue +++ b/frontend/src/v2/components/Collections/CollectionListHeader.vue @@ -3,8 +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 } from "@v2/lib"; +import { RIcon, RMenu, RMenuItem } from "@v2/lib"; +import { computed } from "vue"; import { useI18n } from "vue-i18n"; +import { useBreakpoint } from "@/v2/composables/useBreakpoint"; import { COLLECTION_LIST_COLUMNS, COLLECTION_LIST_GRID_TEMPLATE, @@ -31,6 +33,21 @@ const emit = defineEmits<{ const { t } = useI18n(); 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", + ), +); + function handleClick(col: CollectionListColumn) { if (!col.sortKey) return; // Toggle direction when re-clicking the active column; otherwise @@ -42,7 +59,50 @@ function handleClick(col: CollectionListColumn) {