11import { useEffect , useCallback , useState , useRef } from 'react' ;
22import { ThemeProvider , createTheme , CssBaseline } from '@mui/material' ;
3- import { Box , AppBar , Toolbar , Typography , IconButton , Alert , Snackbar } from '@mui/material' ;
3+ import { Box , AppBar , Toolbar , Typography , IconButton , Alert , Snackbar , Tooltip } from '@mui/material' ;
44import InfoIcon from '@mui/icons-material/Info' ;
55import GitHubIcon from '@mui/icons-material/GitHub' ;
66import { MetadataProvider , useMetadataContext } from './context/MetadataContext' ;
@@ -229,34 +229,49 @@ function AppContent() {
229229
230230 if ( showWelcome ) {
231231 return (
232- < Box sx = { { display : 'flex' , flexDirection : 'column' , height : '100vh' } } >
232+ < Box sx = { { display : 'flex' , flexDirection : 'column' , height : '100vh' , width : '100%' , overflow : 'hidden' } } >
233233 { /* Minimal App Bar for welcome page */ }
234234 < AppBar position = "static" elevation = { 1 } >
235- < Toolbar variant = "dense" >
236- < Box component = "img" src = { logoIcon } alt = "Logo" sx = { { height : 24 , mr : 1 } } />
237- < Typography variant = "h6" component = "div" sx = { { flexGrow : 1 } } >
235+ < Toolbar variant = "dense" sx = { { minHeight : { xs : 48 , sm : 48 } , px : { xs : 1 , sm : 2 } } } >
236+ < Box component = "img" src = { logoIcon } alt = "Logo" sx = { { height : 24 , mr : { xs : 0.5 , sm : 1 } } } />
237+ < Typography
238+ variant = "h6"
239+ component = "div"
240+ sx = { {
241+ flexGrow : 1 ,
242+ fontSize : { xs : '0.9rem' , sm : '1.25rem' } ,
243+ whiteSpace : 'nowrap' ,
244+ overflow : 'hidden' ,
245+ textOverflow : 'ellipsis' ,
246+ mr : { xs : 0.5 , sm : 2 } ,
247+ display : { xs : 'none' , sm : 'block' }
248+ } }
249+ >
238250 Dandiset Metadata Assistant
239251 </ Typography >
252+ < Box sx = { { flexGrow : { xs : 1 , sm : 0 } } } />
240253 < IconButton
241254 color = "inherit"
242255 onClick = { ( ) => setAboutDialogOpen ( true ) }
243256 size = "small"
244- sx = { { mr : 1 } }
257+ sx = { { mr : { xs : 0.5 , sm : 1 } , flexShrink : 0 } }
245258 >
246259 < InfoIcon />
247260 </ IconButton >
248- < IconButton
249- color = "inherit"
250- component = "a"
251- href = "https://github.com/magland/dandiset-metadata-assistant"
252- target = "_blank"
253- rel = "noopener noreferrer"
254- size = "small"
255- sx = { { mr : 1 } }
256- >
257- < GitHubIcon />
258- </ IconButton >
259- < ApiKeyManager />
261+ < Box sx = { { flexShrink : 0 } } >
262+ < IconButton
263+ color = "inherit"
264+ component = "a"
265+ href = "https://github.com/magland/dandiset-metadata-assistant"
266+ target = "_blank"
267+ rel = "noopener noreferrer"
268+ size = "small"
269+ sx = { { mr : 1 } }
270+ >
271+ < GitHubIcon />
272+ </ IconButton >
273+ < ApiKeyManager />
274+ </ Box >
260275 </ Toolbar >
261276 </ AppBar >
262277
@@ -275,17 +290,38 @@ function AppContent() {
275290 }
276291
277292 return (
278- < Box sx = { { display : 'flex' , flexDirection : 'column' , height : '100vh' } } >
293+ < Box sx = { { display : 'flex' , flexDirection : 'column' , height : '100vh' , width : '100%' , overflow : 'hidden' } } >
279294 { /* App Bar with loaded dandiset */ }
280295 < AppBar position = "static" elevation = { 1 } >
281- < Toolbar variant = "dense" >
282- < Box component = "img" src = { logoIcon } alt = "Logo" sx = { { height : 24 , mr : 1 } } />
296+ < Toolbar variant = "dense" sx = { { minHeight : { xs : 48 , sm : 48 } , px : { xs : 1 , sm : 2 } } } >
297+ < Tooltip title = "Go to welcome screen" >
298+ < IconButton
299+ color = "inherit"
300+ onClick = { handleChangeDandiset }
301+ size = "small"
302+ sx = { {
303+ mr : { xs : 0.5 , sm : 1 } ,
304+ flexShrink : 0 ,
305+ display : { xs : 'inline-flex' , sm : 'none' }
306+ } }
307+ >
308+ < Box component = "img" src = { logoIcon } alt = "Logo" sx = { { height : 20 } } />
309+ </ IconButton >
310+ </ Tooltip >
311+ < Box component = "img" src = { logoIcon } alt = "Logo" sx = { { height : 24 , mr : { xs : 0.5 , sm : 1 } , display : { xs : 'none' , sm : 'block' } } } />
283312 < Typography
284313 variant = "h6"
285314 component = "div"
286315 sx = { {
287- mr : 3 ,
316+ mr : { xs : 1 , sm : 3 } ,
288317 cursor : 'pointer' ,
318+ fontSize : { xs : '0.9rem' , sm : '1.25rem' } ,
319+ whiteSpace : 'nowrap' ,
320+ overflow : 'hidden' ,
321+ textOverflow : 'ellipsis' ,
322+ flexShrink : 1 ,
323+ minWidth : 0 ,
324+ display : { xs : 'none' , sm : 'block' } ,
289325 '&:hover' : {
290326 opacity : 0.8 ,
291327 }
@@ -294,29 +330,31 @@ function AppContent() {
294330 >
295331 Dandiset Metadata Assistant
296332 </ Typography >
297- < Box sx = { { flexGrow : 1 } } >
333+ < Box sx = { { flexGrow : 1 , minWidth : 0 } } >
298334 < DandisetIndicator onChangeDandiset = { handleChangeDandiset } />
299335 </ Box >
300336 < IconButton
301337 color = "inherit"
302338 onClick = { ( ) => setAboutDialogOpen ( true ) }
303339 size = "small"
304- sx = { { mr : 1 } }
340+ sx = { { mr : { xs : 0.5 , sm : 1 } , flexShrink : 0 } }
305341 >
306342 < InfoIcon />
307343 </ IconButton >
308- < IconButton
309- color = "inherit"
310- component = "a"
311- href = "https://github.com/magland/dandiset-metadata-assistant"
312- target = "_blank"
313- rel = "noopener noreferrer"
314- size = "small"
315- sx = { { mr : 1 } }
316- >
317- < GitHubIcon />
318- </ IconButton >
319- < ApiKeyManager />
344+ < Box sx = { { flexShrink : 0 } } >
345+ < IconButton
346+ color = "inherit"
347+ component = "a"
348+ href = "https://github.com/magland/dandiset-metadata-assistant"
349+ target = "_blank"
350+ rel = "noopener noreferrer"
351+ size = "small"
352+ sx = { { mr : 1 } }
353+ >
354+ < GitHubIcon />
355+ </ IconButton >
356+ < ApiKeyManager />
357+ </ Box >
320358 </ Toolbar >
321359 </ AppBar >
322360
0 commit comments