fix: raccourcis palette — Ctrl+Shift+Espace fichiers, Ctrl+Alt+Espace commandes
CI / lint (push) Failing after 4s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / security (push) Successful in 12s

This commit is contained in:
2026-06-02 14:01:35 -04:00
parent fc6452d4a4
commit 800a8c34a1
+8 -15
View File
@@ -41,12 +41,13 @@ function createDOM() {
<div class="command-palette"> <div class="command-palette">
<div class="cp-header"> <div class="cp-header">
<input type="text" class="cp-input" placeholder="Rechercher un fichier... (tapez > pour les commandes)" spellcheck="false" autocomplete="off"> <input type="text" class="cp-input" placeholder="Rechercher un fichier... (tapez > pour les commandes)" spellcheck="false" autocomplete="off">
<span class="cp-hint">Alt+P</span> <span class="cp-hint">Ctrl+Shift+Espace</span>
</div> </div>
<div class="cp-results"></div> <div class="cp-results"></div>
<div class="cp-footer"> <div class="cp-footer">
<span>↑↓ naviguer</span> <span>↑↓ naviguer</span>
<span>↵ ouvrir</span> <span>↵ ouvrir</span>
<span>Tab commandes</span>
<span>Esc fermer</span> <span>Esc fermer</span>
</div> </div>
</div> </div>
@@ -265,23 +266,15 @@ function escapeHtml(str) {
// ── Init: Register global keyboard shortcut ── // ── Init: Register global keyboard shortcut ──
export function initCommandPalette() { export function initCommandPalette() {
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
// Alt+P — open palette (Alt+Shift+P for command mode) // Ctrl+Shift+Espace — open file palette
if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === 'p') { if ((e.ctrlKey || e.metaKey) && e.shiftKey && !e.altKey && (e.key === ' ' || e.code === 'Space')) {
e.preventDefault(); e.preventDefault();
if (isOpen()) { if (isOpen()) { close(); } else { open(''); }
close();
} else {
open('');
}
} }
// Alt+Shift+P — open in command mode // Ctrl+Alt+Espace — open command palette
if (e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey && e.key === 'p') { if ((e.ctrlKey || e.metaKey) && e.altKey && !e.shiftKey && (e.key === ' ' || e.code === 'Space')) {
e.preventDefault(); e.preventDefault();
if (isOpen()) { if (isOpen()) { close(); } else { open('> '); }
close();
} else {
open('> ');
}
} }
}); });
} }