feat(split-pane): auto-collapse split when either session ends

This commit is contained in:
timkjr
2026-09-20 13:10:26 -05:00
parent 2abf328db8
commit 8c73128cd6
3 changed files with 91 additions and 0 deletions
+14
View File
@@ -241,3 +241,17 @@ Object.assign(CodemanApp.prototype, {
});
},
});
const _originalOnSessionDeleted = CodemanApp.prototype._onSessionDeleted;
CodemanApp.prototype._onSessionDeleted = function (data) {
if (this._splitSessionId === data.id) {
this.closeSplitPane();
} else if (this._splitPane && this.activeSessionId === data.id) {
// Pane A's session ended: promote Pane B by closing the split and
// selecting its session as the new (single) active pane.
const promoted = this._splitSessionId;
this.closeSplitPane();
if (promoted) this.selectSession(promoted);
}
return _originalOnSessionDeleted.call(this, data);
};