diff --git a/frontend/scripts/build-tokens.ts b/frontend/scripts/build-tokens.ts index 3c67d368d..34713d8c3 100644 --- a/frontend/scripts/build-tokens.ts +++ b/frontend/scripts/build-tokens.ts @@ -82,9 +82,10 @@ 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", + listSelectWidth: "--r-list-select-w", + 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..e3f0e246a 100644 --- a/frontend/src/v2/components/Collections/CollectionListHeader.vue +++ b/frontend/src/v2/components/Collections/CollectionListHeader.vue @@ -4,7 +4,10 @@ // 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 { 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, COLLECTION_LIST_GRID_TEMPLATE, @@ -31,6 +34,15 @@ 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 sortOptions = computed(() => + COLLECTION_LIST_COLUMNS.flatMap((col) => + col.sortKey ? [{ key: col.sortKey, label: t(col.labelKey) }] : [], + ), +); + function handleClick(col: CollectionListColumn) { if (!col.sortKey) return; // Toggle direction when re-clicking the active column; otherwise @@ -42,7 +54,20 @@ function handleClick(col: CollectionListColumn) { -