files: left-align the preview toolbar (#698)

* files: left-align the preview toolbar, Open joins the button row

The modal actions row packs its children to the right, which suits a
confirming button but stranded the preview's toolbar. The toolbar now
fills the row so its buttons read from the left, with Open first in
the same row as Download. On phones the tags selector always takes its
own line instead of squeezing in beside the buttons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* tags: the add-tag button is violet like every other tag button

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* share: a real button everywhere but the navbar corner

The share trigger was a bare anchor-wrapped glyph, which matched the
navbar's other corner icons but looked out of place beside real buttons
in the file preview toolbar. It is an IconButton by default now; the
navbar keeps the bare glyph via asIcon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
lrnselfreliance 2026-09-03 16:03:17 -06:00 • committed by GitHub
parent 9b8ebdc9b3
commit 88d5d55283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 12 deletions

View file

@ -558,7 +558,7 @@ export function FilePreviewProvider({children}) {
// Single flex toolbar — same button order at every viewport size.
// `flex-wrap: wrap` lets the tags selector drop to a second line on narrow screens
// while the button groups stay together and in order: [file actions] [tags] [open/close].
// while the buttons stay together, Open first: [open + file actions] [tags].
setPreviewModal(<Modal size='fullscreen'
open={true}
onClose={e => handleClose(e)}
@ -567,6 +567,7 @@ export function FilePreviewProvider({children}) {
<Modal.Actions>
<div className='preview-toolbar'>
<div className='preview-toolbar-group'>
{openButton}
{downloadButton}
{directoryButton}
<ShareButton/>
@ -576,9 +577,6 @@ export function FilePreviewProvider({children}) {
title='Add to Playlist'/>}
</div>
<div className='preview-toolbar-tags'>{tagsDisplay}</div>
<div className='preview-toolbar-group'>
{openButton}
</div>
</div>
</Modal.Actions>
{content}

View file

@ -432,7 +432,7 @@ export function NavBar() {
<NavIconWrapper>{driveHealthIcon}</NavIconWrapper>
<NavIconWrapper>{powerIcon}</NavIconWrapper>
<NavIconWrapper>{warningIcon}</NavIconWrapper>
<NavIconWrapper><ShareButton/></NavIconWrapper>
<NavIconWrapper><ShareButton asIcon/></NavIconWrapper>
<NavIconWrapper><HotspotStatusIcon/></NavIconWrapper>
<NavIconWrapper><DarkModeToggle/></NavIconWrapper>
</React.Fragment>;

View file

@ -1,5 +1,5 @@
import React from "react";
import {Button, Header, Icon, Modal} from "./ui";
import {Button, Header, Icon, IconButton, Modal} from "./ui";
import QRCode from "react-qr-code";
import {sendNotification} from "../api";
@ -20,7 +20,11 @@ export const ShareEveryoneButton = ({url, size, onClick}) => {
</Button>
}
export const ShareButton = () => {
/*
* `asIcon` is for the navbar corner, where the trigger sits beside other bare glyphs and a
* boxed button would not match; everywhere else it is a real button, matching its siblings.
*/
export const ShareButton = ({asIcon = false}) => {
const [open, setOpen] = React.useState(false);
const handleOpen = (e) => {
@ -56,8 +60,10 @@ export const ShareButton = () => {
<Button role='cancel' onClick={handleClose}>Close</Button>
</Modal.Actions>
</Modal>
<a href='#' onClick={handleOpen}>
<Icon name='share' size='large'/>
</a>
{asIcon
? <a href='#' onClick={handleOpen}>
<Icon name='share' size='large'/>
</a>
: <IconButton icon='share' label='Share' size='small' onClick={handleOpen}/>}
</>
}

View file

@ -3941,7 +3941,7 @@ describe('the icon-only triggers in the navbar corner are reachable', () => {
* classes I expected the components to have, so reverting SearchIconButton to the old
* `item` left it green -- it was measuring my markup, not the app's.
*/
const corner = <NavIconWrapper><ShareButton/></NavIconWrapper>;
const corner = <NavIconWrapper><ShareButton asIcon/></NavIconWrapper>;
const triggers = {
share: '.wrolpi-navbar-icon a',