From a662a4a3c27caa0f9bb20b468880607ca5606011 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Sat, 30 May 2026 20:36:13 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20hover=20transparent=20+=20auto-save=20?= =?UTF-8?q?=C3=A9diteur=202s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/js/ai.js | 6 +++--- frontend/js/utils.js | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/js/ai.js b/frontend/js/ai.js index f3d3ab4..6d763e9 100644 --- a/frontend/js/ai.js +++ b/frontend/js/ai.js @@ -122,7 +122,7 @@ function createMenu(items, parentEl) { } }); el.addEventListener('mouseleave', (e) => { - el.style.background = ''; + el.style.background = 'transparent'; }); el.addEventListener('click', (e) => { e.stopPropagation(); @@ -172,7 +172,7 @@ function createSubMenu(items, parentEl) { }); el.innerHTML = item.label; el.addEventListener('mouseenter', () => { el.style.background = 'rgba(255,255,255,0.06)'; }); - el.addEventListener('mouseleave', () => { el.style.background = ''; }); + el.addEventListener('mouseleave', () => { el.style.background = 'transparent'; }); el.addEventListener('click', (e) => { e.stopPropagation(); if (item.action) item.action(); @@ -382,7 +382,7 @@ function createDropdownBtn(text, items) { createMenu(items, btn); }); btn.addEventListener('mouseenter', () => { btn.style.background = 'rgba(255,255,255,0.08)'; }); - btn.addEventListener('mouseleave', () => { btn.style.background = ''; }); + btn.addEventListener('mouseleave', () => { btn.style.background = 'transparent'; }); return btn; } diff --git a/frontend/js/utils.js b/frontend/js/utils.js index 795114b..22d835c 100644 --- a/frontend/js/utils.js +++ b/frontend/js/utils.js @@ -315,6 +315,13 @@ async function openEditor(vaultName, filePath) { }, ]), EditorView.lineWrapping, + // Auto-save: debounced save after 2s of inactivity + EditorView.updateListener.of((update) => { + if (update.docChanged) { + clearTimeout(window._obsigateAutoSaveTimer); + window._obsigateAutoSaveTimer = setTimeout(() => saveFile(), 2000); + } + }), ]; // Add language support based on file extension