feat(web): align the web UI with the design prototype
- Ambient background in the app shell: three drifting blurred blobs,
the third one tinted with the current track's cover; can be turned off
in settings and stays still with reduced motion.
- Island player variant (floating glass panel) next to the bar, chosen
in settings; player source line ("Album · …", "My Wave"), reactions
around the transport controls, queue drawer.
- Sidebar: like / dislike counters, pending uploads badge on Queue,
admin Settings page holding the upload queue limits.
- Collection: header tile with kicker, underline tabs, time / number
lead column with an equalizer for the current track, album column,
dimmed dislikes with undo, Play all / Shuffle pills.
- Album: cover-tinted header and Play / Shuffle; artist: artist wave,
Play and popular tracks (new GET /artists/{id}/top-tracks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3afed02f23
commit
1c4e209e86
29 files changed
+1381
-339
No files matched your search
@@ -132,6 +132,15 @@ func (st *Store) TracksByIDs(ctx context.Context, ids []uuid.UUID) ([]TrackRow,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ArtistTopTracks — треки исполнителя (основной или приглашённый), самые слушаемые всеми пользователями первыми.
|
||||
func (st *Store) ArtistTopTracks(ctx context.Context, artistID uuid.UUID, limit int) ([]TrackRow, error) {
|
||||
return st.queryTracks(ctx, `
|
||||
WHERE t.id IN (SELECT track_id FROM track_artists WHERE artist_id = $1)
|
||||
ORDER BY COALESCE((SELECT sum(s.play_count) FROM user_track_stats s WHERE s.track_id = t.id), 0) DESC,
|
||||
t.created_at DESC
|
||||
LIMIT $2`, artistID, limit)
|
||||
}
|
||||
|
||||
// AlbumTracks — треки альбома по дискам и номерам.
|
||||
func (st *Store) AlbumTracks(ctx context.Context, albumID uuid.UUID) ([]TrackRow, error) {
|
||||
return st.queryTracks(ctx, "WHERE t.album_id = $1 ORDER BY t.disc_no NULLS FIRST, t.track_no NULLS LAST, t.title", albumID)
|
||||
|
||||
@@ -469,6 +469,26 @@ func (h *Handler) GetAlbum(ctx context.Context, req gen.GetAlbumRequestObject) (
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ListArtistTopTracks реализует gen.StrictServerInterface.
|
||||
func (h *Handler) ListArtistTopTracks(ctx context.Context, req gen.ListArtistTopTracksRequestObject) (gen.ListArtistTopTracksResponseObject, error) {
|
||||
if _, err := h.store.Artist(ctx, req.Id); err != nil {
|
||||
return nil, catalogErr(err)
|
||||
}
|
||||
limit := 10
|
||||
if req.Params.Limit != nil {
|
||||
limit = min(max(*req.Params.Limit, 1), 50)
|
||||
}
|
||||
rows, err := h.store.ArtistTopTracks(ctx, req.Id, limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items, err := h.Tracks(ctx, rows)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return gen.ListArtistTopTracks200JSONResponse{Items: items}, nil
|
||||
}
|
||||
|
||||
// GetTrack реализует gen.StrictServerInterface.
|
||||
func (h *Handler) GetTrack(ctx context.Context, req gen.GetTrackRequestObject) (gen.GetTrackResponseObject, error) {
|
||||
t, err := h.store.Track(ctx, req.Id)
|
||||
|
||||
Reference in new issue
Block a user