fix(ui): make every track, album and artist name navigate somewhere
A name linked only when the entity carried an MBID — and for tracks, only when it carried two. That rule is invisible, so a track list read as randomly broken: some titles were clickable, most were not, and nothing on screen said why. A name now always goes somewhere. Tagged entities open their MusicBrainz page as before; untagged ones open the *library* page for the same album or artist, which both detail views already support via a local id — they just had no caller passing one. An untagged track highlights by title, since a recording MBID is exactly what it lacks. Links now fire on a genuine single click only. Every list these appear in also plays a row on double-click, and the title is the widest thing in the row, so the first click of that gesture lands on the link: navigating immediately meant double-clicking a track title opened a page instead of playing it, which the e2e playback suite caught. The navigation is held for one double-click interval and dropped if the second click arrives, while the dblclick itself is left to bubble to the row — so rows do not need to know links exist.
This commit is contained in:
+11
-1
@@ -209,7 +209,14 @@ document.addEventListener('navigate', (e: Event) => {
|
||||
break;
|
||||
}
|
||||
case 'explore-album-details': {
|
||||
const { releaseGroupMBID, albumName, artistName, highlightTrackMBID, localAlbumId } = detail;
|
||||
const {
|
||||
releaseGroupMBID,
|
||||
albumName,
|
||||
artistName,
|
||||
highlightTrackMBID,
|
||||
highlightTrackTitle,
|
||||
localAlbumId,
|
||||
} = detail;
|
||||
const el = document.createElement('explore-album-details');
|
||||
|
||||
if (releaseGroupMBID) el.setAttribute('release-group-mbid', releaseGroupMBID);
|
||||
@@ -218,6 +225,9 @@ document.addEventListener('navigate', (e: Event) => {
|
||||
if (highlightTrackMBID) {
|
||||
el.setAttribute('highlight-track-mbid', highlightTrackMBID);
|
||||
}
|
||||
if (highlightTrackTitle) {
|
||||
el.setAttribute('highlight-track-title', highlightTrackTitle);
|
||||
}
|
||||
if (localAlbumId) el.setAttribute('local-album-id', String(localAlbumId));
|
||||
mainContent.appendChild(el);
|
||||
currentDetailEl = el;
|
||||
|
||||
Reference in New Issue
Block a user