Repository navigation
feat: Add mood-based ambient playlist mini-player - #1477
Open
arnavgoel17 wants to merge 1 commit into
Open
arnavgoel17 wants to merge 1 commit into
arnavgoel17 wants to merge 1 commit into
Conversation
…#1404) - Backend: new ambient_music mapper maps parsed mood queries to curated open Spotify playlists and includes an ambient_music object in the /api/v1/mood-search response. - Frontend: glassmorphic floating music panel on the discovery page that appears after a mood search, updates its Spotify embed src per mood, and coexists with the Ambient Sanctuary SFX panel (overlay behavior). - Tests: unit tests for the mapper plus an endpoint check asserting the ambient_music payload shape. Fixes devanshi14malhotra#1404
❌ Deploy Preview for bibliodrift-dm failed. Why did it fail? →
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements AI mood-based music pairing for book discovery:
backend/mood_analysis/ambient_music.py): a lightweight mapper that matches the parsed mood query (moods fromMoodQueryParser+ raw query keywords) to curated open Spotify reading playlists (Dark Academia Jazz, Cozy Reading Cafe, Whimsical & Light, Classical Reading, and a Lo-Fi default). No extra LLM call or external API — pure keyword matching, so it adds no latency to/api/v1/mood-search./api/v1/mood-searchnow returns anambient_musicobject ({genre, spotify_embed_url}) in both the enhanced-parser path and the fallback path.frontend/js/ambient-music.js+app.html+style.css): a minimal glassmorphic floating music panel on the discovery page. Hidden by default (respects Zero UI Noise), appears after the first mood search, and dynamically swaps its Spotify embedsrcper mood. It is an independent panel that overlays alongside the existing Ambient Sanctuary SFX — SFX and music can be used separately or together.chat.js): Elara chat mood searches also dispatch the ambient-music payload.Validation
tests/test_ambient_music.py: 5 tests covering mood-to-playlist mapping (cozy/dark/fallback) plus an endpoint test asserting theambient_musicpayload in/api/v1/mood-search. All pass.mainare unrelated (test_mood_improvements.pynltk-stub collection error, onetest_category_cache.pyfailure,contributing.cssunclosed block breaking vite build) — none are touched by this PR.style.cssparses cleanly with postcss.spotify-playlists.html, keeping the app lightweight with no local audio assets.Fixes #1404