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.

Improve processing progress indication

+24 -5
+7 -1
src/Applications/UI.elm
··· 20 20 import Css.Transitions 21 21 import Debouncer.Basic as Debouncer exposing (Debouncer) 22 22 import Dict exposing (Dict) 23 + import Dict.Ext as Dict 23 24 import File exposing (File) 24 25 import File.Download 25 26 import File.Select ··· 1413 1414 sources = 1414 1415 model.sources 1415 1416 1417 + isProcessing = 1418 + sourcesToProcess 1419 + |> List.sortBy (.data >> Dict.fetch "name" "") 1420 + |> List.map (\{ id } -> ( id, 0 )) 1421 + 1416 1422 newSources = 1417 1423 { sources 1418 - | isProcessing = List.map (\{ id } -> ( id, 0 )) sourcesToProcess 1424 + | isProcessing = isProcessing 1419 1425 , processingError = Nothing 1420 1426 , processingNotificationId = Just notificationId 1421 1427 }
+17 -4
src/Applications/UI/Sources.elm
··· 427 427 428 428 sourceActions : List ( String, Float ) -> Maybe { error : String, sourceId : String } -> Source -> List (UI.List.Action Msg) 429 429 sourceActions isProcessing processingError source = 430 + let 431 + processIndex = 432 + List.findIndex (Tuple.first >> (==) source.id) isProcessing 433 + 434 + process = 435 + Maybe.andThen (\idx -> List.getAt idx isProcessing) processIndex 436 + in 430 437 List.append 431 - (case ( List.find (Tuple.first >> (==) source.id) isProcessing, processingError ) of 438 + (case ( process, processingError ) of 432 439 ( Just ( _, progress ), _ ) -> 433 440 [ { color = Inherit 434 441 , icon = 435 442 \_ _ -> 436 443 if progress < 0.05 then 437 444 UnstyledHtml.span 438 - [ UnstyledHtml.class "div fw4 o-50 ph1" ] 439 - [ UnstyledHtml.text "Building file tree" ] 445 + [ UnstyledHtml.class "dib o-70 ph1" ] 446 + [ case processIndex of 447 + Just 0 -> 448 + UnstyledHtml.text "Building" 449 + 450 + _ -> 451 + UnstyledHtml.text "Waiting" 452 + ] 440 453 441 454 else 442 455 progress ··· 447 460 |> UnstyledHtml.text 448 461 |> List.singleton 449 462 |> UnstyledHtml.span 450 - [ UnstyledHtml.class "div fw4 o-50 ph1" ] 463 + [ UnstyledHtml.class "dib o-70 ph1" ] 451 464 , msg = Nothing 452 465 , title = "" 453 466 }