fix: Folder Library previews on hover via song_preview (parity with grid/list)#1026
fix: Folder Library previews on hover via song_preview (parity with grid/list)#1026Elit3d wants to merge 7 commits into
Conversation
📝 WalkthroughWalkthroughFolder Library cards and rows now emit standard ChangesFolder Library hover preview
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Implement optional audio preview when hovering over songs in the Folders view. Features include: - Toolbar toggle button (off by default) to enable/disable hover preview - ~0.5s dwell delay to avoid accidental audio playback while scrolling - Dedicated <audio> element (never touches main player) - Equalizer indicator animation overlay on song art while playing - Per-surface localStorage persistence - Automatic fallback through preview.ogg → stems/full.ogg → stems/audio.mp3 Bump Folder Library from 1.8.0 to 1.9.0. Remove 'auto play on hover' from roadmap as it's now implemented. Signed-off-by: Kyle <kyle.j.t@live.co.uk>
Move audio member selection logic from frontend to backend. The frontend was probing multiple candidate audio files with error/retry logic, often resulting in 404s. Now the backend resolves the best available audio file (preview.ogg, stems/full.ogg, or any stem) during metadata extraction and includes it in song metadata as `audio_member`. The frontend makes a single, guaranteed request instead of multiple probes. Simplifies the preview flow and improves reliability. Signed-off-by: Kyle <kyle.j.t@live.co.uk>
Make the hover-preview feature opt-out instead of opt-in (defaults to on). Increase dwell delay from 500ms to 800ms to prevent accidental triggers while clicking/dragging. Replace 4-bar equalizer indicator with 9-bar waveform with staggered animation and fade-in entrance. Add guards to prevent preview during drag operations. Update button styling and all user-facing docs to reflect new defaults. Signed-off-by: Kyle <kyle.j.t@live.co.uk>
Remove audio member resolution from folder_library and delegate hover-preview audio to the canonical song_preview plugin endpoint. This separates concerns: folder_library now only builds the preview URL with the filename, while song_preview handles manifest resolution (preview: key, stem fallback) and Range support. Changes: - Remove _audio_member() resolver and audio_member field from pack metadata - Update _previewUrl() to point to /api/plugins/song_preview/audio?file=<filename> - Add _previewMissing cache to avoid re-requesting packs with no preview - Add HEAD probe to check preview availability before playing - Add test coverage for _previewUrl with special character encoding Signed-off-by: Kyle <kyle.j.t@live.co.uk>
Expose a has_preview boolean from pack manifests and use it to gate hover previews. backend: plugins/folder_library/routes.py now (optionally) reads sloppak.load_manifest to set m['has_preview'] (guarded so plugin still loads without sloppak). frontend: plugins/folder_library/screen.js skips preview requests when song.has_preview is false and removes the HEAD-probe + previewMissing cache. docs: plugins/folder_library/CLAUDE.md updated to document has_preview and the preview behavior. This prevents unnecessary HEAD/audio 404s and console noise. Signed-off-by: Kyle <kyle.j.t@live.co.uk>
Remove the developer note about manually bumping plugin.json version when changing screen.js Signed-off-by: Kyle <kyle.j.t@live.co.uk>
Folder Library now uses the standard data-fn/data-v3-play markup so the song_preview plugin handles hover-previews, the same way it does for grid and list views. Removes ~200 lines of preview-specific code: dedicated audio element, indicator rendering, toolbar toggle, and backend manifest checking. The preview experience is now unified across all library surfaces. Signed-off-by: Kyle <kyle.j.t@live.co.uk>
b467261 to
9157e2e
Compare
What
The Folders view didn't preview songs on hover. This brings it to parity with the
grid and list views.
Rather than add preview code to Folder Library, it wires the folder cards/rows
into the existing
song_previewplugin — the same one that already handlesthe grid and list. song_preview looks for
#v3-songs [data-fn]elementscontaining a
[data-v3-play]descendant; the folder tree renders inside#v3-songs, so once the cards carry that markup its observer picks them up withzero changes to song_preview.
Changes:
_songCard/_songRownow emit the standard preview markup —data-fn(rawfilename; was
data-filename, which song_preview never matched since it keys ondataset.fn) plus a[data-v3-play]surface on the art wrap (cards) / thumb(rows).
<audio>, waveformindicator, toolbar toggle, and the backend
has_previewmanifest read) that anearlier iteration of this branch had added — song_preview owns preview now.
plugins/folder_library/tests/song_preview_markup.test.jspins thecontract (both cards and rows carry
data-fn+ adata-v3-playsurface) so afuture refactor can't silently drop preview coverage.
Credit to @topkoa for pointing out song_preview already exists as a plugin.
feedpak surface
Checklist
CHANGELOG.md[Unreleased]updated (user-visible changes)git commit -s) — not yet; rungit rebase --signoff mainSummary by CodeRabbit