Skip to content

Commit f303834

Browse files
committed
feat: escape key hides the bottom panel instead of destroying a panel
1 parent 64f1062 commit f303834

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

src/view/WorkspaceManager.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -588,28 +588,16 @@ define(function (require, exports, module) {
588588
}
589589

590590
function _handleEscapeKey() {
591-
// Hide the most recently shown bottom panel
592-
if (lastShownBottomPanelStack.length > 0) {
593-
let panelToHide = getPanelForID(lastShownBottomPanelStack.pop());
594-
// Guard: only hide if the panel is actually visible.
595-
if (panelToHide && panelToHide.isVisible()) {
596-
panelToHide.hide();
597-
return true;
598-
}
599-
}
600-
// Fallback: hide any visible bottom panel not tracked in the stack.
601-
let allPanelsIDs = getAllPanelIDs();
602-
for (let panelID of allPanelsIDs) {
603-
let panel = getPanelForID(panelID);
604-
if (panel.getPanelType() === PanelView.PANEL_TYPE_BOTTOM_PANEL && panel.isVisible()) {
605-
panel.hide();
606-
return true;
607-
}
591+
// Collapse the entire bottom panel container, keeping all tabs intact
592+
if ($bottomPanelContainer && $bottomPanelContainer.is(":visible")) {
593+
Resizer.hide($bottomPanelContainer[0]);
594+
triggerUpdateLayout();
595+
return true;
608596
}
609597
return false;
610598
}
611599

612-
// pressing escape when focused on editor will toggle the last opened bottom panel
600+
// pressing escape when focused on editor will hide the bottom panel container
613601
function _handleKeydown(event) {
614602
if(event.keyCode !== KeyEvent.DOM_VK_ESCAPE || KeyBindingManager.isInOverlayMode()){
615603
return;

0 commit comments

Comments
 (0)