fix: split view — plus de panneaux vides, transfert auto de l'onglet
CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 14s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 14s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
- _hasAnyTab(): empêche split si aucun onglet ouvert (tous les points d'entrée) - _copyActiveTabToNewPane(): copie l'onglet actif dans le nouveau panneau - Menu contextuel: l'onglet cliqué-droit est transféré dans le nouveau panneau - Raccourci clavier Ctrl+Alt+\: transfert l'onglet actif dans le nouveau panneau - Boutons split: vérifient _hasAnyTab() avant d'agir - Singleton ui.js: même comportement (split + transfert de l'onglet)
This commit is contained in:
+16
-2
@@ -2351,8 +2351,22 @@ export const TabManager = {
|
||||
|
||||
menu.addEventListener("click", (e) => {
|
||||
const action = e.target.closest(".context-menu-item")?.dataset.action;
|
||||
if (action === "splitRight") { if (window.PaneManager) { window.PaneManager.splitRight(); menu.remove(); return; } }
|
||||
else if (action === "splitDown") { if (window.PaneManager) { window.PaneManager.splitDown(); menu.remove(); return; } }
|
||||
if (action === "splitRight") {
|
||||
if (window.PaneManager && window.PaneManager._hasAnyTab && window.PaneManager._hasAnyTab()) {
|
||||
window.PaneManager.splitRight();
|
||||
const newPaneId = window.PaneManager.panes.length - 1;
|
||||
window.PaneManager.transferTab(0, tabId, newPaneId);
|
||||
menu.remove(); return;
|
||||
}
|
||||
}
|
||||
else if (action === "splitDown") {
|
||||
if (window.PaneManager && window.PaneManager._hasAnyTab && window.PaneManager._hasAnyTab()) {
|
||||
window.PaneManager.splitDown();
|
||||
const newPaneId = window.PaneManager.panes.length - 1;
|
||||
window.PaneManager.transferTab(0, tabId, newPaneId);
|
||||
menu.remove(); return;
|
||||
}
|
||||
}
|
||||
else if (action === "closePane") { if (window.PaneManager) { window.PaneManager.closeActivePane(); menu.remove(); return; } }
|
||||
else if (action === "close") this.close(tabId);
|
||||
else if (action === "closeOthers") this.closeOthers(tabId);
|
||||
|
||||
Reference in New Issue
Block a user