From 50df4676f8074e6a2360d8a3ed2c2b326b6ad2bc Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Sun, 29 Mar 2026 17:23:13 -0400 Subject: [PATCH] fix: artist flash on search + independent top section columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three fixes: 1. SearchLocal no longer applies minBlendedScore filter — index hits use scalePopularity scores that aren't comparable to blended MB+LB scores. This prevents artists from appearing in local results then disappearing when the full pipeline replaces them with score-filtered results. 2. Top section columns now render independently — tracks show as soon as they load, top releases show their own loading state or appear when ready. Previously the entire section was blocked until both finished loading. 3. Top releases column shows a loading spinner while its data is still fetching, rather than being invisible. --- backend/explore/explore.go | 16 ++++++++++++++- .../explore-artist-details.ts | 20 +++++++++++++++---- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/backend/explore/explore.go b/backend/explore/explore.go index bc2e2e4..46a9afd 100644 --- a/backend/explore/explore.go +++ b/backend/explore/explore.go @@ -124,7 +124,21 @@ func (e *Service) SearchLocal(query string) *MBSearchResult { var result MBSearchResult mergeIndexHits(&result, indexHits) - filterAndCap(&result) + + // Cap counts but skip the minBlendedScore filter — index hits + // use scalePopularity scores that shouldn't be compared to + // blended MB+LB scores. + if len(result.Artists) > maxResults { + result.Artists = result.Artists[:maxResults] + } + + if len(result.ReleaseGroups) > maxResults { + result.ReleaseGroups = result.ReleaseGroups[:maxResults] + } + + if len(result.Recordings) > maxResults { + result.Recordings = result.Recordings[:maxResults] + } return &result } diff --git a/frontend/src/components/explore-artist-details/explore-artist-details.ts b/frontend/src/components/explore-artist-details/explore-artist-details.ts index b92d677..289de25 100644 --- a/frontend/src/components/explore-artist-details/explore-artist-details.ts +++ b/frontend/src/components/explore-artist-details/explore-artist-details.ts @@ -1025,9 +1025,11 @@ export class ExploreArtistDetails extends LitElement { private renderTopSection() { const hasTracks = !this.loadingTracks && this.topTracks.length > 0; const hasReleases = !this.loadingTopReleases && this.topReleaseGroups.length > 0; - const isLoading = this.loadingTracks || this.loadingTopReleases; + const tracksLoading = this.loadingTracks; + const releasesLoading = this.loadingTopReleases; - if (isLoading) { + // Both still loading — show single loading state. + if (tracksLoading && releasesLoading) { return html`

Popular

@@ -1036,7 +1038,10 @@ export class ExploreArtistDetails extends LitElement { `; } - if (!hasTracks && !hasReleases) return nothing; + // Both done, neither has data. + if (!tracksLoading && !releasesLoading && !hasTracks && !hasReleases) { + return nothing; + } const expanded = this.topSectionExpanded; const trackLimit = expanded ? 10 : 5; @@ -1098,7 +1103,14 @@ export class ExploreArtistDetails extends LitElement { ` - : nothing} + : releasesLoading + ? html` +
+

Top Releases

+
Loading\u2026
+
+ ` + : nothing} ${canExpand ? html`