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:
lrnselfreliance 2026-08-13 13:06:18 -06:00 • committed by GitHub
parent 67c3afbec9
commit 82fdf9dd92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 160 additions and 8 deletions

View file

@ -166,6 +166,7 @@ export function ThemeSamplePage() {
const [logLevel, setLogLevel] = useState(3);
const [dismissed, setDismissed] = useState(false);
const [modalOpen, setModalOpen] = useState(false);
const [fullModalOpen, setFullModalOpen] = useState(false);
const [realColors, setRealColors] = useState(false);
const [search, setSearch] = useState('');
const [activeTab, setActiveTab] = useState('Videos');
@ -1003,11 +1004,33 @@ export function ThemeSamplePage() {
<Panel>
<Row>
<Button role='cancel' icon='eye' onClick={() => setModalOpen(true)}>Open a modal</Button>
<Button role='cancel' icon='expand arrows alternate' onClick={() => setFullModalOpen(true)}>
Open a fullscreen modal
</Button>
</Row>
<p style={{fontSize: '0.75rem', color: 'var(--muted)', marginBottom: 0, marginTop: 10}}>
A modal is compound — Modal.Header, Modal.Content, Modal.Actions — so the
markup at a call site reads the way the dialog is laid out.
</p>
<p style={{fontSize: '0.75rem', color: 'var(--muted)', marginBottom: 0, marginTop: 10}}>
<code>fullScreen</code> is for a dialog whose content wants the room — a drop
target, a directory browser, a log. It is edge to edge on a phone and 90% on a
desktop, where filling the screen would read as the app having been replaced
rather than as something opened over it. Note that the <code>fullscreen</code>
<em>size</em> is a different thing: full width, height still from the content.
</p>
<Modal open={fullModalOpen} onClose={() => setFullModalOpen(false)} fullScreen>
<Modal.Header>Upload to: /media/wrolpi</Modal.Header>
<Modal.Content>
<p style={{marginTop: 0}}>
The body takes the leftover height, so the actions sit at the foot of
the dialog rather than wherever the content happened to end.
</p>
</Modal.Content>
<Modal.Actions>
<Button role='cancel' onClick={() => setFullModalOpen(false)}>Close</Button>
</Modal.Actions>
</Modal>
<Modal open={modalOpen} onClose={() => setModalOpen(false)} size='small'>
<Modal.Header>Restore Backup: channels.yaml</Modal.Header>
<Modal.Content>