From a265c877db142d934e9986da5a2b6a9645847103 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 4 Dec 2026 21:19:45 +1300 Subject: [PATCH] Gallery: the full-size view's header in two rows on a phone; "Screenshots by VisualCI" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The view's × moves out of its controls, beside the title, so under 40rem the header is the title with × and then one row of switches with ‹ ›, leaving the image more room. The credit line reads "Screenshots by VisualCI" (still the credit option, on by default). The strip's scroll buttons get a firmer shadow (--vg-float-shadow) so they stay legible over a busy screenshot. Every renderer and the golden fixtures follow. --- clients/gallery/contract/SPEC.md | 6 ++--- .../contract/fixtures/duplicates/gallery.html | 4 +-- .../contract/fixtures/escaping/gallery.html | 4 +-- .../contract/fixtures/fleetlayer/gallery.html | 4 +-- .../fixtures/group-order/gallery.html | 4 +-- .../contract/fixtures/page-theme/gallery.html | 4 +-- .../fixtures/single-group/gallery.html | 2 +- .../contract/fixtures/strip/gallery.html | 2 +- .../contract/fixtures/visualci/gallery.html | 4 +-- .../contract/fixtures/widths/gallery.html | 4 +-- clients/gallery/js/src/gallery.css | 25 ++++++++++++++++++- clients/gallery/js/src/model.ts | 2 +- clients/gallery/js/src/render.ts | 5 ++-- .../python/src/visualci_gallery/_render.py | 5 ++-- .../ruby/lib/visualci/gallery/renderer.rb | 5 ++-- clients/gallery/rust/src/render.rs | 7 ++---- 16 files changed, 55 insertions(+), 32 deletions(-) diff --git a/clients/gallery/contract/SPEC.md b/clients/gallery/contract/SPEC.md index a6c83bff..8f48d6ee 100644 --- a/clients/gallery/contract/SPEC.md +++ b/clients/gallery/contract/SPEC.md @@ -24,7 +24,7 @@ change, and regenerate the fixtures (`UPDATE_GOLDEN=1 pnpm test` in `../js`), re | `order` | `[]` | Screen keys in the order they show. | | `groups` | `{}` | `{"": {title?, size?, fit?}}`: a title over the manifest's; `size` (`"desktop"` or `"phone"`), the size of the group's shots whose names give no width, over the image's shape; `fit`, `"cover"` (the default: the image fills its card, cropped at the bottom) or `"contain"` (shown whole and centred, for a Mac app's windows). | | `groupOrder` | `[]` | Group names in the order they show. | - | `credit` | `true` | The "Powered by VisualCI" line. | + | `credit` | `true` | The "Screenshots by VisualCI" line; false leaves it out. | | `layout` | `"grid"` | `"grid"` or `"strip"`. | | `themeSwitch` | `true` | Light and Dark buttons. Always false for the strip. | | `seeAll` | `null` | `{href, text?}`: a link under the gallery; `text` defaults to "See all screenshots". | @@ -167,9 +167,9 @@ the default text), `headingLevel`, `id`, `credit` as above. [{title} when title isn't null] … the grid's or the strip's lines … [

{seeAll.text}

when seeAll] -[

Screenshot Gallery Powered by VisualCI.com

when credit] +[

Screenshots by VisualCI

when credit] -
{THEMES if themeSwitch}{SIZES(desktop phone, " vg-box-sizes") if grid}{STEP(-1)}{STEP(1)}{CLOSE}
+
{THEMES if themeSwitch}{SIZES(desktop phone, " vg-box-sizes") if grid}{STEP(-1)}{STEP(1)}
{CLOSE}
diff --git a/clients/gallery/contract/fixtures/duplicates/gallery.html b/clients/gallery/contract/fixtures/duplicates/gallery.html index 53a5ffad..e14f1e07 100644 --- a/clients/gallery/contract/fixtures/duplicates/gallery.html +++ b/clients/gallery/contract/fixtures/duplicates/gallery.html @@ -30,9 +30,9 @@
  • Y, desktop, lightY, desktop, dark

    Y

  • -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/contract/fixtures/escaping/gallery.html b/clients/gallery/contract/fixtures/escaping/gallery.html index 6ead4aab..dddc2109 100644 --- a/clients/gallery/contract/fixtures/escaping/gallery.html +++ b/clients/gallery/contract/fixtures/escaping/gallery.html @@ -23,9 +23,9 @@

    Shots <& "friends">

  • X, phone, lightX, phone, dark

    X

  • -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/contract/fixtures/fleetlayer/gallery.html b/clients/gallery/contract/fixtures/fleetlayer/gallery.html index 7320899b..07f5991a 100644 --- a/clients/gallery/contract/fixtures/fleetlayer/gallery.html +++ b/clients/gallery/contract/fixtures/fleetlayer/gallery.html @@ -28,9 +28,9 @@
  • Proposal, desktop, lightProposal, desktop, dark

    Proposal

  • -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/contract/fixtures/group-order/gallery.html b/clients/gallery/contract/fixtures/group-order/gallery.html index ec634cfb..1f8fd389 100644 --- a/clients/gallery/contract/fixtures/group-order/gallery.html +++ b/clients/gallery/contract/fixtures/group-order/gallery.html @@ -23,9 +23,9 @@

    Screenshots

  • A, phone, lightA, phone, dark

    A

  • -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/contract/fixtures/page-theme/gallery.html b/clients/gallery/contract/fixtures/page-theme/gallery.html index 575ba9f1..c07dc30f 100644 --- a/clients/gallery/contract/fixtures/page-theme/gallery.html +++ b/clients/gallery/contract/fixtures/page-theme/gallery.html @@ -19,9 +19,9 @@

    Screens

    Every screen

    -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/contract/fixtures/single-group/gallery.html b/clients/gallery/contract/fixtures/single-group/gallery.html index e0071c55..57cc31b1 100644 --- a/clients/gallery/contract/fixtures/single-group/gallery.html +++ b/clients/gallery/contract/fixtures/single-group/gallery.html @@ -8,7 +8,7 @@

    Product tour

    -

    +

    diff --git a/clients/gallery/contract/fixtures/strip/gallery.html b/clients/gallery/contract/fixtures/strip/gallery.html index 168369e7..c31fbb93 100644 --- a/clients/gallery/contract/fixtures/strip/gallery.html +++ b/clients/gallery/contract/fixtures/strip/gallery.html @@ -13,7 +13,7 @@

    See all screenshots

    -

    +

    diff --git a/clients/gallery/contract/fixtures/visualci/gallery.html b/clients/gallery/contract/fixtures/visualci/gallery.html index d526934b..7a0514bd 100644 --- a/clients/gallery/contract/fixtures/visualci/gallery.html +++ b/clients/gallery/contract/fixtures/visualci/gallery.html @@ -18,9 +18,9 @@

    Screenshots

  • Account, phone, lightAccount, phone, dark

    Account

  • -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/contract/fixtures/widths/gallery.html b/clients/gallery/contract/fixtures/widths/gallery.html index 5e8fe8d4..cbe46a8e 100644 --- a/clients/gallery/contract/fixtures/widths/gallery.html +++ b/clients/gallery/contract/fixtures/widths/gallery.html @@ -5,9 +5,9 @@
  • Home, desktop, lightHome, desktop, darkHome, phone, lightHome, phone, dark

    Home

  • -

    Screenshot Gallery Powered by VisualCI.com

    +

    Screenshots by VisualCI

    -

    +

    diff --git a/clients/gallery/js/src/gallery.css b/clients/gallery/js/src/gallery.css index fda96173..adb85df3 100644 --- a/clients/gallery/js/src/gallery.css +++ b/clients/gallery/js/src/gallery.css @@ -16,6 +16,8 @@ --vg-radius-lg: 12px; --vg-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08); --vg-backdrop: rgb(0 0 0 / 0.6); + /* The strip's scroll buttons, over a screenshot. */ + --vg-float-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 2px 10px rgb(0 0 0 / 0.3); --vg-rule-width: 1px; --vg-gap: 1.5rem; --vg-card-min: 22rem; @@ -275,7 +277,7 @@ top: calc(50% - 1.5rem); z-index: 1; background: var(--vg-paper); - box-shadow: var(--vg-shadow); + box-shadow: var(--vg-float-shadow); } .vg-strip-prev { left: 0.25rem; @@ -335,10 +337,31 @@ border-bottom: var(--vg-rule-width) solid var(--vg-rule); } .vg-box-title { + flex: 1; font-size: 1.25rem; font-weight: 600; color: var(--vg-ink); } +/* On a narrow screen the header is two rows: the title with ‹ › × beside it, then the switches. */ +@media (max-width: 40rem) { + .vg-box-bar { + column-gap: 0.5rem; + } + .vg-box-bar .vg-controls { + display: contents; + } + .vg-box-bar .vg-icon { + order: 1; + } + .vg-box-bar:has(.vg-seg:not([hidden]))::after { + content: ""; + order: 2; + flex-basis: 100%; + } + .vg-box-bar .vg-seg { + order: 3; + } +} .vg-box-view { overflow: auto; padding: 1rem; diff --git a/clients/gallery/js/src/model.ts b/clients/gallery/js/src/model.ts index af24fdcb..5d9552c1 100644 --- a/clients/gallery/js/src/model.ts +++ b/clients/gallery/js/src/model.ts @@ -56,7 +56,7 @@ export interface Options { groups?: Record; /** Group names in the order they show; the rest follow in the manifest's order. */ groupOrder?: string[]; - /** The "Powered by VisualCI" line. Default true. */ + /** The "Screenshots by VisualCI" line. Default true. */ credit?: boolean; /** "grid" (default): tabs per group, a grid of cards. "strip": every screen in one row that scrolls sideways, for * a homepage band. */ diff --git a/clients/gallery/js/src/render.ts b/clients/gallery/js/src/render.ts index becb48f7..66c72093 100644 --- a/clients/gallery/js/src/render.ts +++ b/clients/gallery/js/src/render.ts @@ -93,7 +93,7 @@ export function render(model: Model): string { out.push(`

    ${escapeHtml(model.seeAll.text)}

    `); } if (model.credit) { - out.push('

    Screenshot Gallery Powered by VisualCI.com

    '); + out.push('

    Screenshots by VisualCI

    '); } out.push(``); out.push( @@ -103,8 +103,9 @@ export function render(model: Model): string { (model.layout === "grid" ? sizeSwitch(["desktop", "phone"], " vg-box-sizes") : "") + '' + '' + + "" + '' + - "", + "", ); out.push('
    '); out.push("
    "); diff --git a/clients/gallery/python/src/visualci_gallery/_render.py b/clients/gallery/python/src/visualci_gallery/_render.py index 449e339f..46911ab3 100644 --- a/clients/gallery/python/src/visualci_gallery/_render.py +++ b/clients/gallery/python/src/visualci_gallery/_render.py @@ -150,7 +150,7 @@ def h(offset: int) -> str: f'

    {escape(model["seeAll"]["text"])}

    ' ) if model["credit"]: - out.append('

    Screenshot Gallery Powered by VisualCI.com

    ') + out.append('

    Screenshots by VisualCI

    ') out.append(f'') out.append( f'
    <{h(below)} class="vg-box-title" id="{gid}-box-title">' @@ -159,8 +159,9 @@ def h(offset: int) -> str: + (_size_switch(["desktop", "phone"], " vg-box-sizes") if model["layout"] == "grid" else "") + '' + '' + + "
    " + '' - + "" + + "" ) out.append('
    ') out.append("
    ") diff --git a/clients/gallery/ruby/lib/visualci/gallery/renderer.rb b/clients/gallery/ruby/lib/visualci/gallery/renderer.rb index e8b00785..14faf92d 100644 --- a/clients/gallery/ruby/lib/visualci/gallery/renderer.rb +++ b/clients/gallery/ruby/lib/visualci/gallery/renderer.rb @@ -21,7 +21,7 @@ def call out << %(

    #{esc(see['text'])}

    ) end if @m['credit'] - out << '

    Screenshot Gallery Powered by VisualCI.com

    ' + out << '

    Screenshots by VisualCI

    ' end out << %() out << %(
    <#{h(@below)} class="vg-box-title" id="#{@id}-box-title">) + @@ -30,8 +30,9 @@ def call (@m['layout'] == 'grid' ? sizes(%w[desktop phone], ' vg-box-sizes') : '') + '' \ '' \ + '
    ' \ '' \ - '' + '' out << '
    ' out << '
    ' out << '' diff --git a/clients/gallery/rust/src/render.rs b/clients/gallery/rust/src/render.rs index 3d5a1836..69811a20 100644 --- a/clients/gallery/rust/src/render.rs +++ b/clients/gallery/rust/src/render.rs @@ -186,15 +186,12 @@ pub fn render_model(model: &Model) -> String { out.push(format!(r#"

    {}

    "#, escape(&see.href), escape(&see.text))); } if model.credit { - out.push( - r#"

    Screenshot Gallery Powered by VisualCI.com

    "# - .into(), - ); + out.push(r#"

    Screenshots by VisualCI

    "#.into()); } out.push(format!(r#""#)); let hb = h(below); out.push(format!( - r#"
    <{hb} class="vg-box-title" id="{id}-box-title">
    {}{}
    "#, + r#"
    <{hb} class="vg-box-title" id="{id}-box-title">
    {}{}
    "#, if model.theme_switch { theme_switch() } else { String::new() }, if model.layout == "grid" { size_switch(&["desktop", "phone"], " vg-box-sizes") } else { String::new() }, ));