[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Add Clear button to Up Next

Kasper (Sep 18, 2024, 12:07 PM +0200) f13be068 a92805bd

+34 -3
+1
CHANGELOG.md
··· 5 5 - Drop support for macOS 10.13 and 10.14 6 6 - Preserve "Up next" when starting a new playback 7 7 - Add playback history to queue panel 8 + - Add "Clear" button to "Up next" in queue panel 8 9 - Redesign queue panel 9 10 - Add queue panel slide-out transition 10 11 - Add `Ctrl+Tab` and `Ctrl+Shift+Tab` to select next/previous playlist
+26 -3
src/components/Queue.svelte
··· 1 1 <script lang="ts"> 2 2 import { 3 3 append_to_user_queue, 4 + clear_user_queue, 4 5 get_by_queue_index, 5 6 get_queue_length, 6 7 insert_ids, ··· 19 20 import * as dragGhost from './DragGhost.svelte' 20 21 import { ipc_listen, ipc_renderer } from '@/lib/window' 21 22 import { assert_unreachable, check_shortcut } from '@/lib/helpers' 22 - import { fly } from 'svelte/transition' 23 + import { fly, scale } from 'svelte/transition' 23 24 import VirtualListBlock, { scroll_container_keydown } from './VirtualListBlock.svelte' 24 25 import { open_track_info } from './TrackInfo.svelte' 26 + import Button from './Button.svelte' 25 27 26 28 let object_urls: string[] = [] 27 29 ··· 290 292 {#if $queue.user_queue.length || queue.getQueueLength() === 0} 291 293 <div class="relative"> 292 294 <h4 293 - class="sticky top-0 z-1 flex h-[40px] items-center bg-black/50 pl-7 font-semibold backdrop-blur-md" 295 + class="sticky top-0 z-1 flex h-[40px] items-center justify-between bg-black/50 px-7 font-semibold backdrop-blur-md" 294 296 > 295 297 Up Next 298 + {#if $queue.user_queue.length > 0} 299 + <button 300 + type="button" 301 + aria-label="Clear 'Up Next'" 302 + tabindex="-1" 303 + on:mousedown|preventDefault 304 + on:click={clear_user_queue} 305 + > 306 + <svg 307 + xmlns="http://www.w3.org/2000/svg" 308 + class="parent-active-zoom" 309 + height="24px" 310 + viewBox="0 0 24 24" 311 + width="24px" 312 + fill="#e8eaed" 313 + ><path d="M0 0h24v24H0z" fill="none" /><path 314 + d="M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z" 315 + /></svg 316 + > 317 + </button> 318 + {/if} 296 319 </h4> 297 320 <VirtualListBlock 298 321 bind:this={up_next_list} ··· 329 352 {#if $queue.auto_queue.length} 330 353 <div class="relative"> 331 354 <h4 332 - class="sticky top-0 z-1 flex h-[40px] items-center bg-black/50 pl-7 font-semibold backdrop-blur-md" 355 + class="sticky top-0 z-1 flex h-[40px] items-center bg-black/50 px-7 font-semibold backdrop-blur-md" 333 356 > 334 357 Autoplay 335 358 </h4>
+7
src/lib/queue.ts
··· 155 155 }) 156 156 } 157 157 158 + export function clear_user_queue() { 159 + queue.update((q) => { 160 + q.user_queue = [] 161 + return q 162 + }) 163 + } 164 + 158 165 export function move_indexes(indexes: number[], new_index: number, to_user_queue: boolean) { 159 166 const items: QueueItem[] = [] 160 167 queue.update((q) => {