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);