fix(ui): prevent search input from clearing on each keystroke and add dedicated /search page

The debounceSearch() function in files.html called clearFullTextSearch()
when the query was shorter than 2 characters. Since clearFullTextSearch()
sets input.value = '', every single keystroke was immediately erased —
users could paste text but not type.

Fix: debounceSearch now only hides the results panel for short queries
without touching the input value.

Also adds a dedicated /search page with Google-style results showing
content previews (document title, filename, type badges, tag badges,
sender, and OCR text snippets with highlighted matches).

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-26 09:18:28 +00:00
parent 04da7ae804
commit 09a6337c6f
6 changed files with 328 additions and 1 deletions
+4 -1
View File
@@ -936,7 +936,10 @@
function debounceSearch(value) {
clearTimeout(_searchDebounceTimer);
if (!value || value.trim().length < 2) {
clearFullTextSearch();
// Only hide the results panel; do NOT clear the input value so the
// user can continue typing characters until the query is long enough.
var _p = document.getElementById('search-results-panel');
if (_p) _p.style.display = 'none';
return;
}
_searchDebounceTimer = setTimeout(() => {