fix(ui): playlist navigation and title font sizes

- Fix clicking another playlist from sidebar while on playlist view
  (was not notifying listeners because view type hadn't changed)
- Use $effect to reload playlist data when playlistId prop changes
- Reduce playlist title from 48px to 24px
- Reduce album title from 26px to 24px
- Max font size is now 24px (same as home greeting)
This commit is contained in:
vicrodh committed 2026-01-11 18:43:37 -06:00
1 parent a9f80a15b0
commit 4d2fdce1aa
3 files changed
+15 -6

No files matched your search

@@ -291,7 +291,7 @@
} }
.album-title { .album-title {
font-size: 26px; font-size: 24px;
font-weight: 700; font-weight: 700;
color: var(--text-primary); color: var(--text-primary);
margin-bottom: 4px; margin-bottom: 4px;
@@ -4,7 +4,6 @@
import { writeText } from '@tauri-apps/plugin-clipboard-manager'; import { writeText } from '@tauri-apps/plugin-clipboard-manager';
import { invoke } from '@tauri-apps/api/core'; import { invoke } from '@tauri-apps/api/core';
import { open } from '@tauri-apps/plugin-dialog'; import { open } from '@tauri-apps/plugin-dialog';
import { onMount } from 'svelte';
import TrackRow from '../TrackRow.svelte'; import TrackRow from '../TrackRow.svelte';
import { type DownloadStatus } from '$lib/stores/downloadState'; import { type DownloadStatus } from '$lib/stores/downloadState';
@@ -137,7 +136,10 @@
let customArtworkPath = $state<string | null>(null); let customArtworkPath = $state<string | null>(null);
let showSortMenu = $state(false); let showSortMenu = $state(false);
onMount(() => { // Reload playlist when playlistId changes
$effect(() => {
// Access playlistId to create dependency
const id = playlistId;
loadPlaylist(); loadPlaylist();
loadSettings(); loadSettings();
loadLocalTracks(); loadLocalTracks();
@@ -841,11 +843,11 @@
} }
.playlist-title { .playlist-title {
font-size: 48px; font-size: 24px;
font-weight: 700; font-weight: 700;
color: var(--text-primary); color: var(--text-primary);
margin: 0 0 8px 0; margin: 0 0 8px 0;
line-height: 1.1; line-height: 1.2;
} }
.playlist-description { .playlist-description {
+8 -1
View File
@@ -100,8 +100,15 @@ export function canGoForward(): boolean {
* Navigate to playlist detail view * Navigate to playlist detail view
*/ */
export function selectPlaylist(playlistId: number): void { export function selectPlaylist(playlistId: number): void {
const previousId = selectedPlaylistId;
selectedPlaylistId = playlistId; selectedPlaylistId = playlistId;
navigateTo('playlist');
// If already on playlist view, still notify so the component reloads with new ID
if (activeView === 'playlist' && previousId !== playlistId) {
notifyListeners();
} else {
navigateTo('playlist');
}
} }
/** /**