feat(quicksearch): bouton retour visible depuis une note de commandes

Fleche a la place de la loupe et Retour arriere sur champ vide, en plus
d'Esc qui ne se voyait pas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-10-10 18:38:56 +01:00
parent 6ca1e4b2cf
commit a0527eb806
4 changed files with 18 additions and 2 deletions
+3
View File
@@ -8932,6 +8932,9 @@ async function init() {
e.stopPropagation();
if (qsCommands) { qsLeaveCommands(); return; } // liste -> entrees
closeQuickSearchModal();
} else if (e.key === 'Backspace' && qsCommands && !qsInput.value) {
e.preventDefault();
qsLeaveCommands(); // retour, comme Esc
} else if (e.key === 'ArrowDown') {
e.preventDefault();
if (rows.length) { quickSearchSelected++; quickSearchRender(); }
+11 -1
View File
@@ -54,7 +54,7 @@ function qsLeaveCommands() {
qsCommands = null;
const input = document.getElementById('quickSearchInput');
input.value = '';
input.placeholder = 'Search and press Enter to copy password…';
input.placeholder = 'Search…';
quickSearchSelected = 0;
qsApplyMode();
quickSearchRender();
@@ -125,6 +125,10 @@ function qsApplyMode() {
box.querySelectorAll('[data-qsmode]').forEach(b =>
b.classList.toggle('is-on', (b.dataset.qsmode === 'fill') === qsFills()));
}
const back = document.getElementById('qsBack');
if (back) back.hidden = !qsCommands;
const ico = document.getElementById('qsSearchIcon');
if (ico) ico.style.display = qsCommands ? 'none' : '';
const hintEl = document.querySelector('#quickSearchModal .quick-search-hint');
if (hintEl && qsCommands) {
hintEl.textContent = qsFills()
@@ -138,6 +142,12 @@ function qsApplyMode() {
}
document.addEventListener('click', ev => {
if (ev.target.closest && ev.target.closest('#qsBack')) {
ev.stopPropagation();
qsLeaveCommands();
document.getElementById('quickSearchInput').focus();
return;
}
const b = ev.target.closest && ev.target.closest('[data-qsmode]');
if (!b) return;
quickSearchPreferCopy = b.dataset.qsmode === 'copy';