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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user