Skip to content

fix(stats): local artist images, ragged KPI row, clipped hour labels - #454

Merged
InstaZDLL merged 1 commit into
mainfrom
fix/453-statistics-ui-issues
Jul 28, 2026
Merged

fix(stats): local artist images, ragged KPI row, clipped hour labels#454
InstaZDLL merged 1 commit into
mainfrom
fix/453-statistics-ui-issues

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Jul 28, 2026

Copy link
Copy Markdown
Owner

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_artists 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) 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 joins artwork as well.

Now joins artwork too and prefers it over Deezer, matching list_artists / expand_artist_rows and the documented "local artist images … prioritised over Deezer" rule. picture_url is 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 wrapper div, but the card inside kept its content height, so the row was ragged along the bottom. h-full on 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 truncate chopped the hour. That's also why closing the sidebar "fixed" it.

thinLabels already 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 the labelStep === 1 case, 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

  • Améliorations
    • Les statistiques des meilleurs artistes privilégient désormais les pochettes locales lorsqu’elles sont disponibles.
    • Les exports de statistiques incluent les pochettes locales associées.
    • Les libellés des graphiques restent lisibles sur les affichages larges, avec moins de troncature lorsque l’espace le permet.
    • Les cartes d’indicateurs statistiques ont désormais une hauteur harmonisée, notamment lorsqu’une indication complémentaire est affichée.

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
@InstaZDLL InstaZDLL added scope: frontend React/Vite frontend (src/) scope: backend Rust/Tauri backend (src-tauri/) type: fix Bug fix size: m 50-200 lines labels Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

La 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.

Changes

Statistiques avec artworks locaux

Layer / File(s) Summary
Résolution des artworks locaux
src-tauri/crates/app/src/commands/stats.rs
Les données locales d’artwork sont ajoutées à la structure interne, à la requête SQL et aux paramètres de la commande.
Mapping local-first et export
src-tauri/crates/app/src/commands/stats.rs
Les images locales existantes sont utilisées avant les métadonnées, et l’export JSON transmet le répertoire d’artwork local.
Affichage des graphiques et cartes KPI
src/components/views/statistics/BarChart.tsx, src/components/views/statistics/KpiCard.tsx
Les labels utilisent un débordement conditionnel selon labelStep, et les cartes KPI adoptent h-full.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Les changements corrigent bien les trois problèmes décrits dans #453 : images locales, hauteur du KPI et troncature des labels horaires.
Out of Scope Changes check ✅ Passed Je ne vois pas de changement hors périmètre : les modifications ciblent uniquement les correctifs demandés pour la page Statistics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed Le titre suit le format Conventional Commits et résume bien les trois correctifs principaux de la PR.
Description check ✅ Passed La description couvre les 3 problèmes, explique le pourquoi et inclut une vérification, même si la mise en forme du template n’est pas suivie à la lettre.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/453-statistics-ui-issues

Comment @coderabbitai help to get the list of available commands.

@InstaZDLL
InstaZDLL merged commit 0ef99f1 into main Jul 28, 2026
14 checks passed
@InstaZDLL
InstaZDLL deleted the fix/453-statistics-ui-issues branch July 28, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: backend Rust/Tauri backend (src-tauri/) scope: frontend React/Vite frontend (src/) size: m 50-200 lines type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: a few UI issues with Statistics page.

1 participant