From 4d39a83a63c72d982be7e5442ec719100c5466df Mon Sep 17 00:00:00 2001 From: isUnknown Date: Fri, 9 Jan 2026 17:10:26 +0100 Subject: [PATCH] feat: add backslash shortcut to toggle editor panel Added \ key to toggle the editor panel open/closed: - Opens to 'document' tab when panel is closed - Closes panel when it's open - Updated button tooltips to indicate the keyboard shortcut Works in all contexts (main document and iframe). Co-Authored-By: Claude Sonnet 4.5 --- src/App.vue | 8 ++++++++ src/components/editor/EditorPanel.vue | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 2b99519..55eaee0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -52,6 +52,14 @@ const handleKeyboardShortcut = (event) => { } } + // Backslash key - toggle editor panel + if (event.key === '\\') { + event.preventDefault(); + // Toggle: if panel is closed, open to 'document' tab; if open, close it + activeTab.value = activeTab.value.length > 0 ? '' : 'document'; + return; + } + // Cmd+S (Mac) or Ctrl+S (Windows/Linux) - save if ((event.metaKey || event.ctrlKey) && event.key === 's') { event.preventDefault(); diff --git a/src/components/editor/EditorPanel.vue b/src/components/editor/EditorPanel.vue index 771818e..8239042 100644 --- a/src/components/editor/EditorPanel.vue +++ b/src/components/editor/EditorPanel.vue @@ -6,6 +6,7 @@ class="tab" :class="{ active: activeTab === 'document' }" @click="activeTab = 'document'" + title="Ouvrir l'onglet Document (\)" > Document @@ -14,6 +15,7 @@ class="tab" :class="{ active: activeTab === 'code' }" @click="activeTab = 'code'" + title="Ouvrir l'onglet Code" > Code @@ -22,6 +24,7 @@ class="tab" :class="{ active: activeTab === 'contenu' }" @click="activeTab = 'contenu'" + title="Ouvrir l'onglet Contenu" > Contenu @@ -32,7 +35,7 @@ type="button" class="close-button" @click="activeTab = ''" - title="Fermer le panneau" + title="Fermer le panneau (\)" >