Skip to content

fix(album): carry the full track row so Properties isn't half empty - #459

Merged
InstaZDLL merged 1 commit into
mainfrom
fix/458-album-track-fields
Jul 29, 2026
Merged

fix(album): carry the full track row so Properties isn't half empty#459
InstaZDLL merged 1 commit into
mainfrom
fix/458-album-track-fields

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Fixes #458@jo-el414 reported that a track's Properties modal shows its Audio and File sections when opened from Tracks / Artist / Genre, but leaves them blank for the same track opened from the album page.

Cause

AlbumDetailView has to synthesise a full Track for the context menu (which is what feeds the Properties modal), but AlbumTrack never carried those columns. So the mapping filled them with placeholders:

bitrate: null,
channels: null,
codec: null,        // …even though `at.codec` was right there
musical_key: null,
file_size: 0,
added_at: 0,

The modal then rendered exactly what it was handed. Nothing was wrong with the modal or the database — the row simply arrived incomplete, and only on this one path.

get_album_detail now selects those columns and the mapping uses them.

A second one, found while verifying

I wrote a comment claiming the rating submenu was disabled on this view, then checked instead of trusting it — it isn't. enableRating defaults to true and AlbumDetailView doesn't override it, so the menu was showing a rating built from a hard-coded rating: null: an already-rated track read as unrated there, which is the exact misreport that option exists to prevent on surfaces genuinely lacking a rating.

Rather than hide the submenu, the album query now selects the real rating — consistent with every other view, and rating from the album page keeps working.

Detail

year prefers the track's own value over the album header's, since a compilation can carry per-track years.

Verification

cargo check -p waveflow, bun run typecheck, bun run lint, prettier — all clean (exit codes read directly).

Not visually verified: the app can't run outside the Tauri shell here, so this is reasoned from the data path and the reporter's screenshots. The check is quick though — open Properties on an album track and compare with the same track from the Tracks view.

Summary by CodeRabbit

  • Améliorations
    • Le menu contextuel et la fenêtre des propriétés des morceaux depuis la vue détaillée d’un album affichent désormais des informations complètes et exactes.
    • Les métadonnées incluent notamment l’année, le débit, les canaux, la tonalité, la taille du fichier, la date d’ajout et la note.
    • L’année affichée privilégie désormais celle du morceau lorsqu’elle est disponible.

Reported in #458: opening a track's Properties from the album page left
the Audio and File sections blank, while the same track opened from
Tracks / Artist / Genre showed everything.

AlbumDetailView has to synthesise a `Track` for the context menu, and
`AlbumTrack` never carried those columns — so the mapping filled them
with placeholders: `bitrate: null`, `channels: null`, `file_size: 0`,
`added_at: 0`, `musical_key: null`, and even `codec: null` despite the
row having a codec. The modal then rendered exactly what it was given.

Select the columns in `get_album_detail` and map them for real.

Also fixes a quieter one found while checking that mapping: `rating` was
hard-coded to null, but the context menu's rating submenu is enabled by
default on this view — so an already-rated track showed up as unrated,
the precise misreport `enableRating: false` exists to prevent elsewhere.
The album query now selects the real rating instead.

`year` prefers the track's own over the album header's, since a
compilation can carry per-track years.

Refs #458
@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 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ebc57522-4292-4e4e-bc85-9e9acf034a73

📥 Commits

Reviewing files that changed from the base of the PR and between d35d640 and c2515fb.

📒 Files selected for processing (3)
  • src-tauri/crates/app/src/commands/browse.rs
  • src/components/views/AlbumDetailView.tsx
  • src/lib/tauri/detail.ts

📝 Walkthrough

Walkthrough

L’API de détail d’album expose désormais les métadonnées audio et fichier des pistes. Le contrat TypeScript et AlbumDetailView les utilisent pour construire des pistes complètes dans le menu contextuel et le modal Properties.

Changes

Métadonnées des pistes d’album

Layer / File(s) Summary
Contrat et chargement des métadonnées
src-tauri/crates/app/src/commands/browse.rs
AlbumTrack, AlbumTrackRaw et la requête get_album_detail intègrent year, bitrate, channels, musical_key, file_size, added_at et rating.
Transmission aux propriétés
src/lib/tauri/detail.ts, src/components/views/AlbumDetailView.tsx
Le type TypeScript expose les nouveaux champs et playableTracks les mappe depuis chaque piste, avec repli de year sur l’année de l’album.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • InstaZDLL/WaveFlow#435 — Ajoute des menus contextuels utilisant la conversion des données Track, avec des métadonnées de piste connexes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Le titre résume clairement le correctif principal : la vue album transmet désormais la ligne piste complète aux propriétés.
Linked Issues check ✅ Passed Le PR corrige le manque de métadonnées dans les Propriétés depuis la vue album en renvoyant les champs audio/fichier/rating attendus.
Out of Scope Changes check ✅ Passed Les changements restent ciblés sur les métadonnées manquantes dans le modal Propriétés et ne montrent pas de portée parasite.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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/458-album-track-fields

Warning

Tools execution failed with the following error:

Failed to run tools: 14 UNAVAILABLE: read ECONNRESET


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

@InstaZDLL
InstaZDLL merged commit b31b886 into main Jul 29, 2026
14 checks passed
@InstaZDLL
InstaZDLL deleted the fix/458-album-track-fields branch July 29, 2026 17: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: Tag Editor (properties) do not view some of the info from album screen - track info.

1 participant