Conversation
Test results 27 files 27 suites 44m 22s ⏱️ Results for commit 8e7e444. ♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3578 +/- ##
==========================================
+ Coverage 62.21% 62.23% +0.01%
==========================================
Files 611 611
Lines 44939 44962 +23
Branches 43 43
==========================================
+ Hits 27960 27983 +23
Misses 16969 16969
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3dba0c7 to
ac41370
Compare
ac41370 to
7079547
Compare
| search_providers, failed_providers = process_form(form) | ||
| if has_only_one_result(search_providers) and not failed_providers: | ||
| provider = search_providers[0] | ||
| if provider.name == 'Fallback': |
There was a problem hiding this comment.
When does this happen? Could you add an instruction for how to replicate this situation?
There was a problem hiding this comment.
I have added a "How to test" section
ae1a484 to
7c2b089
Compare
|
@johannaengland Made adjustments as requested Adjusted styles to match previous search bar exactlyThe reason that the button grew, was that I changed the search bar to use a button instead of an input, with consistent spacing above/below text. The old button has more space above than below, which is why it is slightly narrower. It also has a fixed height of 1.8rem. Adjusted position of search results popoverPopover now has no space between itself and the input.
Use localhost instead of custom fixture in
|
johannaengland
left a comment
There was a problem hiding this comment.
When I search for something that returns a result, then delete that input, then for a short moment between showing the results and closing the popover it is showing the "No results for ..." popover, that should be fixed
| box.save() | ||
| yield box | ||
| box.delete() | ||
| def netbox(localhost): |
There was a problem hiding this comment.
Why are you not using it directly where netbox is used?
There was a problem hiding this comment.
I think using netbox instead of localhost increases the clarity of the tests, and if we need to create a custom netbox for the tests, it only has to be updated in one place. But I changed the tests to use localhost anyways :)
There was a problem hiding this comment.
I see, if you think there will be a need to customize it, then we can keep it that way as well
|
Fixed it by showing an empty response before the popover is closed. |







Scope and purpose
Resolves #3577.
This PR adds search preview results when using the navbar search. It uses a new
index_search_previewview, which reuses the search providers of the existingindexview, but uses HTMX-compatible templates and result truncation to better fit a preview.The existing search view (
info/views.py::index) redirects to the search result if only a single result is returned. The search bar shows results as the user types, and it is slightly jarring to redirect automatically, even if the match is exact. As such, I opted to just show the results instead, even if only one is returned. However, if the reviewers think that automatic redirect should be the intended behaviour, I can add it to the preview search as well.How to test
The search preview view handles several search result cases:
Screenshots
If the search does not match anything, show a "No results" message
When a search returns a lot of results, truncate each category
When a search is specific enough, some result categories are not truncated
Contributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.
<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.