fix: Alt+P au lieu de Ctrl+P (conflit navigateur) + bouton config correct
This commit is contained in:
parent
08c29c9efe
commit
fc6452d4a4
@ -28,7 +28,7 @@ const COMMANDS = [
|
|||||||
{ id: 'theme', label: '🌓 Changer le thème', description: 'Basculer clair/sombre', action: () => { close(); toggleTheme(); } },
|
{ 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: '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: '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 ──
|
// ── Create DOM structure ──
|
||||||
@ -41,7 +41,7 @@ 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">${navigator.platform.includes('Mac') ? '⌘P' : 'Ctrl+P'}</span>
|
<span class="cp-hint">Alt+P</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cp-results"></div>
|
<div class="cp-results"></div>
|
||||||
<div class="cp-footer">
|
<div class="cp-footer">
|
||||||
@ -265,8 +265,8 @@ 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) => {
|
||||||
// Ctrl+P or Cmd+P — open palette
|
// Alt+P — open palette (Alt+Shift+P for command mode)
|
||||||
if ((e.ctrlKey || e.metaKey) && e.key === 'p') {
|
if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === 'p') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
close();
|
close();
|
||||||
@ -274,8 +274,8 @@ export function initCommandPalette() {
|
|||||||
open('');
|
open('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ctrl+Shift+P or Cmd+Shift+P — open in command mode
|
// Alt+Shift+P — open in command mode
|
||||||
if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key === 'p') {
|
if (e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey && e.key === 'p') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
close();
|
close();
|
||||||
|
|||||||
@ -6232,7 +6232,6 @@ body.popup-mode .content-area {
|
|||||||
padding: 8px 14px;
|
padding: 8px 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-left: 3px solid transparent;
|
border-left: 3px solid transparent;
|
||||||
/* Uncomment for smooth scroll perf */;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cp-item:hover {
|
.cp-item:hover {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user