Skip to content

Commit badf2f0

Browse files
committed
fix: improved bottom panel architecture
1 parent e2493c0 commit badf2f0

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/view/PanelView.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ define(function (require, exports, module) {
681681
return false;
682682
}
683683
}
684-
this.hide();
684+
this.hide({ preferFallback: true });
685685
return true;
686686
};
687687

@@ -747,8 +747,9 @@ define(function (require, exports, module) {
747747
/**
748748
* Hides the panel
749749
*/
750-
Panel.prototype.hide = function () {
750+
Panel.prototype.hide = function (options) {
751751
let panelId = this.panelID;
752+
let preferFallback = !!(options && options.preferFallback);
752753

753754
// Quick Access panel is pinned — it stays in _openIds and the tab bar.
754755
// Hiding it collapses the bottom panel container entirely.
@@ -779,7 +780,9 @@ define(function (require, exports, module) {
779780
let wasActive = (_activeId === panelId);
780781
let activatedId = null;
781782

782-
if (wasActive && _openIds.length > 0) {
783+
let onlyDefaultLeft = (_openIds.length === 1 && _openIds[0] === _defaultPanelId);
784+
785+
if (wasActive && preferFallback && _openIds.length > 0 && !onlyDefaultLeft) {
783786
let nextIdx = Math.min(idx, _openIds.length - 1);
784787
activatedId = _openIds[nextIdx];
785788
_activeId = null;

src/view/WorkspaceManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ define(function (require, exports, module) {
821821
// buttons and menu items that mirror container visibility
822822
// (drawer, Git icon, etc.) need this signal to deselect.
823823
PanelView.collapseContainer();
824-
} else if (PanelView.getOpenBottomPanelIDs().length > 0) {
824+
} else if (PanelView.getActiveBottomPanel()) {
825825
// Use the helper so SHOWN(_activeId) fires — same listeners
826826
// need this signal to re-select after a previous collapse.
827827
PanelView.restoreContainer();

0 commit comments

Comments
 (0)