434429 (3) [Avatar] Offline
#1
I just finished the 3d chapter and I noticed that the first time we run the PhotoGroove the selected size is Small whereas the initModel has Medium.

viewSizeChooser : ThumbnailSize -> Html Msg
viewSizeChooser size =
    label []
        [ input [ type_ "radio", name "size" ] []
        , text (sizeToString size)
        ]


I suggest you either to initialize it as Small or to implement the initialization like:

viewSizeChooser : ThumbnailSize -> ThumbnailSize -> Html Msg
viewSizeChooser current size =
  -- ...
      , checked (size == current)
  -- ...

view model =
  -- ...
  ( List.map (viewSizeChooser model.chosenSize) [ Small, Medium, Large ] )


Here there's my repo with a diff https://github.com/pietro909/learning-elm/commit/0b793a2c4d8450a96b4acd7a29be29d62da5ee70

Thank you for this book, it's amazing!