Files
qbz/src/lib/components/NavigationItem.svelte
T
vicrodh cdc06d8759 fix: multiple UX improvements and bug fixes
Playlist & Favorites:
- Fix playlist loading error (missing field `id` in JSON parsing)
- Add serde defaults for Track and PlaylistOwner optional fields
- Fix track favorites toggle to actually call backend API
- Add "Add to playlist" button on track rows in album view

Sidebar UI improvements:
- Increase sidebar width to 280px
- Reduce text size and margins throughout
- Normalize all icons to 14px (matching + and refresh buttons)
- Add text overflow with ellipsis and tooltip for playlist names

User card:
- Make user card more compact (smaller avatar, fonts, icons)
- Add collapsible toggle - when collapsed shows mini QBZ logo + username

Queue & Playback:
- Fix next_track spam when queue has only one song (queueEnded flag)

Other fixes:
- Fix TrackRow prop types (remove invalid hires, bitDepth, samplingRate props)
- Fix FavoritesView and PlaylistDetailView component prop types
- Add diagnostic logging to credential persistence
2026-01-09 14:55:53 -06:00

71 lines
1.2 KiB
Svelte

<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
icon: Snippet;
label: string;
active?: boolean;
onclick?: () => void;
}
let { icon, label, active = false, onclick }: Props = $props();
</script>
<button
{onclick}
class="nav-item"
class:active
title={label}
>
<div class="icon-container">
{@render icon()}
</div>
<span class="label">{label}</span>
</button>
<style>
.nav-item {
width: 100%;
height: 32px;
display: flex;
align-items: center;
gap: 8px;
padding: 0 8px;
border-radius: 6px;
border: none;
background: transparent;
color: var(--text-muted);
cursor: pointer;
transition: all 150ms ease;
text-align: left;
}
.nav-item:hover {
background-color: var(--bg-hover);
}
.nav-item.active {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.icon-container {
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.label {
font-size: 13px;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
min-width: 0;
}
</style>