fix: checkbox vide casse la liste + raccourci Alt+\ pour autocomplete
CI / lint (push) Failing after 2s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after -7s

- Enter sur '- [ ]' sans texte: casse la liste (supprime la ligne vide)
- Raccourci: Alt+/ → Alt+\ (n'entre pas en conflit avec le slash menu)
- Aide F1, barre statut, console mis a jour
This commit is contained in:
2026-06-16 10:08:50 -04:00
parent 9c73dd8d51
commit 5fc110a1b2
+17 -10
View File
@@ -393,7 +393,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
<!-- Status bar --> <!-- Status bar -->
<div class="stat"> <div class="stat">
<div class="stat-left"> <div class="stat-left">
<span>Type <strong>/</strong> for commands | <strong>Alt+/</strong> autocomplete | <strong>Alt+I</strong> Insert</span> <span>Type <strong>/</strong> for commands | <strong>Alt+\</strong> autocomplete | <strong>Alt+I</strong> Insert</span>
<span>Ctrl+J AI panel</span> <span>Ctrl+J AI panel</span>
<span>Ctrl+S save</span> <span>Ctrl+S save</span>
<span>Ctrl+K link</span> <span>Ctrl+K link</span>
@@ -442,7 +442,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
<tr><td>Ctrl+S</td><td>Sauvegarder</td></tr> <tr><td>Ctrl+S</td><td>Sauvegarder</td></tr>
<tr><td>Clic sur le titre</td><td>Renommer le fichier</td></tr> <tr><td>Clic sur le titre</td><td>Renommer le fichier</td></tr>
<tr><td>Ctrl+J</td><td>Panneau AI</td></tr> <tr><td>Ctrl+J</td><td>Panneau AI</td></tr>
<tr><td>Alt+/</td><td>Autocompletion intelligente</td></tr> <tr><td>Alt+\</td><td>Autocompletion intelligente</td></tr>
<tr><td>Enter (liste)</td><td>Continue la liste (-, *, 1.) et checkboxes</td></tr> <tr><td>Enter (liste)</td><td>Continue la liste (-, *, 1.) et checkboxes</td></tr>
<tr><td>Enter (liste vide)</td><td>Termine la liste</td></tr> <tr><td>Enter (liste vide)</td><td>Termine la liste</td></tr>
</table> </table>
@@ -1786,8 +1786,8 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
else if (e.key === 'Escape') { e.preventDefault(); hideAutocomplete(); } else if (e.key === 'Escape') { e.preventDefault(); hideAutocomplete(); }
return; return;
} }
// Alt+/ : force autocomplete // Alt+\ : force autocomplete
if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === '/') { if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === '\\') {
e.preventDefault(); e.preventDefault();
triggerAutocomplete(); triggerAutocomplete();
return; return;
@@ -1811,11 +1811,18 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
var taskMatch = currentLine.match(/^(\s*)([-*+])\s+\[([ xX])\]\s/); var taskMatch = currentLine.match(/^(\s*)([-*+])\s+\[([ xX])\]\s/);
if (taskMatch) { if (taskMatch) {
// Continue checkbox (empty, unchecked) var afterTaskTrim = currentLine.slice(taskMatch[0].length).trim();
e.preventDefault(); if (afterTaskTrim.length === 0) {
var newNumber = ''; // Empty checkbox: break list (remove this line)
ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] '; e.preventDefault();
ta.setSelectionRange(ta.value.length, ta.value.length); ta.value = before.slice(0, lineStart) + after;
ta.setSelectionRange(lineStart, lineStart);
} else {
// Continue checkbox (empty, unchecked)
e.preventDefault();
ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] ';
ta.setSelectionRange(ta.value.length, ta.value.length);
}
markDirty(); autoHeight(); updateLineNumbers(); markDirty(); autoHeight(); updateLineNumbers();
return; return;
} else if (olMatch) { } else if (olMatch) {
@@ -1861,7 +1868,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
console.log('ObsiGate Editor v2 ready'); console.log('ObsiGate Editor v2 ready');
console.log(' File: ' + (fileVault ? fileVault + '/' + filePath : 'demo mode')); console.log(' File: ' + (fileVault ? fileVault + '/' + filePath : 'demo mode'));
console.log(' AI: checking...'); console.log(' AI: checking...');
console.log(' Type / for commands | Select text for bubble | Alt+/ autocomplete | Ctrl+J AI | Ctrl+S save'); console.log(' Type / for commands | Select text for bubble | Alt+\\ autocomplete | Ctrl+J AI | Ctrl+S save');
})(); })();
</script> </script>