Add search suggestions UI - #5798
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a client-side search suggestions dropdown to the UI by introducing new markup/styles for a suggestions panel and a JS module that debounces calls to /api/v1/search/suggestions and supports keyboard navigation.
Changes:
- Load a new
suggestions.jsscript from the main layout. - Extend the search box component with a container and a suggestions host element.
- Add JS behavior (fetch + debounce + arrow/enter navigation) and CSS for dropdown positioning/theme styling.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/invidious/views/template.ecr | Loads the new suggestions JS on pages using the main template. |
| src/invidious/views/components/search_box.ecr | Adds #search-container and #suggestions elements to host the dropdown. |
| assets/js/suggestions.js | Implements debounced suggestions fetching and keyboard navigation. |
| assets/css/default.css | Styles the dropdown and applies active-row theming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@MiningTcup Hello, did you use AI to make this PR? If so, please disclose it as per the AI_POLICY.md (A PR template is coming soon to make it more obvious that disclosure is mandatory #5803 ) |
|
I did not use AI whatsoever, aside from these Copilot suggestions which I've fact-checked and sometimes altered. I know those comments in the suggestions.js look a bit weird, but I wrote them myself. Also sorry about the Git noise, I am a bit of an idiot and have not contributed much before. |
This PR adds search suggestions to the UI. It fetches /api/v1/search/suggestions and displays them as a dropdown with keyboard navigation. Tested on Firefox- and Chromium-based browsers.