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

Configure Feed

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

feat: Various command palette improvements

+139 -56
+1
CHANGELOG.md
··· 7 7 - **Basic setup for themes**. 8 8 - No longer resets shuffle history when the collection or search changes. 9 9 - WebDAV improvements. 10 + - Command palette improvements. 10 11 - Directory playlists now work correctly with sources that specify a sub directory. 11 12 - Fixed issue with missing extensions when downloading playlists. 12 13 - Removed Fission/Webnative user layer (discontinued).
+2 -2
src/Core/Themes/Sunrise/Alfred/View.elm
··· 7 7 import Html exposing (Html, text) 8 8 import Html.Attributes exposing (attribute, autofocus, id, placeholder, style, type_) 9 9 import Html.Events exposing (onInput) 10 - import Html.Ext exposing (onTapPreventDefault) 10 + import Html.Ext exposing (onTapPreventDefault, onTapStopPropagation) 11 11 import Json.Decode 12 12 import Material.Icons.Round as Icons 13 13 import Material.Icons.Types exposing (Coloring(..)) ··· 205 205 206 206 itemView bgColor instance idx item = 207 207 brick 208 - [ onTapPreventDefault (UI.SelectAlfredItem idx) 208 + [ onTapStopPropagation (UI.SelectAlfredItem idx) 209 209 210 210 -- 211 211 , if idx == instance.focus then
+14
src/Core/UI/Adjunct.elm
··· 52 52 [ Keyboard.Escape ] -> 53 53 hideOverlay m 54 54 55 + -- Meta key 56 + -- 57 + [ Keyboard.Character "K", Keyboard.Meta ] -> 58 + Commands.showPalette m 59 + 60 + -- Ctrl key 61 + -- 62 + [ Keyboard.Character "K", Keyboard.Control ] -> 63 + Commands.showPalette m 64 + 65 + [ Keyboard.Character "L", Keyboard.Control ] -> 66 + Playlists.assistWithSelectingPlaylist m 67 + 55 68 _ -> 56 69 skip 57 70 ··· 69 82 -- 70 83 -- [ Keyboard.Character "}", Keyboard.Shift, Keyboard.Control ] -> 71 84 -- Audio.seek ((m.audioPosition + 10) / m.audioDuration) m 85 + -- 72 86 -- Meta key 73 87 -- 74 88 [ Keyboard.Character "K", Keyboard.Meta ] ->
+19 -1
src/Core/UI/Alfred/State.elm
··· 2 2 3 3 import Alfred exposing (Alfred) 4 4 import Browser.Dom as Dom 5 + import Keyboard 5 6 import Process 6 7 import Return exposing (return) 7 8 import Return.Ext as Return ··· 15 16 16 17 assign : Alfred UI.Msg -> Manager 17 18 assign instance model = 19 + let 20 + pressedKeys = 21 + List.filter 22 + (\k -> 23 + case k of 24 + Keyboard.Meta -> 25 + True 26 + 27 + Keyboard.Control -> 28 + True 29 + 30 + _ -> 31 + False 32 + ) 33 + model.pressedKeys 34 + in 18 35 250 19 36 |> Process.sleep 20 37 |> Task.andThen (\_ -> Dom.focus "diffuse__alfred") 38 + |> Task.andThen (\_ -> Dom.setViewportOf "alfred__results" 0 0) 21 39 |> Task.attempt (\_ -> UI.Bypass) 22 40 -- The "K" key seems to stick when using CMD + K, 23 41 -- aka. Meta key + K, to show the command palette. 24 42 -- https://github.com/ohanhi/keyboard/issues/14 25 - |> return { model | alfred = Just instance, pressedKeys = [] } 43 + |> return { model | alfred = Just instance, pressedKeys = pressedKeys } 26 44 27 45 28 46 gotInput : String -> Manager
+103 -53
src/Core/UI/Commands/Alfred.elm
··· 31 31 commands model = 32 32 [ { name = Just "Currently playing", items = nowPlayingCommands model } 33 33 , { name = Just "Track selection", items = selectionCommands model } 34 + , { name = Just "Collection / Playlist", items = playlistCommands model } 35 + , { name = Just "Tracks", items = tracksCommands model } 34 36 , { name = Just "View", items = viewCommands model } 35 37 , { name = Just "Playback", items = playbackCommands model } 36 38 , { name = Just "Sources", items = sourcesCommands model } ··· 49 51 , value = Command (UI.TracksMsg Tracks.ClearCache) 50 52 } 51 53 , { icon = Just (Icons.save 16) 52 - , title = "Export data" 54 + , title = "Download data snapshot" 53 55 , value = Command UI.Export 54 56 } 55 57 , { icon = Just (Icons.save 16) 56 - , title = "Import data (⚠️ will override current data)" 58 + , title = "Import data snapshot (⚠️ will override current data)" 57 59 , value = Command UI.RequestImport 58 60 } 59 61 ] ··· 154 156 ] 155 157 156 158 159 + playlistCommands model = 160 + let 161 + selection = 162 + case model.selectedPlaylist of 163 + Just playlist -> 164 + [ -- DeselectPlaylist 165 + { icon = Just (Icons.waves 16) 166 + , title = "Deactivate " ++ ifThenElse playlist.collection "collection" "playlist" 167 + , value = Command UI.DeselectPlaylist 168 + } 169 + ] 170 + 171 + Nothing -> 172 + [] 173 + in 174 + selection 175 + ++ [ { icon = Just (Icons.waves 16) 176 + , title = "Select collection or playlist" 177 + , value = Command UI.AssistWithSelectingPlaylist 178 + } 179 + ] 180 + 181 + 157 182 selectionCommands model = 158 183 let 159 184 ( selection, _, amountOfFavs ) = ··· 229 254 ] 230 255 231 256 232 - viewCommands model = 257 + tracksCommands model = 233 258 let 234 - sortCommands = 235 - (case Maybe.andThen .autoGenerated model.selectedPlaylist of 236 - Nothing -> 237 - [] 238 - 239 - _ -> 240 - case model.scene of 241 - Tracks.Covers -> 242 - [ Album, Artist ] 243 - 244 - Tracks.List -> 245 - [ Album, Artist, Title ] 246 - ) 247 - |> List.remove 248 - model.sortBy 249 - |> List.map 250 - (\sortBy -> 251 - { icon = 252 - Just (Icons.sort 16) 253 - , title = 254 - case sortBy of 255 - Artist -> 256 - "Sort tracks by artist" 257 - 258 - Album -> 259 - "Sort tracks by album" 260 - 261 - PlaylistIndex -> 262 - "Sort tracks by playlist index" 263 - 264 - Title -> 265 - "Sort tracks by title" 266 - , value = 267 - Command (UI.TracksMsg <| Tracks.SortBy sortBy) 268 - } 269 - ) 270 - 271 259 groupCommands = 272 260 [ AddedOn, Directory, FirstAlphaCharacter, TrackYear ] 273 261 |> (case model.grouping of ··· 311 299 list 312 300 ) 313 301 in 314 - [ { icon = Just (Icons.brush 14) 315 - , title = "Change application theme" 316 - , value = Command UI.AssistWithChangingTheme 317 - } 318 - , { icon = Just (Icons.favorite 14) 302 + [ { icon = Just (Icons.favorite 14) 319 303 , title = toggle model.favouritesOnly "favourites-only mode" 320 304 , value = Command (UI.TracksMsg Tracks.ToggleFavouritesOnly) 321 305 } 322 306 323 307 -- 324 - , case model.scene of 308 + , { icon = Just (Icons.filter_list 16) 309 + , title = toggle model.cachedTracksOnly "cached-tracks-only mode" 310 + , value = Command (UI.TracksMsg Tracks.ToggleCachedOnly) 311 + } 312 + ] 313 + ++ groupCommands 314 + ++ [ { icon = Just (Icons.filter_list 16) 315 + , title = 316 + if model.hideDuplicates then 317 + "Allow duplicates" 318 + 319 + else 320 + "Remove duplicates" 321 + , value = Command (UI.TracksMsg Tracks.ToggleHideDuplicates) 322 + } 323 + 324 + -- 325 + , { icon = Just (Icons.photo 16) 326 + , title = 327 + if model.coverSelectionReducesPool then 328 + "Track pool is limited to selected cover (Select to disable)" 329 + 330 + else 331 + "Track pool is not restricted by selected cover (Select to enable)" 332 + , value = Command (UI.TracksMsg Tracks.ToggleCoverSelectionReducesPool) 333 + } 334 + ] 335 + 336 + 337 + viewCommands model = 338 + let 339 + sortCommands = 340 + (case Maybe.andThen .autoGenerated model.selectedPlaylist of 341 + Nothing -> 342 + [] 343 + 344 + _ -> 345 + case model.scene of 346 + Tracks.Covers -> 347 + [ Album, Artist ] 348 + 349 + Tracks.List -> 350 + [ Album, Artist, Title ] 351 + ) 352 + |> List.remove 353 + model.sortBy 354 + |> List.map 355 + (\sortBy -> 356 + { icon = 357 + Just (Icons.sort 16) 358 + , title = 359 + case sortBy of 360 + Artist -> 361 + "Sort tracks by artist" 362 + 363 + Album -> 364 + "Sort tracks by album" 365 + 366 + PlaylistIndex -> 367 + "Sort tracks by playlist index" 368 + 369 + Title -> 370 + "Sort tracks by title" 371 + , value = 372 + Command (UI.TracksMsg <| Tracks.SortBy sortBy) 373 + } 374 + ) 375 + in 376 + [ case model.scene of 325 377 Tracks.Covers -> 326 378 { icon = Just (Icons.notes 16) 327 379 , title = "Switch to list view" ··· 335 387 } 336 388 337 389 -- 338 - , { icon = Just (Icons.filter_list 16) 339 - , title = ifThenElse model.cachedTracksOnly "Disable cached-tracks-only mode" "Only show cached tracks" 340 - , value = Command (UI.TracksMsg Tracks.ToggleCachedOnly) 341 - } 342 - 343 - -- 344 390 , { icon = Just (Icons.sort 16) 345 391 , title = "Change sort direction" 346 392 , value = Command (UI.TracksMsg <| Tracks.SortBy model.sortBy) 347 393 } 348 394 ] 349 395 ++ sortCommands 350 - ++ groupCommands 396 + ++ [ { icon = Just (Icons.brush 14) 397 + , title = "Change application theme" 398 + , value = Command UI.AssistWithChangingTheme 399 + } 400 + ] 351 401 352 402 353 403