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.

Add ability to rename sources

+126 -35
+3 -2
CHANGELOG.md
··· 2 2 3 3 ## 2.2.0 4 4 5 - - Added dark mode 5 + - **Added dark mode** 6 + - **Added support for BTFS (an IPFS fork)** 7 + - Added ability to rename sources (ie. after creation) 6 8 - Added keyboard shortcuts for play/pause, toggle shuffle, etc. 7 9 See UI section on the about page for more info. 8 - - Added support for BTFS (an IPFS fork) 9 10 - Improved IPFS support as a music source (now uses paths instead of hashes) 10 11 - Improved text readability (contrast, etc.) 11 12
+46 -31
src/Applications/UI.elm
··· 758 758 ----------------------------------------- 759 759 -- Page Transitions 760 760 ----------------------------------------- 761 + -- Sources.NewThroughRedirect 762 + ----------------------------- 761 763 PageChanged (Page.Sources (UI.Sources.Page.NewThroughRedirect service args)) -> 762 764 let 763 765 ( sources, form, defaultContext ) = ··· 785 787 |> (\s -> { model | sources = s }) 786 788 |> return 787 789 790 + -- Sources.Edit 791 + --------------- 788 792 PageChanged (Page.Sources (UI.Sources.Page.Edit sourceId)) -> 789 - let 790 - isLoading = 791 - model.isLoading 793 + loadSourceForForm model sourceId 792 794 793 - maybeSource = 794 - List.find (.id >> (==) sourceId) model.sources.collection 795 - in 796 - case ( isLoading, maybeSource ) of 797 - ( False, Just source ) -> 798 - let 799 - ( sources, form ) = 800 - ( model.sources 801 - , model.sources.form 802 - ) 795 + -- Sources.Rename 796 + ----------------- 797 + PageChanged (Page.Sources (UI.Sources.Page.Rename sourceId)) -> 798 + loadSourceForForm model sourceId 803 799 804 - newForm = 805 - { form | context = source } 806 - 807 - newSources = 808 - { sources | form = newForm } 809 - in 810 - return { model | sources = newSources } 811 - 812 - ( False, Nothing ) -> 813 - return model 814 - 815 - ( True, _ ) -> 816 - -- Redirect away from edit-source page 817 - UI.Sources.Page.Index 818 - |> Page.Sources 819 - |> ChangeUrlUsingPage 820 - |> updateWithModel model 821 - 800 + -- 822 801 PageChanged _ -> 823 802 return model 824 803 ··· 1707 1686 -- 1708 1687 , Cmd.none 1709 1688 ) 1689 + 1690 + 1691 + loadSourceForForm : Model -> String -> ( Model, Cmd Msg ) 1692 + loadSourceForForm model sourceId = 1693 + let 1694 + isLoading = 1695 + model.isLoading 1696 + 1697 + maybeSource = 1698 + List.find (.id >> (==) sourceId) model.sources.collection 1699 + in 1700 + case ( isLoading, maybeSource ) of 1701 + ( False, Just source ) -> 1702 + let 1703 + ( sources, form ) = 1704 + ( model.sources 1705 + , model.sources.form 1706 + ) 1707 + 1708 + newForm = 1709 + { form | context = source } 1710 + 1711 + newSources = 1712 + { sources | form = newForm } 1713 + in 1714 + return { model | sources = newSources } 1715 + 1716 + ( False, Nothing ) -> 1717 + return model 1718 + 1719 + ( True, _ ) -> 1720 + -- Redirect away from edit-source page 1721 + UI.Sources.Page.Index 1722 + |> Page.Sources 1723 + |> ChangeUrlUsingPage 1724 + |> updateWithModel model 1710 1725 1711 1726 1712 1727 resetUrl : Nav.Key -> Url -> Page.Page -> Cmd Msg
+4
src/Applications/UI/Page.elm
··· 125 125 Sources (Sources.NewThroughRedirect _ _) -> 126 126 "sources/new" 127 127 128 + Sources (Sources.Rename sourceId) -> 129 + "sources/rename/" ++ sourceId 130 + 128 131 129 132 {-| Are the bases of these two pages the same? 130 133 -} ··· 208 211 , map (Sources << Sources.Edit) (s "sources" </> s "edit" </> string) 209 212 , map (Sources Sources.New) (s "sources" </> s "new") 210 213 , map (Sources Sources.NewOnboarding) (s "sources" </> s "welcome") 214 + , map (Sources << Sources.Rename) (s "sources" </> s "rename" </> string) 211 215 212 216 -- Oauth 213 217 --------
+2 -1
src/Applications/UI/Playlists/ContextMenu.elm
··· 3 3 import ContextMenu exposing (..) 4 4 import Coordinates exposing (Coordinates) 5 5 import Material.Icons.Action as Icons 6 + import Material.Icons.Content as Icons 6 7 import Material.Icons.File as Icons 7 8 import Material.Icons.Image as Icons 8 9 import Playlists exposing (Playlist) ··· 22 23 listMenu playlist tracks = 23 24 ContextMenu 24 25 [ Item 25 - { icon = Icons.edit 26 + { icon = Icons.font_download 26 27 , label = "Rename playlist" 27 28 , msg = 28 29 playlist.name
+3
src/Applications/UI/Sources.elm
··· 306 306 307 307 NewThroughRedirect _ _ -> 308 308 List.map (Html.map FormMsg) (Form.new { onboarding = False } model.form) 309 + 310 + Rename sourceId -> 311 + List.map (Html.map FormMsg) (Form.rename model.form) 309 312 ) 310 313 311 314
+11
src/Applications/UI/Sources/ContextMenu.elm
··· 4 4 import ContextMenu exposing (..) 5 5 import Coordinates exposing (Coordinates) 6 6 import Material.Icons.Action as Icons 7 + import Material.Icons.Content as Icons 7 8 import Material.Icons.File as Icons 8 9 import Material.Icons.Image as Icons 9 10 import Material.Icons.Notification as Icons ··· 46 47 { icon = Icons.delete 47 48 , label = "Remove source" 48 49 , msg = RemoveSourceFromCollection { sourceId = source.id } 50 + , active = False 51 + } 52 + , Item 53 + { icon = Icons.font_download 54 + , label = "Rename source" 55 + , msg = 56 + source.id 57 + |> UI.Sources.Page.Rename 58 + |> UI.Page.Sources 59 + |> GoToPage 49 60 , active = False 50 61 } 51 62 ]
+56 -1
src/Applications/UI/Sources/Form.elm
··· 1 - module UI.Sources.Form exposing (FormStep(..), Model, Msg(..), defaultContext, edit, initialModel, new, takeStepBackwards, takeStepForwards, update) 1 + module UI.Sources.Form exposing (FormStep(..), Model, Msg(..), defaultContext, edit, initialModel, new, rename, takeStepBackwards, takeStepForwards, update) 2 2 3 3 import Chunky exposing (..) 4 4 import Common exposing (boolFromString, boolToString) ··· 71 71 = AddSource 72 72 | Bypass 73 73 | EditSource 74 + | RenameSource 74 75 | ReturnToIndex 75 76 | SelectService String 76 77 | SetData String String ··· 103 104 { model | step = Where, context = defaultContext } 104 105 [ ReplaceSourceInCollection model.context 105 106 , ProcessSources [ model.context ] 107 + , GoToPage (Page.Sources Sources.Index) 108 + ] 109 + 110 + RenameSource -> 111 + returnRepliesWithModel 112 + { model | step = Where, context = defaultContext } 113 + [ ReplaceSourceInCollection model.context 106 114 , GoToPage (Page.Sources Sources.Index) 107 115 ] 108 116 ··· 642 650 } 643 651 , text "." 644 652 ] 653 + 654 + 655 + 656 + -- RENAME 657 + 658 + 659 + rename : Model -> List (Html Msg) 660 + rename { context } = 661 + [ ----------------------------------------- 662 + -- Navigation 663 + ----------------------------------------- 664 + UI.Navigation.local 665 + [ ( Icon Icons.arrow_back 666 + , Label "Go Back" Shown 667 + , PerformMsg ReturnToIndex 668 + ) 669 + ] 670 + 671 + ----------------------------------------- 672 + -- Content 673 + ----------------------------------------- 674 + , (\h -> 675 + form RenameSource 676 + [ UI.Kit.canisterForm h ] 677 + ) 678 + [ UI.Kit.h2 "Name your source" 679 + 680 + -- Input 681 + -------- 682 + , [ name "name" 683 + , onInput (SetData "name") 684 + , value (Dict.fetch "name" "" context.data) 685 + ] 686 + |> UI.Kit.textField 687 + |> chunky [ C.max_w_md, C.mx_auto ] 688 + 689 + -- Button 690 + --------- 691 + , chunk 692 + [ C.mt_10 ] 693 + [ UI.Kit.button 694 + Normal 695 + Bypass 696 + (text "Save") 697 + ] 698 + ] 699 + ]
+1
src/Applications/UI/Sources/Page.elm
··· 13 13 | New 14 14 | NewOnboarding 15 15 | NewThroughRedirect Service { codeOrToken : Maybe String, state : Maybe String } 16 + | Rename String