Skip to content

Suggest to search on nixpkgs issues when nothing is found #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/src/Search.elm
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ viewResult nixosChannels outMsg toRoute categoryName model viewSuccess viewBucke
if result.hits.total.value == 0 && List.length buckets == 0 then
div [ class "search-results" ]
[ ul [ class "search-sidebar" ] searchBuckets
, viewNoResults categoryName
, viewNoResults categoryName (Maybe.withDefault "" model.query)
]

else if List.length buckets > 0 then
Expand Down Expand Up @@ -866,12 +866,15 @@ viewResult nixosChannels outMsg toRoute categoryName model viewSuccess viewBucke

viewNoResults :
String
-> String
-> Html c
viewNoResults categoryName =
viewNoResults categoryName query =
div [ class "search-no-results" ]
[ h2 [] [ text <| "No " ++ categoryName ++ " found!" ]
, text "You might want to "
, Html.a [ href "https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#quick-start-to-adding-a-package" ] [ text "add a package" ]
, text " or "
, Html.a [ href ("https://github.com/NixOS/nixpkgs/issues?q=" ++ query) ] [ text "search nixpkgs issues" ]
, text "."
]

Expand Down