Skip to content

Commit

Permalink
Improve copy/paste UX in Options and packages
Browse files Browse the repository at this point in the history
- Change title from button to a to make it selectable
- Resurect `Name` meta for Options
- Make sure this won't break keyboard selection
  • Loading branch information
turboMaCk committed Jan 25, 2021
1 parent 5bb94c9 commit 33ba785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Page/Options.elm
Expand Up @@ -213,7 +213,9 @@ viewResultItem channel _ show item =
showDetails =
if Just item.source.name == show then
div [ Html.Attributes.map SearchMsg Search.trapClick ]
[ div [] [ text "Default value" ]
[ div [] [ text "Name" ]
, div [] [ wrapped asPreCode item.source.name ]
, div [] [ text "Default value" ]
, div [] [ withEmpty (wrapped asPreCode) item.source.default ]
, div [] [ text "Type" ]
, div [] [ withEmpty asPre item.source.type_ ]
Expand Down Expand Up @@ -241,9 +243,10 @@ viewResultItem channel _ show item =
<|
List.filterMap identity
[ Just <|
Html.button
Html.a
[ class "search-result-button"
, onClick toggle
, href ""
]
[ text item.source.name ]
, Maybe.map showHtml item.source.description
Expand Down
3 changes: 2 additions & 1 deletion src/Page/Packages.elm
Expand Up @@ -540,9 +540,10 @@ viewResultItem channel showNixOSDetails show item =
([]
|> List.append longerPackageDetails
|> List.append
[ Html.button
[ Html.a
[ class "search-result-button"
, onClick toggle
, href ""
]
[ text item.source.attr_name ]
, div [] [ text <| Maybe.withDefault "" item.source.description ]
Expand Down

0 comments on commit 33ba785

Please sign in to comment.