mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 20:36:21 -05:00
ui: an upload target smaller than the dialog around it (#663)
The upload dialog was 682x367 on a 1440x900 desktop -- 47% of the width, 41% of the height -- and the drop target inside it was a strip about 90px tall. A small thing to drag a file onto, with the file browser it came from covering most of the screen behind. Upload and Move ask for `fullScreen`, which is edge to edge on a phone and 90% above the tablet breakpoint: filling a desktop reads as the app having been replaced rather than as something opened over it. Move holds a DirectorySearch above a row per path being moved, which grows with the selection; 620px showed a handful and scrolled the rest. Two things had to follow. Mantine sizes a fullscreen dialog's content to the viewport but leaves the body at its content height, so the footer landed two thirds up the screen with a quarter of the viewport empty beneath it -- the body takes the leftover now and the actions ride to the bottom of it. And the drop target itself grows into the room, with a floor so it stays large once progress bars claim their own space. Rename and the confirmations keep their sizes: a fullscreen dialog for one text field or one sentence reads as broken. New Folder keeps `large` too -- it is a text field and a path preview, the same shape as rename, not the directory picker its name suggests. `size='fullscreen'` is a DIFFERENT thing -- full width, height from the content, which is what a log or a preview wants. Both are documented where the sizes are declared, and the gallery grows a fullscreen example so the difference is visible in all four themes. 339 component tests pass, 69 suites / 1214 jest tests pass, npm run build is clean.
This commit is contained in:
parent
67c3afbec9
commit
82fdf9dd92
5 changed files with 160 additions and 8 deletions
|
|
@ -710,11 +710,11 @@ export function MoveModal({open, paths, onClose, onSubmit}) {
|
|||
</Table.Row>);
|
||||
|
||||
/*
|
||||
* Audited: `large` (620px). This dialog holds a DirectorySearch and a two-column
|
||||
* Source/Destination table of every path being moved, which is the densest content
|
||||
* of the five FileBrowser modals.
|
||||
* Fullscreen: a DirectorySearch above a two-column Source/Destination table of every
|
||||
* path being moved, which grows with the selection. 620px showed a handful of rows and
|
||||
* scrolled the rest.
|
||||
*/
|
||||
return <Modal size='large'
|
||||
return <Modal fullScreen
|
||||
onClose={onClose}
|
||||
open={open}
|
||||
>
|
||||
|
|
@ -925,7 +925,12 @@ export function FileBrowserUploadModal({open, onClose, destination, onComplete})
|
|||
|
||||
const displayPath = destination ? `${mediaDirectory}/${destination}` : mediaDirectory;
|
||||
|
||||
return <Modal open={open} onClose={handleClose} size='large'>
|
||||
/*
|
||||
* Fullscreen, for the drop target. At 620px the target was a strip about 90px tall in a
|
||||
* dialog covering a fifth of the screen -- a small thing to drag a file onto, and the
|
||||
* page behind it was the file browser it came from. Given the room, the target takes it.
|
||||
*/
|
||||
return <Modal open={open} onClose={handleClose} fullScreen>
|
||||
<Modal.Header>Upload to: {displayPath}</Modal.Header>
|
||||
<Modal.Content>
|
||||
<form onSubmit={e => e.preventDefault()}>
|
||||
|
|
@ -940,8 +945,26 @@ export function FileBrowserUploadModal({open, onClose, destination, onComplete})
|
|||
</div>
|
||||
</form>
|
||||
|
||||
<Panel style={{marginTop: '1em', padding: '1em'}}>
|
||||
<div {...getRootProps()} style={{cursor: 'pointer', textAlign: 'center'}}>
|
||||
{/* The target takes the room the dialog gives it rather than sitting as a strip
|
||||
at the top of it. `min-height` as well as `flex`, so it stays a large target
|
||||
once the progress bars below it start claiming their own space. */}
|
||||
<Panel style={{
|
||||
marginTop: '1em',
|
||||
padding: '1em',
|
||||
flex: '1 1 auto',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}}>
|
||||
<div {...getRootProps()}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
textAlign: 'center',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flex: '1 1 auto',
|
||||
minHeight: '30vh',
|
||||
}}>
|
||||
<input {...getInputProps()}/>
|
||||
<Header as='h4' icon='file text'>Click here, or drop files here to upload</Header>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue