From c119a32277f98b6d91eca398a6fed4ab4802c344 Mon Sep 17 00:00:00 2001 From: Frank Stellmacher <171614930+Psychotoxical@users.noreply.github.com> Date: Thu, 4 Jun 2026 00:53:22 +0200 Subject: [PATCH] Unify button tooltips across the app (#972) * feat(tooltip): 2s open delay and shared tooltipAttrs helper Add a 2s hover open delay in TooltipPortal (single behaviour source) so tooltips no longer flash on quick pointer passes; hiding stays immediate. Add tooltipAttrs() to pair data-tooltip with a matching aria-label for buttons touched in the unification work. Covered by Vitest. * feat(tooltip): lower open delay to 1s 2s felt too long in testing; 1s gives the same anti-flash behaviour without making intentional hovers wait. * feat(tooltip): action tooltips on the artist overview Add tooltips describing the action to Last.fm, Wikipedia, Play All, Shuffle and Radio. Shuffle/Radio now show a tooltip on desktop too, not just mobile. Strings added to all 9 locales. * feat(tooltip): action tooltips on the album overview Add tooltips describing the action to the desktop Play, Artist Bio and Download (ZIP) buttons, matching the mobile layout. Strings added to all 9 locales. * feat(tooltip): action tooltips on the All Albums toolbar Add tooltips describing the action to the sort, year and genre filter buttons. SortDropdown gains an optional tooltip prop; the year and genre filter components carry their own, so the tooltips also appear on the other browse pages that reuse them. Strings added to all 9 locales. * feat(tooltip): action tooltips on song-list rows Add Play and Add-to-queue tooltips to the per-row icons in SongRow, used by the Tracks browse list, Search and Advanced Search. Also localizes the aria-labels, which were hardcoded English. New common.addToQueue in all 9 locales. * fix(tooltip): uniform tooltip placement on the Artists toolbar The favourite and multi-select buttons forced tooltips below while the view-mode buttons auto-flipped above, so the row looked inconsistent. Pin the view-mode buttons below too, matching the rest of the row and the Albums toolbar. * feat(tooltip): clarify and align the Advanced Search scope row Add a leading "Search in:" label and per-chip tooltips so the All/Artists/Albums/Songs row reads as a scope limiter. Drop the forced below-placement on the small star filter (used only here) so the favourites chip flips with the others instead of sitting alone below. Strings added to all 9 locales. * docs(changelog): tooltip unification (#972) --- CHANGELOG.md | 8 ++ src/components/AlbumHeader.tsx | 22 ++++- src/components/GenreFilterBar.tsx | 2 + src/components/SongRow.tsx | 5 +- src/components/SortDropdown.tsx | 6 +- src/components/StarFilterButton.tsx | 1 - src/components/TooltipPortal.test.tsx | 69 ++++++++++++++++ src/components/TooltipPortal.tsx | 80 +++++++++++++++---- src/components/YearFilterButton.tsx | 2 + .../artistDetail/ArtistDetailHero.tsx | 24 ++++-- src/components/tooltipAttrs.test.ts | 21 +++++ src/components/tooltipAttrs.ts | 24 ++++++ src/locales/de/albumDetail.ts | 3 + src/locales/de/albums.ts | 2 + src/locales/de/artistDetail.ts | 5 ++ src/locales/de/common.ts | 2 + src/locales/de/search.ts | 5 ++ src/locales/en/albumDetail.ts | 3 + src/locales/en/albums.ts | 2 + src/locales/en/artistDetail.ts | 5 ++ src/locales/en/common.ts | 2 + src/locales/en/search.ts | 5 ++ src/locales/es/albumDetail.ts | 3 + src/locales/es/albums.ts | 2 + src/locales/es/artistDetail.ts | 5 ++ src/locales/es/common.ts | 2 + src/locales/es/search.ts | 5 ++ src/locales/fr/albumDetail.ts | 3 + src/locales/fr/albums.ts | 2 + src/locales/fr/artistDetail.ts | 5 ++ src/locales/fr/common.ts | 2 + src/locales/fr/search.ts | 5 ++ src/locales/nb/albumDetail.ts | 3 + src/locales/nb/albums.ts | 2 + src/locales/nb/artistDetail.ts | 5 ++ src/locales/nb/common.ts | 2 + src/locales/nb/search.ts | 5 ++ src/locales/nl/albumDetail.ts | 3 + src/locales/nl/albums.ts | 2 + src/locales/nl/artistDetail.ts | 5 ++ src/locales/nl/common.ts | 2 + src/locales/nl/search.ts | 5 ++ src/locales/ro/albumDetail.ts | 3 + src/locales/ro/albums.ts | 2 + src/locales/ro/artistDetail.ts | 5 ++ src/locales/ro/common.ts | 2 + src/locales/ro/search.ts | 5 ++ src/locales/ru/albumDetail.ts | 3 + src/locales/ru/albums.ts | 2 + src/locales/ru/artistDetail.ts | 5 ++ src/locales/ru/common.ts | 2 + src/locales/ru/search.ts | 5 ++ src/locales/zh/albumDetail.ts | 3 + src/locales/zh/albums.ts | 2 + src/locales/zh/artistDetail.ts | 5 ++ src/locales/zh/common.ts | 2 + src/locales/zh/search.ts | 5 ++ src/pages/Albums.tsx | 1 + src/pages/Artists.tsx | 3 + src/pages/SearchBrowsePage.tsx | 17 ++-- 60 files changed, 404 insertions(+), 34 deletions(-) create mode 100644 src/components/TooltipPortal.test.tsx create mode 100644 src/components/tooltipAttrs.test.ts create mode 100644 src/components/tooltipAttrs.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 98f1a458..85bd3f90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -401,6 +401,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Single tracks in the discovery rails now show a round, vinyl-style cover so they read as songs rather than albums — clicking one still plays it instantly. * A new **To album** badge under the artist jumps to the track's album, available in all 9 languages. +### Tooltips — consistent hints on every button + +**By [@Psychotoxical](https://github.com/Psychotoxical), PR [#972](https://github.com/Psychotoxical/psysonic/pull/972)** + +* Buttons across the app now show a short tooltip describing what they do, appearing after a 1-second hover so they never flash during quick mouse passes. +* Tooltips that were missing — on the artist, album, All Albums, track-list and playlist actions — are filled in, and tooltips that used to point different directions within the same toolbar now line up consistently. +* Advanced Search gains a **Search in:** label so the All / Artists / Albums / Songs row reads clearly as a scope limiter. Available in all 9 languages. + diff --git a/src/components/AlbumHeader.tsx b/src/components/AlbumHeader.tsx index 145e54d9..a3281cc1 100644 --- a/src/components/AlbumHeader.tsx +++ b/src/components/AlbumHeader.tsx @@ -18,6 +18,7 @@ import { formatLongDuration } from '../utils/format/formatDuration'; import { formatMb } from '../utils/format/formatBytes'; import { sanitizeHtml } from '../utils/sanitizeHtml'; import { OpenArtistRefInline } from './OpenArtistRefInline'; +import { tooltipAttrs } from './tooltipAttrs'; /** True when the album artist label means "no single artist" — `getArtistInfo` * has nothing meaningful to return for these, so the Artist Bio entry is hidden. @@ -323,7 +324,12 @@ export default function AlbumHeader({ ) : (