feedBack/static/v3
Matthew Harris Glover fadaa154e9
feat(library): sort and badge by personal difficulty rating (#810)
* feat(library): sort and badge by personal difficulty rating

Adds sort=difficulty/difficulty-desc to the library API (correlated
subquery over song_user_meta.user_difficulty, unrated songs pushed to
the bottom either direction, same pattern as the existing mastery
sort) and surfaces the rating as a badge on library cards in both the
v2 grid/tree views and the v3 grid. The rating itself already existed
(song_user_meta) — this just makes it sortable and visible, so it's
no longer only readable in the per-song edit drawer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(library): escape difficulty badge, wire tree view, add changelog+tests

- Wrap song.user_difficulty in esc() at both badge call sites
  (static/app.js ~2082 and ~2283) for XSS-consistency with the
  sibling tuning badge, which already uses esc().
- server.py: query_artists (the classic tree view's data source, used
  by /api/library/artists) never batch-attached user_difficulty the
  way query_page does for the grid, so the tree-view difficulty badge
  added in 75673c3 was unreachable dead code (song.user_difficulty was
  always undefined there). Now attaches it via the existing
  user_meta_map() helper, same pattern as query_page.
- Add an [Unreleased] CHANGELOG.md entry for the difficulty sort +
  badge feature, matching the repo's existing entry format.
- Add tests/test_library_filters.py::test_difficulty_sort_pushes_unrated_to_bottom
  asserting unrated songs sort to the bottom in both sort=difficulty
  and sort=difficulty-desc directions, and
  ::test_tree_view_songs_carry_user_difficulty covering the
  query_artists fix above.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(library): chunk user_meta_map + rebuild stale tailwind css

Address review-bot findings on the difficulty sort/badge:
- user_meta_map now chunks filenames into 400-row batches (like
  overrides_map) before the IN (...) query. query_artists (tree view)
  passes every song across up to 50 artists, which could push the
  placeholder count past SQLite's older variable limit; query_page's
  small pages are unaffected. (CodeRabbit: Stability & Availability)
- Rebuild static/tailwind.min.css: the ◆N difficulty badge introduced
  bg-blue-900/30 + text-blue-300, which were never compiled into the
  committed stylesheet, failing the tailwind-fresh CI gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: byrongamatos <xasiklas@gmail.com>
2026-07-07 23:57:20 +02:00
..
avatars Clean release snapshot 2026-06-16 18:47:13 +02:00
brand feat(v3): use PNG logo in sidebar nav instead of the text wordmark (#734) 2026-07-03 11:39:27 +02:00
pedals Clean release snapshot 2026-06-16 18:47:13 +02:00
audio-routing.js feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
badges.js feat(v3): choose handedness in the instrument selector + onboarding (give lefties a break) (#793) 2026-07-05 23:50:30 +02:00
brand.js Clean release snapshot 2026-06-16 18:47:13 +02:00
card-actions-core.js v3 library: song Details drawer + bulk edit — P2 (#703) 2026-07-02 13:29:05 +02:00
dashboard.js feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
feedbarcade.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
image-picker.js feat(v3 library): searchable Cover Art Archive picker in Change-cover (#783) 2026-07-05 23:36:49 +02:00
index.html fix(settings): don't let a stale DLC path block saving the Demucs server address (#795) 2026-07-06 20:35:51 +02:00
interface-size-nudge.js feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
interface-size-ui.js feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
lessons.js feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
live-guitar-tone-source.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
live-performance-hud.js fix(v3): reset live performance HUD on backward seek / restart (#607) 2026-06-27 00:47:43 +02:00
manifest.json Clean release snapshot 2026-06-16 18:47:13 +02:00
match-review.js feat(v3 library): searchable Cover Art Archive picker in Change-cover (#783) 2026-07-05 23:36:49 +02:00
notifications.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
onboarding-tour.js feat(v3): choose handedness in the instrument selector + onboarding (give lefties a break) (#793) 2026-07-05 23:50:30 +02:00
overlay-active.png Clean release snapshot 2026-06-16 18:47:13 +02:00
overlay-inactive.png Clean release snapshot 2026-06-16 18:47:13 +02:00
pedal-cables.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
pedal-default.svg Clean release snapshot 2026-06-16 18:47:13 +02:00
pedal-frame.svg Clean release snapshot 2026-06-16 18:47:13 +02:00
player-chrome.js review: address PR #694 findings 2026-07-02 00:35:24 +02:00
playlists.js fix(v3): keep shuffle toggle size stable across states 2026-07-03 14:10:16 +02:00
plugins-page.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
profile.js feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
progress.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
progression-core.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
scoreboard-pref.js fix(highway): user-selectable scoreboard to stop duplicate HUDs 2026-06-19 20:56:38 +02:00
settings.js settings: add host instrument profiles (#753) 2026-07-05 00:16:42 +02:00
shell.js feat(v3): use PNG logo in sidebar nav instead of the text wordmark (#734) 2026-07-03 11:39:27 +02:00
shop.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
songs.js feat(library): sort and badge by personal difficulty rating (#810) 2026-07-07 23:57:20 +02:00
stats-recorder.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
theme-core.js feat(v3): host theme read surface — window.feedBack.theme + always-present --fbv-* tokens (#646) 2026-07-02 13:57:58 +02:00
tuner-core.js Clean release snapshot 2026-06-16 18:47:13 +02:00
v3.css feat(a11y): app-wide "Interface size" setting (Accessibility) (#664) 2026-07-02 14:00:30 +02:00
venue-instrument-pov.js Clean release snapshot 2026-06-16 18:47:13 +02:00
venue-mood-fx.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
venue-scene-3d.js rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
venue-viz.js Clean release snapshot 2026-06-16 18:47:13 +02:00