From 88d5d5528384ead9fcef957c42862460222907fa Mon Sep 17 00:00:00 2001 From: lrnselfreliance <33263708+lrnselfreliance@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:03:17 -0600 Subject: [PATCH] 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 * tags: the add-tag button is violet like every other tag button Co-Authored-By: Claude Fable 5 * 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 --------- Co-authored-by: Claude Fable 5 --- app/src/App.css | 12 ++++++++++++ app/src/Tags.js | 4 +++- app/src/components/FilePreview.js | 6 ++---- app/src/components/Nav.js | 2 +- app/src/components/Share.js | 16 +++++++++++----- app/src/components/ui/ui-layout.cy.js | 2 +- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/src/App.css b/app/src/App.css index ddc10ad3..d0f46346 100644 --- a/app/src/App.css +++ b/app/src/App.css @@ -266,6 +266,10 @@ pre.wrap-text { flex-wrap: wrap; align-items: center; gap: 0.5em; + /* Fill the actions row: `.wrolpi-modal-actions` packs its children to the right, which + is where a confirming button belongs but strands this toolbar. At full width the + toolbar's own layout wins and everything reads from the left. */ + flex: 1 1 100%; } .preview-toolbar-group { @@ -281,6 +285,14 @@ pre.wrap-text { min-width: 0; } +/* On a phone the tags selector always gets its own line rather than squeezing in beside + the buttons. 700px is the app's `tablet` breakpoint (`AppMedia` in contexts.js). */ +@media (max-width: 699px) { + .preview-toolbar-tags { + flex-basis: 100%; + } +} + /* Caps preview content to fit inside the file-preview Modal. 300px reserves room for pathContent
, Modal.Header, Modal.Actions row,
    inner content (e.g. STL dimensions banner), and modal padding.
diff --git a/app/src/Tags.js b/app/src/Tags.js
index 5ebc6d1f..107d7316 100644
--- a/app/src/Tags.js
+++ b/app/src/Tags.js
@@ -583,7 +583,9 @@ export function AddTagsButton({
          handleClose(e)}
@@ -567,6 +567,7 @@ export function FilePreviewProvider({children}) {
             
                 
+ {openButton} {downloadButton} {directoryButton} @@ -576,9 +577,6 @@ export function FilePreviewProvider({children}) { title='Add to Playlist'/>}
{tagsDisplay}
-
- {openButton} -
{content} diff --git a/app/src/components/Nav.js b/app/src/components/Nav.js index a74cf7fd..8b3c1117 100644 --- a/app/src/components/Nav.js +++ b/app/src/components/Nav.js @@ -432,7 +432,7 @@ export function NavBar() { {driveHealthIcon} {powerIcon} {warningIcon} - + ; diff --git a/app/src/components/Share.js b/app/src/components/Share.js index cf31c14d..f04bf21f 100644 --- a/app/src/components/Share.js +++ b/app/src/components/Share.js @@ -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}) => { } -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 = () => { - - - + {asIcon + ? + + + : } } diff --git a/app/src/components/ui/ui-layout.cy.js b/app/src/components/ui/ui-layout.cy.js index 616668a0..4020ded4 100644 --- a/app/src/components/ui/ui-layout.cy.js +++ b/app/src/components/ui/ui-layout.cy.js @@ -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 = ; + const corner = ; const triggers = { share: '.wrolpi-navbar-icon a',