-
+
{artist}
·
{album}
diff --git a/src/lib/components/FocusMode.svelte b/src/lib/components/FocusMode.svelte
index d25ea069a..1d7deda8f 100644
--- a/src/lib/components/FocusMode.svelte
+++ b/src/lib/components/FocusMode.svelte
@@ -22,6 +22,7 @@
currentTime: number;
duration: number;
onSeek: (time: number) => void;
+ onContextClick?: () => void;
// Lyrics props
lyricsLines?: LyricsLine[];
lyricsActiveIndex?: number;
@@ -44,6 +45,7 @@
currentTime,
duration,
onSeek,
+ onContextClick,
lyricsLines = [],
lyricsActiveIndex = -1,
lyricsActiveProgress = 0,
@@ -187,7 +189,7 @@
diff --git a/src/lib/components/StackIcon.svelte b/src/lib/components/StackIcon.svelte
index 35a7c9ed3..be4c32bc4 100644
--- a/src/lib/components/StackIcon.svelte
+++ b/src/lib/components/StackIcon.svelte
@@ -6,14 +6,23 @@
interface Props {
size?: number;
class?: string;
+ onClick?: () => void;
}
- let { size = 16, class: className = '' }: Props = $props();
+ let { size = 16, class: className = '', onClick }: Props = $props();
let context = $state(getCurrentContext());
let displayInfo = $state(context ? getContextDisplayInfo() : null);
let showIcon = $state(getCachedPreferences().show_context_icon);
+ function handleClick(e: MouseEvent) {
+ e.stopPropagation();
+ if (onClick) {
+ console.log('[StackIcon] Clicked - navigating to source');
+ onClick();
+ }
+ }
+
// Subscribe to context changes
$effect(() => {
const unsubscribe = subscribe(() => {
@@ -43,9 +52,15 @@
{#if context && displayInfo && showIcon}
-
+
+
→
+
{/if}
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 908df7148..68d522eea 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -29,7 +29,8 @@
import {
initPlaybackContextStore,
setPlaybackContext,
- clearPlaybackContext
+ clearPlaybackContext,
+ getCurrentContext
} from '$lib/stores/playbackContextStore';
import {
initPlaybackPreferences,
@@ -371,6 +372,66 @@
}
}
+ /**
+ * Navigate to the source of current playback context
+ */
+ async function handleContextNavigation() {
+ const context = getCurrentContext();
+ if (!context) {
+ console.log('[ContextNav] No context available');
+ return;
+ }
+
+ console.log('[ContextNav] Navigating to:', context);
+
+ try {
+ switch (context.context_type) {
+ case 'album':
+ // Navigate to album page
+ await handleAlbumClick(context.context_id);
+ break;
+
+ case 'playlist':
+ // Navigate to playlist page
+ const playlistId = parseInt(context.context_id);
+ if (!isNaN(playlistId)) {
+ selectedPlaylistId = playlistId;
+ navigateTo('playlist');
+ }
+ break;
+
+ case 'artist_top':
+ // Navigate to artist page
+ const artistId = parseInt(context.context_id);
+ if (!isNaN(artistId)) {
+ await handleArtistClick(artistId);
+ }
+ break;
+
+ case 'favorites':
+ // Navigate to favorites page
+ navigateTo('favorites');
+ break;
+
+ case 'home_list':
+ // Navigate to home page
+ navigateTo('home');
+ break;
+
+ case 'search':
+ // Navigate to search (could restore query if needed)
+ navigateTo('search');
+ break;
+
+ default:
+ console.warn('[ContextNav] Unknown context type:', context.context_type);
+ }
+ } catch (err) {
+ console.error('[ContextNav] Navigation failed:', err);
+ showToast('Failed to navigate to source', 'error');
+ }
+ }
+
interface ArtistAlbumsResponse {
items: QobuzAlbum[];
total: number;
@@ -2201,6 +2262,7 @@
handleAlbumClick(currentTrack.albumId);
}
}}
+ onContextClick={handleContextNavigation}
/>
{:else}
{/if}