@@ -13,7 +13,7 @@ import remarkGfm from 'remark-gfm';
1313
1414import * as chatAPI from 'renderer/lib/transformerlab-api-sdk' ;
1515import { PencilIcon } from 'lucide-react' ;
16- import { Button , Typography } from '@mui/joy' ;
16+ import { Box , Button , Typography } from '@mui/joy' ;
1717import fairyflossTheme from '../Shared/fairyfloss.tmTheme.js' ;
1818
1919const { parseTmTheme } = require ( 'monaco-themes' ) ;
@@ -91,29 +91,40 @@ export default function ExperimentNotes({ experimentInfo }) {
9191 }
9292
9393 return (
94- < Sheet >
94+ < Sheet
95+ sx = { {
96+ height : '100%' ,
97+ display : 'flex' ,
98+ flexDirection : 'column' ,
99+ overflow : 'hidden' ,
100+ mb : 3 ,
101+ } }
102+ >
95103 < Typography level = "h1" > Experiment Notes</ Typography >
96104 { ! isEditing && (
97105 < Sheet
98106 color = "neutral"
99107 variant = "outlined"
100108 sx = { {
101- mt : 3 ,
102- minHeight : '300px' ,
103- minWidth : '600px' ,
109+ display : 'flex' ,
110+ flexDirection : 'column' ,
111+ mt : 1 ,
112+ height : '100%' ,
104113 p : 3 ,
105114 boxShadow :
106115 'rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px' ,
107116 } }
108117 className = "editableSheet"
109118 >
110119 { ! data && 'Write experiment notes here...' }
111- < Markdown
112- remarkPlugins = { [ remarkGfm ] }
113- className = "editableSheetContent"
114- >
115- { data }
116- </ Markdown >
120+ < Box display = "flex" sx = { { width : '100%' } } >
121+ < Markdown
122+ remarkPlugins = { [ remarkGfm ] }
123+ className = "editableSheetContent"
124+ >
125+ { data }
126+ </ Markdown >
127+ </ Box >
117128 < Button
118129 onClick = { ( ) => {
119130 setIsEditing ( true ) ;
@@ -122,8 +133,6 @@ export default function ExperimentNotes({ experimentInfo }) {
122133 mt : 1 ,
123134 ml : 'auto' ,
124135 position : 'absolute' ,
125- top : '30%' ,
126- left : '20%' ,
127136 } }
128137 variant = "solid"
129138 className = "hoverEditButton"
@@ -135,7 +144,14 @@ export default function ExperimentNotes({ experimentInfo }) {
135144 ) }
136145
137146 { isEditing && (
138- < >
147+ < Sheet
148+ sx = { {
149+ height : '100%' ,
150+ display : 'flex' ,
151+ flexDirection : 'column' ,
152+ overflow : 'hidden' ,
153+ } }
154+ >
139155 < Typography mt = { 3 } >
140156 Use{ ' ' }
141157 < a
@@ -150,13 +166,15 @@ export default function ExperimentNotes({ experimentInfo }) {
150166 color = "neutral"
151167 sx = { {
152168 p : 3 ,
169+ display : 'flex' ,
153170 backgroundColor : '#ddd' ,
171+ height : '100%' ,
154172 } }
155173 >
156174 < Editor
157- height = "600px"
158175 defaultLanguage = "markdown"
159176 theme = "my-theme"
177+ height = "100%"
160178 options = { {
161179 minimap : {
162180 enabled : false ,
@@ -168,22 +186,24 @@ export default function ExperimentNotes({ experimentInfo }) {
168186 onMount = { handleEditorDidMount }
169187 />
170188 </ Sheet >
171- < Button
172- onClick = { ( ) => {
173- saveValue ( ) ;
174- } }
175- sx = { { mt : 1 , ml : 'auto' } }
176- >
177- Save
178- </ Button >
179- < Button
180- variant = "soft"
181- sx = { { ml : '10px' } }
182- onClick = { ( ) => setIsEditing ( false ) }
183- >
184- Cancel
185- </ Button >
186- </ >
189+ < Box display = "flex" sx = { { width : '100%' } } >
190+ < Button
191+ onClick = { ( ) => {
192+ saveValue ( ) ;
193+ } }
194+ sx = { { mt : 1 , ml : 'auto' } }
195+ >
196+ Save
197+ </ Button >
198+ < Button
199+ variant = "soft"
200+ sx = { { ml : '10px' } }
201+ onClick = { ( ) => setIsEditing ( false ) }
202+ >
203+ Cancel
204+ </ Button >
205+ </ Box >
206+ </ Sheet >
187207 ) }
188208 </ Sheet >
189209 ) ;
0 commit comments