fix(stats): local artist images, ragged KPI row, clipped hour labels - #454
Merged
Conversation
Three UI issues reported on the Statistics page (#453). **Top artists showed initials for artists that do have a picture.** The query resolved images only through `app.metadata_artist`, the Deezer cache, joined on `artist.deezer_id`. An artist whose picture comes from a local sidecar (`artist.jpg` / `<name>.jpg`, stored as `artist.artwork_id`) has no row there, so the card fell back to its initial — while the artist list and artist page, which join `artwork` too, showed the picture. Join it here as well and prefer it over Deezer, matching `list_artists` and the documented "local artist images prioritised over Deezer" rule. Same Deezer-only blind spot as #350, third site. **The "unique tracks" KPI card stood taller than its row.** It's the only one passing a `hint`, and the grid stretches the wrapper while the card inside kept its content height. `h-full` on the card. **Hour labels were cut in half.** Each label is clipped to one bar's width; at 24 bars in a third-width column (1080p with the sidebar open) a cell is narrower than "00". When `thinLabels` is on the neighbouring cells are empty, so a label can overflow into them instead of being truncated. Clipping stays for the every-cell-filled case. Refs #453
📝 WalkthroughWalkthroughLa page Statistiques privilégie désormais les artworks locaux pour les top artistes et leur export JSON. L’interface ajuste aussi le comportement des labels de graphiques et la hauteur des cartes KPI. ChangesStatistiques avec artworks locaux
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant StatisticsPage
participant stats_top_artists
participant Database
participant artwork_dir
StatisticsPage->>stats_top_artists: Demander les top artistes
stats_top_artists->>Database: Charger les données metadata et artwork local
Database-->>stats_top_artists: Retourner les artistes et artworks
stats_top_artists->>artwork_dir: Vérifier les fichiers locaux
artwork_dir-->>stats_top_artists: Retourner le chemin disponible
stats_top_artists-->>StatisticsPage: Retourner les lignes d’artistes résolues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #453 — three UI issues @jo-el414 reported on the Statistics page in 1.7.0.
1. Top artists showed an initial for artists that do have a picture
The
stats_top_artistsquery resolved images only throughapp.metadata_artist— the Deezer cache — joined onartist.deezer_id. An artist whose picture comes from a local sidecar (artist.jpg/<name>.jpg, stored asartist.artwork_id) simply has no row there, so the card fell back to its initial. The reporter uses local images for all their artists, which is exactly why it hit them so visibly — and why the same artist rendered fine on the artist page, whose query joinsartworkas well.Now joins
artworktoo and prefers it over Deezer, matchinglist_artists/expand_artist_rowsand the documented "local artist images … prioritised over Deezer" rule.picture_urlis dropped when a local file is used, so the row can't fall back to the network for an image it already has on disk.Same Deezer-only blind spot as #350 — this is its third site.
2. "Unique tracks" card taller than the rest of its row
It's the only KPI passing a
hint(the "N artists" line). The grid stretches the wrapperdiv, but the card inside kept its content height, so the row was ragged along the bottom.h-fullon the card.3. Hour labels cut in half
Each label is clipped to one bar's width. With 24 bars in a third-width column — 1080p with the sidebar open, precisely the reporter's setup — a cell is narrower than the text "00", so
truncatechopped the hour. That's also why closing the sidebar "fixed" it.thinLabelsalready renders only every 3rd label, so the neighbouring cells are empty strings: a rendered label can overflow into them and stay centred and complete. Clipping is kept for thelabelStep === 1case, where every cell holds real text.Verification
cargo check -p waveflow --all-targets,cargo test,bun run typecheck,bun run lint— all clean (exit codes read directly).Summary by CodeRabbit