From 32eb667606e17c47bd29bcfe2c4f4a1b5fdfb2e7 Mon Sep 17 00:00:00 2001 From: zurdi Date: Sun, 20 Sep 2026 19:31:16 +0200 Subject: [PATCH] fix(v2): address the code-review pass on the list view - Stop the pinned index header from subtracting the gutter twice, which pushed its glass past the right edge and scrolled the page sideways. - Give the compact skeleton row the tick-column spacer the real row has, so covers and titles don't jump when the first window resolves. - Name the sort menu "Sort by" when the gallery's order is one the columns don't carry, instead of claiming the first column. - Paint a rolling counter's starting value before the first frame, which a background tab never serves. - Dispose the expansion animation with its scope. - Drop the selection notch's live region, which read out every frame of the roll, for a labelled image. - Apply the letter-jump deadline on the scroll-end path too. - Localise the platforms row's game count on desktop as the compact row already did. - Delete rules and constants the compact branches made unreachable. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK --- .../v2/components/Gallery/GalleryShell.vue | 23 ++-- .../v2/components/Gallery/GameListHeader.vue | 6 +- .../src/v2/components/Gallery/GameListRow.vue | 123 +++++++++--------- .../Gallery/GameListSkeletonRow.vue | 7 + .../v2/components/Gallery/PlatformHead.vue | 1 - .../v2/components/Gallery/SelectionBar.vue | 8 +- .../src/v2/components/Gallery/listColumns.ts | 6 +- .../Platforms/PlatformListHeader.vue | 7 - .../components/Platforms/PlatformListRow.vue | 16 +-- .../src/v2/components/shared/IndexShell.vue | 9 +- .../v2/composables/useAnimatedNumber/index.ts | 3 + .../useGalleryVirtualItems/index.ts | 1 - .../v2/composables/useListExpansion/index.ts | 4 +- 13 files changed, 114 insertions(+), 100 deletions(-) diff --git a/frontend/src/v2/components/Gallery/GalleryShell.vue b/frontend/src/v2/components/Gallery/GalleryShell.vue index 6108a25c5..c08d5b4d1 100644 --- a/frontend/src/v2/components/Gallery/GalleryShell.vue +++ b/frontend/src/v2/components/Gallery/GalleryShell.vue @@ -671,11 +671,23 @@ function endLetterJump() { jumpLetter.value = null; } +/** The letter still worth correcting towards, or null once the cap is up. */ +function pendingJumpLetter(): string | null { + const letter = jumpLetter.value; + if (!letter) return null; + if (Date.now() > jumpDeadline) { + endLetterJump(); + return null; + } + return letter; +} + // The smooth scroll animates towards the target the jump computed; anything // that moved meanwhile (a re-pack, the header rendering) leaves it short, so // settle onto the letter once the animation stops. function onScrollEnd() { - if (jumpLetter.value) anchorLetter(jumpLetter.value, false); + const letter = pendingJumpLetter(); + if (letter) anchorLetter(letter, false); } // Three things move a letter out from under the toolbar after the jump: the @@ -689,13 +701,8 @@ watch( () => galleryRoms.loadedWindows.size, ], () => { - const letter = jumpLetter.value; - if (!letter) return; - if (Date.now() > jumpDeadline) { - endLetterJump(); - return; - } - anchorLetter(letter, false); + const letter = pendingJumpLetter(); + if (letter) anchorLetter(letter, false); }, ); diff --git a/frontend/src/v2/components/Gallery/GameListHeader.vue b/frontend/src/v2/components/Gallery/GameListHeader.vue index fa4357a04..338823658 100644 --- a/frontend/src/v2/components/Gallery/GameListHeader.vue +++ b/frontend/src/v2/components/Gallery/GameListHeader.vue @@ -56,11 +56,13 @@ const gridStyle = computed(() => ({ const { smAndDown } = useBreakpoint(); const compact = computed(() => smAndDown.value); const sortOptions = computed(() => getSortOptions(props.showPlatformColumn)); +// `sortKey` is null whenever the gallery's order is one the columns don't +// carry (`last_played`, `fs_name`, …); naming a column there would claim a +// sort that isn't in effect. const sortLabel = computed( () => sortOptions.value.find((option) => option.key === props.sortKey)?.label ?? - sortOptions.value[0]?.label ?? - "", + t("gallery.sort-by"), ); const selection = storeGallerySelection(); diff --git a/frontend/src/v2/components/Gallery/GameListRow.vue b/frontend/src/v2/components/Gallery/GameListRow.vue index b92f81427..1ec9bf994 100644 --- a/frontend/src/v2/components/Gallery/GameListRow.vue +++ b/frontend/src/v2/components/Gallery/GameListRow.vue @@ -74,7 +74,7 @@ interface Props { showPlatformColumn?: boolean; /** Offer the chevron that opens the detail panel (phones and tablets). * Only for surfaces whose virtualiser accounts for the taller row — - * the gallery shell does, via `expandedPosition`. */ + * both callers do, via `useListExpansion`. */ expandable?: boolean; /** Whether this row's detail panel is open. */ expanded?: boolean; @@ -481,7 +481,6 @@ function onRowPointerEnd() { - @@ -901,12 +902,18 @@ html[data-bp~="sm-and-down"] .game-list-row { gap: 2px; min-width: 0; } +/* One line, always: the panel's height is fixed (`--r-list-row-detail-h`) for + the virtualiser, so a caption that wraps in another locale would push the + last field out of the clipped box. */ .game-list-row__field-label { font-size: var(--r-font-size-xs); font-weight: var(--r-font-weight-bold); letter-spacing: 0.07em; text-transform: uppercase; color: var(--r-color-fg-muted); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .game-list-row__field--wide { grid-column: 1 / -1; diff --git a/frontend/src/v2/components/Gallery/GameListSkeletonRow.vue b/frontend/src/v2/components/Gallery/GameListSkeletonRow.vue index 0b7e62975..105ee69f2 100644 --- a/frontend/src/v2/components/Gallery/GameListSkeletonRow.vue +++ b/frontend/src/v2/components/Gallery/GameListSkeletonRow.vue @@ -50,6 +50,9 @@ const compact = computed(() => smAndDown.value);