Skip to content

Commit 19ba670

Browse files
committed
fix: blank gap below status bar when plugin side panel opens in browser
When a plugin side panel (e.g. live preview) opens, the content area narrows, causing the titlebar menubar items to wrap to multiple lines. This transiently inflates the titlebar height (~35px → ~92px), and multiple synchronous layout calculations run during this state, sizing the editor too small. After the titlebar settles (~58px), a ~34px blank gap remains below the status bar. Add a ResizeObserver on the titlebar that detects height changes and triggers a layout recomputation, correcting the editor size after the titlebar wrapping settles.
1 parent b190327 commit 19ba670

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/view/WorkspaceManager.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,24 @@ define(function (require, exports, module) {
457457
// listen for resize here.
458458
listenToResize($("#sidebar"));
459459
listenToResize($("#main-toolbar"));
460+
461+
// In the browser, the #titlebar contains the menubar and filename which can wrap to
462+
// multiple lines when the .content area narrows (e.g. when a plugin side panel opens).
463+
// The wrapping causes a transient height change that settles asynchronously after JS
464+
// recalculates the title-wrapper width. A ResizeObserver catches the settled height
465+
// and triggers a layout recomputation so the editor fills the correct space.
466+
let _titlebarHeight = $("#titlebar").outerHeight();
467+
const titlebarEl = document.getElementById("titlebar");
468+
if (titlebarEl) {
469+
const titlebarObserver = new ResizeObserver(function () {
470+
let newHeight = $("#titlebar").outerHeight();
471+
if (newHeight !== _titlebarHeight) {
472+
_titlebarHeight = newHeight;
473+
triggerUpdateLayout();
474+
}
475+
});
476+
titlebarObserver.observe(titlebarEl);
477+
}
460478
});
461479

462480
/**

0 commit comments

Comments
 (0)