diff --git a/src/common/screenWidthUtils.ts b/src/common/screenWidthUtils.ts index 4c5f4c37a..7c76c951a 100644 --- a/src/common/screenWidthUtils.ts +++ b/src/common/screenWidthUtils.ts @@ -4,6 +4,7 @@ * SPDX-License-Identifier: MIT */ -export const widthToHideSidebar = 1376; +export const widthToHideSidebar = 1365; export const sidebarToWidthRatio = 0.27; -export const hideSidebarMediaQuery = `(max-width: ${widthToHideSidebar - 1}px)`; +export const simulatorToWidthRatio = 0.29; +export const hideSidebarMediaQuery = `(max-width: ${widthToHideSidebar}px)`; diff --git a/src/workbench/Workbench.tsx b/src/workbench/Workbench.tsx index 127a5d4c3..e68f2d705 100644 --- a/src/workbench/Workbench.tsx +++ b/src/workbench/Workbench.tsx @@ -10,6 +10,7 @@ import { useIntl } from "react-intl"; import { hideSidebarMediaQuery, sidebarToWidthRatio, + simulatorToWidthRatio, widthToHideSidebar, } from "../common/screenWidthUtils"; import { @@ -188,6 +189,13 @@ const EditorWithSimulator = ({ minimums={simulatorMinimums} height="100%" mode={simulatorShown ? "open" : "collapsed"} + initialSize={Math.min( + 350, + Math.max( + simulatorMinimums[0], + Math.floor(window.innerWidth * simulatorToWidthRatio) + ) + )} >