feat(quicksearch): remap fill modes — left/Enter=password, right/Shift=full

Per user request, swap the quick-search click/key mapping so the common case
(fill just the password) is the plain left-click / Enter:

  left click  / Enter        → password only   (was: full user+Tab+pwd)
  right click / Shift+Enter   → full user+pwd   (was: username only)
  Ctrl+click  / Ctrl+Enter    → username only   (was: password only)

Keyboard mirrors the mouse. Copy-mode (tray/palette, no HWND target) shares
the same `mode`, so it shifts too: click/Enter copies password, Ctrl+click/
Ctrl+Enter copies username (right-click's 'full' has no copy meaning → pwd).
Updated the dynamic hint, the static index.html hint, and CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-08 14:24:57 +01:00
parent a7ad81c708
commit 8e0e7fd330
3 changed files with 20 additions and 19 deletions
+13 -13
View File
@@ -801,16 +801,16 @@ function quickSearchRender() {
main.appendChild(el('div', { class: 'quick-search-sub' }, e.username));
row.appendChild(avatar);
row.appendChild(main);
// Left click → full (user + Tab + password); Ctrl+click → password
// only (step-2 forms / unlock screens).
// Left click → password only; Ctrl+click → username only
// (step-2 forms / unlock screens).
row.addEventListener('click', ev =>
quickSearchPickEntry(e, (ev.ctrlKey || ev.metaKey) ? 'pwd' : 'full'));
// Right click → username only. preventDefault + stopPropagation so
// the custom context menu (installCustomContextMenu) doesn't pop.
quickSearchPickEntry(e, (ev.ctrlKey || ev.metaKey) ? 'user' : 'pwd'));
// Right click → full (user + Tab + password). preventDefault +
// stopPropagation so the custom context menu doesn't pop.
row.addEventListener('contextmenu', ev => {
ev.preventDefault();
ev.stopPropagation();
quickSearchPickEntry(e, 'user');
quickSearchPickEntry(e, 'full');
});
box.appendChild(row);
});
@@ -1073,8 +1073,8 @@ function openQuickSearchModal(hideAfter, forFill) {
const hintEl = modal.querySelector('.quick-search-hint');
if (hintEl) {
hintEl.textContent = forFill
? 'Enter = fill user+password · Shift+Enter = username · Ctrl+Enter = password · Esc = cancel'
: 'Enter / click = copy password · Shift+Enter / right-click = copy username · Esc = close';
? 'Enter / click = password · Shift+Enter / right-click = user+password · Ctrl+Enter / Ctrl+click = username · Esc = cancel'
: 'Enter / click = copy password · Ctrl+Enter / Ctrl+click = copy username · Esc = close';
}
quickSearchRender();
setTimeout(() => input.focus(), 50);
@@ -9738,11 +9738,11 @@ async function init() {
if (!sel) return;
const id = parseInt(sel.dataset.id, 10);
const entry = state.entries.find(x => x.id === id);
// Shift+Enter → username, Ctrl+Enter → password only,
// plain Enter → full (user + Tab + password).
const mode = e.shiftKey ? 'user'
: (e.ctrlKey || e.metaKey) ? 'pwd'
: 'full';
// Shift+Enter → full (user + Tab + password), Ctrl+Enter →
// username only, plain Enter → password only.
const mode = e.shiftKey ? 'full'
: (e.ctrlKey || e.metaKey) ? 'user'
: 'pwd';
if (entry) quickSearchPickEntry(entry, mode);
}
});