Keep desktop sidebar controls stable across panel changes (#2078)
* fix(app): stabilize desktop sidebar controls Keep the left-window-controls toggle mounted across sidebar state changes so its position and tooltip state remain stable. Preserve browser placement and show an explicit Explorer close control only where native right-side controls do not provide one. * fix(app): suppress inactive sidebar chrome
This commit is contained in:
@@ -8,6 +8,23 @@ import {
|
||||
|
||||
export const MIN_DESKTOP_CENTER_WIDTH = 400;
|
||||
|
||||
export function resolveDesktopAppChromeLayout(input: {
|
||||
desktopSidebarRendered: boolean;
|
||||
hasTopLeftWindowControls: boolean;
|
||||
sidebarControlsEnabled: boolean;
|
||||
}) {
|
||||
const sidebarOwnsTopLeft = input.desktopSidebarRendered && input.hasTopLeftWindowControls;
|
||||
let sidebarToggleOwner: "none" | "window" | "content" = "none";
|
||||
if (input.sidebarControlsEnabled) {
|
||||
sidebarToggleOwner = input.hasTopLeftWindowControls ? "window" : "content";
|
||||
}
|
||||
return {
|
||||
sidebarCorners: sidebarOwnsTopLeft ? ("top-left" as const) : ("none" as const),
|
||||
contentCorners: sidebarOwnsTopLeft ? ("top-right" as const) : ("both" as const),
|
||||
sidebarToggleOwner,
|
||||
};
|
||||
}
|
||||
|
||||
function resolveDesktopPanelWidth(input: {
|
||||
requestedWidth: number;
|
||||
viewportWidth: number;
|
||||
|
||||
Reference in New Issue
Block a user