From 1a9a555beee43407fd70f7157d4dcc09ab1851d0 Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 27 Jul 2026 23:04:51 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20bookmarks/r=C3=A9cents=20utilisent=20Tab?= =?UTF-8?q?Manager=20+=20drag-to-split=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug 1 — bookmarks/récents sans tab: dashboard.js:135: openFile() → TabManager.openPreview() _createCard() est partagé par DashboardRecentWidget ET DashboardBookmarkWidget Bug 2 — drag-to-split bloqué en single-pane: La condition 'if (dragData.paneId === paneId) return' empêchait le split car en single-pane, le drag part du pane 0 et drop sur le pane 0. → Supprimé. Edge detection vérifiée avant, cross-pane vérifié après. Même pane + pas edge → laissé au tab handler (reorder). --- frontend/js/dashboard.js | 4 ++-- frontend/js/pane-manager.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/js/dashboard.js b/frontend/js/dashboard.js index 697a908..a68f2ba 100644 --- a/frontend/js/dashboard.js +++ b/frontend/js/dashboard.js @@ -330,9 +330,9 @@ const DashboardRecentWidget = { card.appendChild(footer); - // Click handler + // Click handler — open in tab system (not raw openFile) card.addEventListener("click", () => { - openFile(file.vault, file.path); + TabManager.openPreview(file.vault, file.path); }); return card; diff --git a/frontend/js/pane-manager.js b/frontend/js/pane-manager.js index 1686f9b..461ca02 100644 --- a/frontend/js/pane-manager.js +++ b/frontend/js/pane-manager.js @@ -804,7 +804,6 @@ const PaneManager = { try { const dragData = JSON.parse(raw); if (dragData.paneId == null || dragData.tabId == null) return; - if (dragData.paneId === paneId) return; // Same pane, tab handler deals with it // Recalculate edge zone from drop coordinates const rect = container.getBoundingClientRect(); @@ -824,9 +823,11 @@ const PaneManager = { const newPaneId = this.panes.length - 1; this.transferTab(dragData.paneId, dragData.tabId, newPaneId); }, 200); - } else { + } else if (dragData.paneId !== paneId) { + // Cross-pane transfer (already in split mode, different panes) this.transferTab(dragData.paneId, dragData.tabId, paneId); } + // else: same pane, not edge — tab handler deals with reorder } catch (e2) { console.debug('PaneManager drop error:', e2); } }); },