[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.

Make tracklist dragline stable during scroll

Kasper (Sep 18, 2024, 11:51 AM +0200) 1f521a5b 250d4599

+17 -14
+1 -1
CHANGELOG.md
··· 17 17 - Fix dragging tracks to up next/autoplay queue boundary 18 18 - Fix button edge not clickable due to zoom 19 19 - Fix rearranging queue items not working when dragging the cover artwork 20 - - Make queue dragline stable during scroll 20 + - Make draglines stable during scroll 21 21 22 22 ## 0.18.0 - 2024 Jun 7 23 23 - Add arm64 support for macOS and Windows
+1
ferrum-addon/addon.d.ts
··· 187 187 export declare function update_track_info(trackId: string, info: TrackMd): void 188 188 export interface ViewOptions { 189 189 shownPlaylistFolders: Array<string> 190 + /** Empty is treated as default */ 190 191 columns: Array<string> 191 192 } 192 193 export declare function shown_playlist_folders(): Array<string>
+1 -1
src/components/Queue.svelte
··· 366 366 {/if} 367 367 <div 368 368 bind:this={drag_line} 369 - class="pointer-events-none absolute z-10 h-[2px] w-full bg-[var(--drag-line-color)]" 369 + class="drag-line pointer-events-none absolute z-10 h-[2px] w-full bg-[var(--drag-line-color)]" 370 370 class:hidden={drag_to_index === null} 371 371 /> 372 372 </div>
+14 -12
src/components/TrackList.svelte
··· 159 159 } 160 160 if ( 161 161 dragged.tracks?.playlist_indexes && 162 - e.currentTarget && 162 + e.currentTarget instanceof HTMLElement && 163 163 e.dataTransfer?.types[0] === 'ferrum.tracks' 164 164 ) { 165 165 e.preventDefault() 166 - const rect = (e.currentTarget as HTMLElement).getBoundingClientRect() 166 + const rect = e.currentTarget.getBoundingClientRect() 167 + const container_rect = scroll_container.getBoundingClientRect() 167 168 if (e.pageY < rect.bottom - rect.height / 2) { 168 - drag_line.style.top = rect.top - 1 + 'px' 169 + const top = rect.top - container_rect.top + scroll_container.scrollTop - 1 170 + drag_line.style.top = Math.max(0, top) + 'px' 169 171 drag_to_index = index 170 172 } else { 171 - drag_line.style.top = rect.bottom - 1 + 'px' 173 + const top = rect.bottom - container_rect.top + scroll_container.scrollTop - 1 174 + const max_top = scroll_container.scrollHeight - 2 175 + drag_line.style.top = Math.min(max_top, top) + 'px' 172 176 drag_to_index = index + 1 173 177 } 174 178 } ··· 385 389 <span>{column.name}</span> 386 390 </div> 387 391 {/each} 388 - <div class="col-drag-line" class:show={col_drag_to_index !== null} bind:this={col_drag_line} /> 392 + <div 393 + class="col-drag-line" 394 + class:hidden={col_drag_to_index === null} 395 + bind:this={col_drag_line} 396 + /> 389 397 </div> 390 398 <!-- svelte-ignore a11y-no-noninteractive-tabindex --> 391 399 <!-- svelte-ignore a11y-no-static-element-interactions --> ··· 456 464 </div> 457 465 {/if} 458 466 </VirtualListBlock> 467 + <div class="drag-line" class:hidden={drag_to_index === null} bind:this={drag_line} /> 459 468 </div> 460 - <div class="drag-line" class:show={drag_to_index !== null} bind:this={drag_line} /> 461 469 </div> 462 470 463 471 <style lang="sass"> ··· 550 558 height: 2px 551 559 background-color: var(--drag-line-color) 552 560 pointer-events: none 553 - display: none 554 - &.show 555 - display: block 556 561 .col-drag-line 557 562 position: absolute 558 563 width: 2px 559 564 height: 100vh 560 565 background-color: var(--drag-line-color) 561 566 pointer-events: none 562 - display: none 563 567 z-index: 5 564 - &.show 565 - display: block 566 568 </style>