From bddfd37a5cd177e826447f2431cecb17996331b4 Mon Sep 17 00:00:00 2001 From: Logan Date: Wed, 12 Aug 2026 12:38:36 -0400 Subject: [PATCH] feat(track-list): show Album by default, and search smart playlists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit H-15: the default columns were track, artist and duration, so a library manager with duplicate detection could not tell its own duplicate fixtures apart by eye. Album is a default now, in Go and in the frontend fallback — both, because a fresh install persists the Go list and the UI renders the TS one until the config arrives. It does not deliver the finding's stated benefit, and that is worth recording: the three `Tideline / Aurora Fields / 00:06` rows are duplicates of the same album, so they read identically with an Album column too. What tells them apart is the duplicate-detection feature or a file path column, not this. Album is still the right default for every other row in the list. smart-playlist-details joins search-store's scope map. Checked before adding, as asked: it reads searchCtrl.term in getVisibleTracks and prints the term in the page, so the header box was disabled and unlabelled on a view that filters as you type — the fix is a scope entry, not a disabled state with a reason. --- backend/tracklist/config.go | 9 +++++++-- frontend/src/components/track-list/columns.ts | 9 ++++++++- frontend/src/store/search-store.ts | 6 ++++++ frontend/test/stores/view-stores.test.ts | 4 ++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/backend/tracklist/config.go b/backend/tracklist/config.go index c6bdf9d..e1ba8d0 100644 --- a/backend/tracklist/config.go +++ b/backend/tracklist/config.go @@ -60,11 +60,16 @@ var AllColumnIDs = []ColumnID{ ColPlayCount, } -// DefaultColumns is the initial column configuration matching the -// original hardcoded layout. +// DefaultColumns is the initial column configuration. Album is in it +// (H-15): without it the three identical `Tideline / Aurora Fields / +// 00:06` rows in this app's own fixture library cannot be told apart, +// in an app that has a duplicate-detection feature. Must match +// DEFAULT_COLUMN_IDS in frontend/src/components/track-list/columns.ts, +// which is what the UI falls back to before the config arrives. var DefaultColumns = []Column{ {ID: ColTrackName}, {ID: ColArtistName}, + {ID: ColAlbum}, {ID: ColTrackLength}, } diff --git a/frontend/src/components/track-list/columns.ts b/frontend/src/components/track-list/columns.ts index 614603d..7880f96 100644 --- a/frontend/src/components/track-list/columns.ts +++ b/frontend/src/components/track-list/columns.ts @@ -249,9 +249,16 @@ export const CORE_SEARCH_COLUMN_IDS: string[] = [ 'album', ]; -/** Default column IDs matching the original hardcoded layout. */ +/** + * Default column IDs. Album is in them (H-15): without it, the three + * `Tideline / Aurora Fields / 00:06` rows in this app's own fixture + * library are indistinguishable, in an app that has duplicate + * detection. Must match `tracklist.DefaultColumns` in Go, which is what + * a fresh install actually persists. + */ export const DEFAULT_COLUMN_IDS: string[] = [ 'trackName', 'artistName', + 'album', 'trackLength', ]; diff --git a/frontend/src/store/search-store.ts b/frontend/src/store/search-store.ts index e764f90..3d6725b 100644 --- a/frontend/src/store/search-store.ts +++ b/frontend/src/store/search-store.ts @@ -19,6 +19,12 @@ const SEARCH_SCOPES: Record = { genres: 'genres', playlists: 'playlists', 'playlist-details': 'tracks in this playlist', + // Its sibling was in this map and it was not, so the box went + // disabled and unlabelled on a view that filters on the term all + // the same — typing narrowed the list under a placeholder saying + // there was nothing to search. Checked before adding: it reads + // `searchCtrl.term` in `getVisibleTracks` and says so in the page. + 'smart-playlist-details': 'tracks in this smart playlist', }; /** diff --git a/frontend/test/stores/view-stores.test.ts b/frontend/test/stores/view-stores.test.ts index c4e1b09..b189459 100644 --- a/frontend/test/stores/view-stores.test.ts +++ b/frontend/test/stores/view-stores.test.ts @@ -54,6 +54,10 @@ describe('search store', () => { 'albums', 'playlists', 'playlist-details', + // A detail view that filters on the term has to be in the map: + // this one was not, so the box was disabled and unlabelled on a + // page that narrowed its list as you typed. + 'smart-playlist-details', 'artists', 'genres', ].map((view) => {