A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Closes #216 - Add keyboard shortcut to select playlist

+93 -44
+2
CHANGELOG.md
··· 4 4 5 5 - **Adds album-covers view** (switch to and from list view with icon in nav bar) 6 6 - Added new background images and replaced two older ones 7 + - Adds a keyboard shortcut `L` to quickly select a playlist 7 8 - Dark mode for the about page 8 9 - Fixes playback issues (eg. clicking same track multiple times) 10 + - Fixes various issues with add-to-playlist overlay 9 11 - Only generated playlists for enabled sources 10 12 - Removes support for Blockstack & Textile 11 13
+5 -2
src/Applications/UI.elm
··· 376 376 AddTracksToPlaylist a -> 377 377 Playlists.addTracksToPlaylist a 378 378 379 + AssistWithAddingTracksToPlaylist a -> 380 + Playlists.assistWithAddingTracksToPlaylist a 381 + 379 382 CreatePlaylist -> 380 383 Playlists.create 381 384 ··· 397 400 RemoveTracksFromPlaylist a b -> 398 401 Playlists.removeTracks a b 399 402 400 - RequestAssistanceForPlaylists a -> 401 - Playlists.requestAssistance a 403 + SelectPlaylist a -> 404 + Playlists.select a 402 405 403 406 SetPlaylistCreationContext a -> 404 407 Playlists.setCreationContext a
+7 -3
src/Applications/UI/Adjunct.elm
··· 8 8 import UI.Audio.State as Audio 9 9 import UI.Authentication.Types as Authentication 10 10 import UI.Interface.State exposing (hideOverlay) 11 + import UI.Playlists.State as Playlists 11 12 import UI.Queue.State as Queue 12 13 import UI.Tracks.State as Tracks 13 14 import UI.Types as UI exposing (..) ··· 32 33 _ -> 33 34 False 34 35 in 35 - if m.focusedOnInput || not authenticated then 36 + if not authenticated || (m.focusedOnInput && Maybe.isNothing model.alfred) then 36 37 case m.pressedKeys of 37 38 [ Keyboard.Escape ] -> 38 39 hideOverlay m ··· 43 44 else if Maybe.isJust model.alfred then 44 45 case m.pressedKeys of 45 46 [ Keyboard.ArrowDown ] -> 46 - Alfred.selectPrevious m 47 + Alfred.selectNext m 47 48 48 49 [ Keyboard.ArrowUp ] -> 49 - Alfred.selectNext m 50 + Alfred.selectPrevious m 50 51 51 52 [ Keyboard.Enter ] -> 52 53 Alfred.runSelectedAction m ··· 70 71 71 72 [ Keyboard.ArrowDown ] -> 72 73 Audio.seek ((m.audioPosition + 10) / m.audioDuration) m 74 + 75 + [ Keyboard.Character "L" ] -> 76 + Playlists.assistWithSelectingPlaylist m 73 77 74 78 [ Keyboard.Character "N" ] -> 75 79 Tracks.scrollToNowPlaying m
+4 -2
src/Applications/UI/Alfred/State.elm
··· 99 99 in 100 100 if String.length lowerSearchTerm > 0 then 101 101 { alfred 102 - | searchTerm = 102 + | focus = 0 103 + , searchTerm = 103 104 Just searchTerm 104 105 , results = 105 106 alfred.index ··· 109 110 110 111 else 111 112 { alfred 112 - | searchTerm = Nothing 113 + | focus = 0 114 + , searchTerm = Nothing 113 115 , results = alfred.index 114 116 }
+10 -12
src/Applications/UI/Alfred/View.elm
··· 69 69 ) 70 70 ] 71 71 [ C.text_sm 72 - , C.max_w_md 72 + , C.max_w_lg 73 73 , C.mt_8 74 74 , C.w_full 75 75 ] ··· 104 104 -- Results 105 105 ----------------------------------------- 106 106 , chunk 107 - [ C.bg_white 108 - , C.rounded 109 - , C.text_sm 107 + [ C.rounded 110 108 , C.leading_none 111 - , C.max_w_md 109 + , C.max_w_lg 110 + , C.mb_32 112 111 , C.mt_8 113 - , C.overflow_hidden 112 + , C.overflow_x_hidden 113 + , C.overflow_y_auto 114 114 , C.shadow_md 115 + , C.text_nearly_sm 115 116 , C.w_full 116 117 117 118 -- Dark mode ··· 128 129 style "background-color" bgColor 129 130 130 131 else 131 - style "background-color" "inherit" 132 + style "" "" 132 133 ] 133 134 [ C.p_4 134 135 , C.relative ··· 142 143 C.text_inherit 143 144 144 145 -- 145 - , if idx == instance.focus then 146 - C.bg_base00 147 - 148 - else if modBy 2 idx == 0 then 149 - C.bg_transparent 146 + , if modBy 2 idx == 0 then 147 + C.bg_white 150 148 151 149 else 152 150 String.joinWithSpace [ C.bg_gray_100, C.dark__bg_base01 ]
+2 -2
src/Applications/UI/Authentication/View.elm
··· 217 217 GetStarted 218 218 (slab 219 219 Html.span 220 - [ style "font-size" "13px" 221 - , style "letter-spacing" "0.25em" 220 + [ style "letter-spacing" "0.25em" 222 221 ] 223 222 [ C.align_middle 224 223 , C.inline_block 225 224 , C.pt_px 225 + , C.text_nearly_sm 226 226 ] 227 227 [ text "SIGN IN" ] 228 228 )
+2 -3
src/Applications/UI/List.elm
··· 44 44 45 45 view : Variant Int msg -> List (Item msg) -> Html msg 46 46 view variant items = 47 - brick 48 - [ style "font-size" "13px" ] 49 - [ C.antialiased, C.font_semibold, C.leading_snug ] 47 + chunk 48 + [ C.antialiased, C.font_semibold, C.leading_snug, C.text_nearly_sm ] 50 49 (List.indexedMap (item variant) items) 51 50 52 51
+39 -7
src/Applications/UI/Playlists/Alfred.elm
··· 1 - module UI.Playlists.Alfred exposing (action, create) 1 + module UI.Playlists.Alfred exposing (create, select) 2 2 3 3 import Alfred exposing (..) 4 + import List.Extra as List 4 5 import Playlists exposing (..) 5 6 import Tracks exposing (IdentifiedTrack) 6 7 import UI.Types as UI 7 8 8 9 9 10 10 - -- 🔱 11 + -- CREATE 11 12 12 13 13 14 create : List IdentifiedTrack -> List Playlist -> Alfred UI.Msg ··· 16 17 playlistNames = 17 18 playlists 18 19 |> List.map .name 19 - |> List.sort 20 + |> List.sortBy String.toLower 20 21 in 21 - { action = action tracks 22 + { action = createAction tracks 22 23 , focus = 0 23 24 , index = playlistNames 24 25 , message = ··· 27 28 28 29 else 29 30 "Choose or create a playlist to add these tracks to." 30 - , results = List.sort playlistNames 31 + , results = playlistNames 31 32 , searchTerm = Nothing 32 33 } 33 34 34 35 35 - action : List IdentifiedTrack -> { result : Maybe String, searchTerm : Maybe String } -> List UI.Msg 36 - action tracks maybe = 36 + createAction : List IdentifiedTrack -> { result : Maybe String, searchTerm : Maybe String } -> List UI.Msg 37 + createAction tracks maybe = 37 38 let 38 39 playlistTracks = 39 40 Tracks.toPlaylistTracks tracks ··· 62 63 63 64 Nothing -> 64 65 [] 66 + 67 + 68 + 69 + -- SELECT 70 + 71 + 72 + select : List Playlist -> Alfred UI.Msg 73 + select playlists = 74 + let 75 + playlistNames = 76 + playlists 77 + |> List.map .name 78 + |> List.sortBy String.toLower 79 + in 80 + { action = selectAction playlists 81 + , focus = 0 82 + , index = playlistNames 83 + , message = "Select a playlist to play tracks from" 84 + , results = playlistNames 85 + , searchTerm = Nothing 86 + } 87 + 88 + 89 + selectAction : List Playlist -> { result : Maybe String, searchTerm : Maybe String } -> List UI.Msg 90 + selectAction playlists { result } = 91 + case Maybe.andThen (\r -> List.find (.name >> (==) r) playlists) result of 92 + Just playlist -> 93 + [ UI.SelectPlaylist playlist ] 94 + 95 + Nothing -> 96 + []
+15 -8
src/Applications/UI/Playlists/State.elm
··· 84 84 |> andThen save 85 85 86 86 87 + assistWithAddingTracksToPlaylist : List IdentifiedTrack -> Manager 88 + assistWithAddingTracksToPlaylist tracks model = 89 + model.playlists 90 + |> List.filterNot .autoGenerated 91 + |> UI.Playlists.Alfred.create tracks 92 + |> (\a -> Alfred.assign a model) 93 + 94 + 95 + assistWithSelectingPlaylist : Manager 96 + assistWithSelectingPlaylist model = 97 + model.playlists 98 + |> UI.Playlists.Alfred.select 99 + |> (\a -> Alfred.assign a model) 100 + 101 + 87 102 create : Manager 88 103 create model = 89 104 case model.newPlaylistContext of ··· 239 254 |> (\c -> { model | playlists = c }) 240 255 |> select updatedPlaylist 241 256 |> andThen User.savePlaylists 242 - 243 - 244 - requestAssistance : List IdentifiedTrack -> Manager 245 - requestAssistance tracks model = 246 - model.playlists 247 - |> List.filterNot .autoGenerated 248 - |> UI.Playlists.Alfred.create tracks 249 - |> (\a -> Alfred.assign a model) 250 257 251 258 252 259 save : Manager
+2 -2
src/Applications/UI/Queue/ContextMenu.elm
··· 49 49 , Item 50 50 { icon = Icons.waves 51 51 , label = "Add to playlist" 52 - , msg = RequestAssistanceForPlaylists tracks 52 + , msg = AssistWithAddingTracksToPlaylist tracks 53 53 , active = False 54 54 } 55 55 , UI.Tracks.ContextMenu.cacheAction ··· 94 94 , Item 95 95 { icon = Icons.waves 96 96 , label = "Add to playlist" 97 - , msg = RequestAssistanceForPlaylists tracks 97 + , msg = AssistWithAddingTracksToPlaylist tracks 98 98 , active = False 99 99 } 100 100 , UI.Tracks.ContextMenu.cacheAction
+2 -2
src/Applications/UI/Tracks/ContextMenu.elm
··· 175 175 , justAnItem 176 176 { icon = Icons.waves 177 177 , label = "Add to another playlist" 178 - , msg = RequestAssistanceForPlaylists tracks 178 + , msg = AssistWithAddingTracksToPlaylist tracks 179 179 180 180 -- 181 181 , active = False ··· 191 191 , justAnItem 192 192 { icon = Icons.waves 193 193 , label = "Add to playlist" 194 - , msg = RequestAssistanceForPlaylists tracks 194 + , msg = AssistWithAddingTracksToPlaylist tracks 195 195 , active = False 196 196 } 197 197 ]
+2 -1
src/Applications/UI/Types.elm
··· 243 243 ----------------------------------------- 244 244 | ActivatePlaylist Playlist 245 245 | AddTracksToPlaylist { playlistName : String, tracks : List PlaylistTrack } 246 + | AssistWithAddingTracksToPlaylist (List IdentifiedTrack) 246 247 | CreatePlaylist 247 248 | DeactivatePlaylist 248 249 | DeletePlaylist { playlistName : String } ··· 250 251 | ModifyPlaylist 251 252 | MoveTrackInSelectedPlaylist { to : Int } 252 253 | RemoveTracksFromPlaylist Playlist (List IdentifiedTrack) 253 - | RequestAssistanceForPlaylists (List IdentifiedTrack) 254 + | SelectPlaylist Playlist 254 255 | SetPlaylistCreationContext String 255 256 | SetPlaylistModificationContext String String 256 257 | ShowPlaylistListMenu Playlist Mouse.Event
+1
system/Css/Tailwind.js
··· 140 140 fontSize: { 141 141 "0": 0, 142 142 "almost-sm": "0.78125rem", 143 + "nearly-sm": "0.8125rem", 143 144 "xxs": "0.6875rem", 144 145 }, 145 146