Skip to content

Commit 4076dba

Browse files
Update width to hide sidebar and sim initial width (#962)
1 parent 32739b2 commit 4076dba

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/common/screenWidthUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: MIT
55
*/
66

7-
export const widthToHideSidebar = 1376;
7+
export const widthToHideSidebar = 1365;
88
export const sidebarToWidthRatio = 0.27;
9-
export const hideSidebarMediaQuery = `(max-width: ${widthToHideSidebar - 1}px)`;
9+
export const simulatorToWidthRatio = 0.29;
10+
export const hideSidebarMediaQuery = `(max-width: ${widthToHideSidebar}px)`;

src/workbench/Workbench.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useIntl } from "react-intl";
1010
import {
1111
hideSidebarMediaQuery,
1212
sidebarToWidthRatio,
13+
simulatorToWidthRatio,
1314
widthToHideSidebar,
1415
} from "../common/screenWidthUtils";
1516
import {
@@ -188,6 +189,13 @@ const EditorWithSimulator = ({
188189
minimums={simulatorMinimums}
189190
height="100%"
190191
mode={simulatorShown ? "open" : "collapsed"}
192+
initialSize={Math.min(
193+
350,
194+
Math.max(
195+
simulatorMinimums[0],
196+
Math.floor(window.innerWidth * simulatorToWidthRatio)
197+
)
198+
)}
191199
>
192200
<SplitViewRemainder>
193201
<Editor editor={editor} />

0 commit comments

Comments
 (0)