Skip to content

fix: Folder Library previews on hover via song_preview (parity with grid/list) - #1022

Closed
Elit3d wants to merge 7 commits into
mainfrom
feat/folder-library-autoplay-hover
Closed

Elit3d wants to merge 7 commits into
mainfrom
feat/folder-library-autoplay-hover

Conversation

@Elit3d

@Elit3d Elit3d commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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_preview plugin — the same one that already handles
the grid and list. song_preview looks for #v3-songs [data-fn] elements
containing a [data-v3-play] descendant; the folder tree renders inside
#v3-songs, so once the cards carry that markup its observer picks them up with
zero changes to song_preview.

Changes:

  • _songCard / _songRow now emit the standard preview markup — data-fn (raw
    filename; was data-filename, which song_preview never matched since it keys on
    dataset.fn) plus a [data-v3-play] surface on the art wrap (cards) / thumb
    (rows).
  • Removed the custom hover-preview implementation (dedicated <audio>, waveform
    indicator, toolbar toggle, and the backend has_preview manifest read) that an
    earlier iteration of this branch had added — song_preview owns preview now.

Credit to @topkoa for pointing out song_preview already exists as a plugin.

feedpak surface

  • This PR does not change how the app reads/writes feedpaks (manifest keys, pack files, folder layout)

Checklist

  • CHANGELOG.md [Unreleased] updated (user-visible changes)
  • Tests added/updated for new behaviour
  • Commits are DCO signed off (git commit -s) — not yet; run git rebase --signoff main

Elit3d added 5 commits July 20, 2026 19:48
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.
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.
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.
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
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.
@Elit3d
Elit3d requested a review from byrongamatos July 21, 2026 02:13
@Elit3d Elit3d self-assigned this Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Folder Library cards and rows now use the standard data-fn and data-v3-play markup consumed by the Song Preview plugin. Test helpers and markup tests were added, documentation and changelog entries were updated, and the plugin version was incremented.

Changes

Folder Library preview integration

Layer / File(s) Summary
Preview markup contract
plugins/folder_library/screen.js, plugins/folder_library/tests/song_preview_markup.test.js
Song cards and rows expose raw filenames and preview surfaces; VM-based tests validate both markup shapes and minimal song inputs.
Preview documentation and release metadata
plugins/folder_library/CLAUDE.md, plugins/folder_library/README.md, CHANGELOG.md, plugins/folder_library/plugin.json
Documentation describes Song Preview ownership and markup requirements, roadmap entries are updated, and the plugin version changes to 1.9.0.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: byrongamatos

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the Folder Library hover-preview change and mentions the song_preview integration.
Description check ✅ Passed The description follows the template sections and covers the change, feedpak impact, changelog, tests, and DCO status.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/folder-library-autoplay-hover

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Remove the developer note about manually bumping plugin.json version when changing screen.js
@topkoa

topkoa commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

I think we already have this exact functionality in a plugin already https://github.com/got-feedBack/feedBack-plugin-song-preview

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.
@Elit3d Elit3d changed the title feat(folder_library): preview song on hover fix: Folder Library previews on hover via song_preview (parity with grid/list) Jul 21, 2026
@Elit3d

Elit3d commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

I think we already have this exact functionality in a plugin already https://github.com/got-feedBack/feedBack-plugin-song-preview

I'd been building a custom hover-preview into Folder Library, but you're right that it already exists as a plugin. Ripping all of that out and instead just giving the folder cards/rows the standard data-fn + data-v3-play markup the grid and list views use. song_preview's observer already watches #v3-songs (and the folder tree renders inside it), so it will preview folder cards on hover with zero changes to song_preview.

Changes are ready for review

@Elit3d Elit3d closed this Jul 21, 2026
@Elit3d
Elit3d deleted the feat/folder-library-autoplay-hover branch July 21, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants