From 9696de8ee8be9e080dd50eac3d951651e4e71c5c Mon Sep 17 00:00:00 2001 From: zurdi Date: Sun, 20 Sep 2026 17:43:28 +0200 Subject: [PATCH] fix(v2): rebuild the gallery list view for phones The list header was built for a desktop table: it floated as its own island over the rows, which showed through its blur, and the table underneath it scrolled sideways on a phone. - Pin the header edge to edge as one glass surface with the toolbar, tinted only once pinned, keeping its border as the divider. - Trade the columns on sm-and-down for a two-line row (cover, title, facts) with a chevron that rolls a three-column detail panel open, so nothing scrolls sideways. - Swap the alpha strip for an A-Z menu in the toolbar on phones and tablets, and land letter jumps flush under the toolbar in both layouts. - Give the platforms and collections indexes, and the missing-games list, the same row. - Move the selection counter into a notch above the floating bar and animate the bar in. - Roll every counter up to its new value (useAnimatedNumber). Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK --- frontend/scripts/build-tokens.ts | 2 +- .../Collections/CollectionListHeader.vue | 76 +- .../Collections/CollectionListRow.vue | 76 ++ .../components/Gallery/AlphaJumpMenu.test.ts | 90 +++ .../v2/components/Gallery/AlphaJumpMenu.vue | 85 +++ .../src/v2/components/Gallery/AlphaStrip.vue | 36 +- .../v2/components/Gallery/GalleryShell.vue | 182 ++++- .../v2/components/Gallery/GalleryTabShell.vue | 4 + .../v2/components/Gallery/GalleryToolbar.vue | 7 + .../v2/components/Gallery/GameListHeader.vue | 112 ++- .../src/v2/components/Gallery/GameListRow.vue | 680 ++++++++++++++---- .../Gallery/GameListRowCompact.test.ts | 92 +++ .../Gallery/GameListSkeletonParity.test.ts | 129 +--- .../Gallery/GameListSkeletonRow.vue | 39 +- .../v2/components/Gallery/PlatformHead.vue | 38 +- .../v2/components/Gallery/SelectionBar.vue | 122 ++-- .../src/v2/components/Gallery/listColumns.ts | 20 +- .../v2/components/Gallery/listRowFixture.ts | 131 ++++ .../Platforms/PlatformListHeader.vue | 81 ++- .../components/Platforms/PlatformListRow.vue | 87 +++ .../Settings/MissingGamesSection.vue | 17 +- .../src/v2/components/shared/IndexShell.vue | 15 +- .../src/v2/components/shared/PageHeader.vue | 15 +- frontend/src/v2/components/shared/Stat.vue | 15 +- .../useAnimatedNumber/index.test.ts | 63 ++ .../v2/composables/useAnimatedNumber/index.ts | 77 ++ .../expandedRowHeight.test.ts | 56 ++ .../useGalleryVirtualItems/index.ts | 14 +- .../useListExpansion/index.test.ts | 67 ++ .../v2/composables/useListExpansion/index.ts | 100 +++ .../src/v2/lib/forms/RCheckbox/RCheckbox.vue | 21 + .../RVirtualScroller/RVirtualScroller.vue | 2 +- frontend/src/v2/styles/global.css | 23 +- frontend/src/v2/styles/tokens.css | 3 +- frontend/src/v2/tokens/index.ts | 9 +- frontend/src/v2/types/stats.ts | 7 + frontend/src/v2/views/Gallery/Platform.vue | 6 +- 37 files changed, 2179 insertions(+), 420 deletions(-) create mode 100644 frontend/src/v2/components/Gallery/AlphaJumpMenu.test.ts create mode 100644 frontend/src/v2/components/Gallery/AlphaJumpMenu.vue create mode 100644 frontend/src/v2/components/Gallery/GameListRowCompact.test.ts create mode 100644 frontend/src/v2/components/Gallery/listRowFixture.ts create mode 100644 frontend/src/v2/composables/useAnimatedNumber/index.test.ts create mode 100644 frontend/src/v2/composables/useAnimatedNumber/index.ts create mode 100644 frontend/src/v2/composables/useGalleryVirtualItems/expandedRowHeight.test.ts create mode 100644 frontend/src/v2/composables/useListExpansion/index.test.ts create mode 100644 frontend/src/v2/composables/useListExpansion/index.ts create mode 100644 frontend/src/v2/types/stats.ts 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) {