Implement green/tan theme and add Smart Listening Sessions feature#560
Implement green/tan theme and add Smart Listening Sessions feature#560nomankhan0705 wants to merge 4 commits into
Conversation
Replace the previous blue-centric palette with a green/tan visual theme and centralize colors into CSS variables. Updated static/style.css to redefine color, background, border, status and shadow variables (and added --button-disabled-bg, --focus-ring, sidebar variables). Updated menu.css and various JS files (collection_script.js, script.js, setup.js) to consume the new variables for disabled buttons, message boxes, key buttons, and tooltips. Updated templates (alchemy, dashboard, path, provider_migration, setup, similarity, waveform) to use --color-primary / --color-primary-hover and adjusted charts/gradient colors to match the new palette. These changes unify theming and make it easier to tweak colors across the app.
Introduce a new Smart Listening Sessions feature: add a Flask blueprint (app_smart_sessions.py) and register it in app.py, include a UI template (templates/smart_sessions.html), client JS (static/smart_sessions.js), and navigation entry. Add a tasks/smart_session_builder.py skeleton with validation, capability reporting, preview/export helpers (preview currently returns a Day 1 placeholder and export delegates to voyager_manager). Include design and implementation plan docs (docs/SMART_LISTENING_SESSIONS_PLAN.md) and unit tests for the blueprint and builder (tests/unit/*).
There was a problem hiding this comment.
Code Review
This pull request introduces two major features: "Smart Listening Sessions," a prompt-driven playlist builder, and a "Listening History Timeline" for visualizing listening trends and mood shifts. It includes new Flask blueprints, backend logic for request validation and data enrichment, and interactive frontend components using Chart.js. Additionally, the entire application's UI has been overhauled with a new earthy color palette and consistent use of CSS variables. Review feedback highlights an unused import in the timeline module, opportunities to optimize database queries by removing unused columns, and the need to replace developer-centric warning messages with user-facing text in the session builder.
| from psycopg2.extras import DictCursor | ||
|
|
||
| from app_helper import get_db | ||
| from tz_helper import to_local_str |
| with db.cursor(cursor_factory=DictCursor) as cur: | ||
| placeholders = ','.join(['%s'] * len(item_ids)) | ||
| cur.execute( | ||
| f"SELECT item_id, title, author, album, tempo, energy, mood_vector, key, scale " |
There was a problem hiding this comment.
The columns title, author, and album are selected from the database but are not used in the subsequent loop that builds the response entries. Removing them from the query will improve efficiency.
References
- Identify performance bottlenecks, optimize for efficiency, and avoid unnecessary calculations or data retrieval.
| "playlist_name": playlist_name, | ||
| "tracks": [], | ||
| "warnings": [ | ||
| "Smart Listening Sessions request validation is ready; candidate ranking is scheduled for Day 2 and Day 3." |
This pull request introduces two major new features—Smart Listening Sessions and a Listening History Timeline—along with several improvements to the frontend code for better theme consistency. The new blueprints add endpoints and UI pages to allow users to generate intelligent playlists and view their listening history with mood analysis. Additionally, CSS and JavaScript updates ensure more consistent use of CSS variables for colors, improving theming support across the app.
Major new features:
Smart Listening Sessions:
app_smart_sessions.pyblueprint, providing endpoints for the Smart Listening Sessions UI, capabilities API, session preview, and playlist export, with input validation and error handling.smart_sessions_bpblueprint inapp.pyto enable the new endpoints. [1] [2]Listening History Timeline:
app_timeline.pyblueprint, which fetches top played songs from the media server, enriches them with local mood/energy/tempo data, and provides endpoints for an interactive timeline page and timeline data API.timeline_bpblueprint inapp.pyto enable the new timeline endpoints. [1] [2]Frontend and theming improvements:
CSS/JS color theming:
static/menu.cssto replace hard-coded sidebar and menu colors with CSS variables, improving theme and dark mode support. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]static/collection_script.js,static/script.js, andstatic/setup.jsto use CSS variables for background and text colors, ensuring consistency with the app's theme. [1] [2] [3] [4] [5]