Skip to content

Commit a7a6846

Browse files
devvaannshabose
authored andcommitted
fix: previously maximized state is not maintained when bottom panel is opened
1 parent 081146d commit a7a6846

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/view/PanelView.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,11 @@ define(function (require, exports, module) {
505505
}
506506
});
507507

508-
// Hide-panel button collapses the container but keeps tabs intact
508+
// Hide-panel button collapses the container but keeps tabs intact.
509+
// Maximize state is preserved so the panel re-opens maximized.
509510
_$tabBar.on("click", ".bottom-panel-hide-btn", function (e) {
510511
e.stopPropagation();
511512
if (_$container.is(":visible")) {
512-
restoreIfMaximized();
513513
Resizer.hide(_$container[0]);
514514
}
515515
});
@@ -527,6 +527,19 @@ define(function (require, exports, module) {
527527
}
528528
_toggleMaximize();
529529
});
530+
531+
// When the container re-expands after being minimized, re-apply
532+
// maximize if the user had maximized before minimizing.
533+
// The Resizer restores the saved (maximized) height automatically,
534+
// so we only need to update the button icon and recompute layout.
535+
_$container.on("panelExpanded", function () {
536+
if (_isMaximized) {
537+
_updateMaximizeButton();
538+
if (_recomputeLayout) {
539+
_recomputeLayout();
540+
}
541+
}
542+
});
530543
}
531544

532545
/**

src/view/WorkspaceManager.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ define(function (require, exports, module) {
390390
$statusBarPanelToggle.on("click", function () {
391391
_statusBarToggleInProgress = true;
392392
if ($bottomPanelContainer.is(":visible")) {
393-
PanelView.restoreIfMaximized();
394393
Resizer.hide($bottomPanelContainer[0]);
395394
triggerUpdateLayout();
396395
} else if (PanelView.getOpenBottomPanelIDs().length > 0) {
@@ -421,7 +420,6 @@ define(function (require, exports, module) {
421420
});
422421

423422
$bottomPanelContainer.on("panelCollapsed", function () {
424-
PanelView.exitMaximizeOnResize();
425423
$statusBarPanelToggle.find("i")
426424
.removeClass("fa-chevron-down")
427425
.addClass("fa-chevron-up");
@@ -634,9 +632,9 @@ define(function (require, exports, module) {
634632
}
635633

636634
function _handleEscapeKey() {
637-
// Collapse the entire bottom panel container, keeping all tabs intact
635+
// Collapse the entire bottom panel container, keeping all tabs intact.
636+
// Maximize state is preserved so the panel re-opens maximized.
638637
if ($bottomPanelContainer && $bottomPanelContainer.is(":visible")) {
639-
PanelView.restoreIfMaximized();
640638
Resizer.hide($bottomPanelContainer[0]);
641639
triggerUpdateLayout();
642640
return true;

0 commit comments

Comments
 (0)