fix: Alt+P au lieu de Ctrl+P (conflit navigateur) + bouton config correct
Some checks failed
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:
Bruno Charest 2026-06-02 13:12:35 -04:00
parent 08c29c9efe
commit fc6452d4a4
2 changed files with 6 additions and 7 deletions

View File

@ -28,7 +28,7 @@ const COMMANDS = [
{ id: 'theme', label: '🌓 Changer le thème', description: 'Basculer clair/sombre', action: () => { close(); toggleTheme(); } },
{ id: 'reindex', label: '🔄 Réindexer', description: 'Forcer la réindexation complète', action: async () => { close(); try { await api('/api/index/reload'); showToast('Index rechargé', 'success'); } catch { showToast('Erreur de réindexation', 'error'); } } },
{ id: 'help', label: '❓ Aide', description: 'Ouvrir l\'aide', action: () => { close(); const helpBtn = document.getElementById('header-help-btn'); if (helpBtn) helpBtn.click(); } },
{ id: 'config', label: '⚙️ Configuration', description: 'Ouvrir les paramètres', action: () => { close(); document.querySelector('[data-tab-config]')?.click(); } },
{ id: 'config', label: '⚙️ Configuration', description: 'Ouvrir les paramètres', action: () => { close(); const btn = document.getElementById('config-open-btn'); if (btn) btn.click(); } },
];
// ── Create DOM structure ──
@ -41,7 +41,7 @@ function createDOM() {
<div class="command-palette">
<div class="cp-header">
<input type="text" class="cp-input" placeholder="Rechercher un fichier... (tapez > pour les commandes)" spellcheck="false" autocomplete="off">
<span class="cp-hint">${navigator.platform.includes('Mac') ? '⌘P' : 'Ctrl+P'}</span>
<span class="cp-hint">Alt+P</span>
</div>
<div class="cp-results"></div>
<div class="cp-footer">
@ -265,8 +265,8 @@ function escapeHtml(str) {
// ── Init: Register global keyboard shortcut ──
export function initCommandPalette() {
document.addEventListener('keydown', (e) => {
// Ctrl+P or Cmd+P — open palette
if ((e.ctrlKey || e.metaKey) && e.key === 'p') {
// Alt+P — open palette (Alt+Shift+P for command mode)
if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === 'p') {
e.preventDefault();
if (isOpen()) {
close();
@ -274,8 +274,8 @@ export function initCommandPalette() {
open('');
}
}
// Ctrl+Shift+P or Cmd+Shift+P — open in command mode
if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key === 'p') {
// Alt+Shift+P — open in command mode
if (e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey && e.key === 'p') {
e.preventDefault();
if (isOpen()) {
close();

View File

@ -6232,7 +6232,6 @@ body.popup-mode .content-area {
padding: 8px 14px;
cursor: pointer;
border-left: 3px solid transparent;
/* Uncomment for smooth scroll perf */;
}
.cp-item:hover {