Skip to content

Commit 12ddbab

Browse files
author
Jason Moggridge
committed
FIX: Initial split size was not obeyed
1 parent d87f697 commit 12ddbab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/frontend/src/page/document_page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ type AnyLiveDocWithRef = {
5151
docRef: DocRef;
5252
};
5353

54+
// The initial size of the right panel in a split as a percentage of the total available width
55+
const INITIAL_SPLIT_SIZE = 0.33;
56+
5457
export default function DocumentPage() {
5558
const api = useApi();
5659
const models = useContext(ModelLibraryContext);
@@ -100,7 +103,7 @@ export default function DocumentPage() {
100103
const context = resizableContext();
101104
if (isSidePanelOpen()) {
102105
context?.expand(1);
103-
context?.resize(1, 0.33);
106+
context?.resize(1, INITIAL_SPLIT_SIZE);
104107
} else {
105108
context?.collapse(1);
106109
context?.resize(0, 1);
@@ -163,6 +166,7 @@ export default function DocumentPage() {
163166
<ResizableHandle class="resizeable-handle" />
164167
<Resizable.Panel
165168
class="content-panel"
169+
initialSize={INITIAL_SPLIT_SIZE}
166170
minSize={0.25}
167171
onCollapse={closeSidePanel}
168172
>

0 commit comments

Comments
 (0)