Skip to content

Gallery: the Astro component, visualci-astro-gallery (sc-9306) - #193

Merged
ndbroadbent merged 4 commits into
mainfrom
sc-9306-gallery-astro
Dec 4, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
sc-9306-gallery-astro

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Story: sc-9306 (epic sc-9295). Stacked on #189: GitHub retargets it to main when #189 merges.

What it adds

  • clients/gallery/astro: visualci-astro-gallery, an Astro component.
    • <Gallery manifest="https://app.visualci.com/g/<org>/<project>.json" {...options} /> reads the manifest when the site builds and renders the contract's markup.
    • Its script hydrates every gallery on the page. The component imports the library's stylesheet.
    • A manifest that can't be read, or has nothing to show, fails astro build. There's no fallback.
  • clients/gallery becomes a pnpm workspace (js, astro), with one lockfile. The component depends on visualci-gallery as workspace:^, which is published as a caret range.
  • .github/workflows/release-gallery-npm.yml publishes both packages from CI, with provenance, for a gallery-js-v* tag.
    • The first publish uses a temporary token: the NPM_TOKEN repo secret, also kept in 1Password (Nathan's Tasks sc-9327).
    • After that, both packages switch to npm trusted publishing, the secret is deleted and the token revoked.

Tests

  • astro/test/gallery.test.ts renders every contract fixture through Astro's container API and checks the failures.
  • astro/test/build.test.ts runs a real astro build of a small site with the fleetlayer fixture's manifest and options. It checks:
    • the golden markup;
    • the stylesheet link;
    • an external hydrating script, with no inline script.
  • CI's clients job now runs the workspace: the library's type check, every package's build, and every package's tests.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@visualci-com

visualci-com Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #699 · 510 unchanged · no changes

This PR vs base: 28 changed, 76 added since #540, across 5 builds

docspring/visualci · journeys · build #696 · 1 changed, 49 unchanged · approved by visualci coordinator agent (MCP) for Nathan Broadbent

Main's own dashboard change (on main unreviewed in #695), matching PR #185's approved change; not from this PR.

This PR vs base: 2 changed, 8 added since #537, across 6 builds

Snapshot Before After
journeys/sign-in-from-the-site/02-dashboard (changed)

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent force-pushed the sc-9306-gallery-astro branch from 59ccad9 to 6856e05 Compare December 4, 2026 08:43
@ndbroadbent
ndbroadbent force-pushed the sc-9297-gallery-js branch 2 times, most recently from 11adc64 to 9c8faf8 Compare December 4, 2026 11:33
@ndbroadbent
ndbroadbent force-pushed the sc-9306-gallery-astro branch from 6856e05 to cb8282d Compare December 4, 2026 11:43
@ndbroadbent
ndbroadbent changed the base branch from sc-9297-gallery-js to main December 4, 2026 11:43
@ndbroadbent
ndbroadbent force-pushed the sc-9306-gallery-astro branch 2 times, most recently from e57ccc5 to 6cb58e8 Compare December 4, 2026 12:35
<Gallery manifest=… /> fetches the manifest when the site builds, renders the contract's markup with
visualci-gallery's render(), and brings the default stylesheet and a module script that hydrates every gallery on the
page. A manifest that can't be read or has nothing to show fails the build. The props are the library's options and
load()'s.

clients/gallery is now a pnpm workspace (js, astro). Tests: every golden fixture through Astro's container API, the
two failures, and a real astro build of a small site whose page carries the golden markup, a stylesheet and the
script as files (no inline scripts).
Publishes visualci-gallery and visualci-astro-gallery from CI with provenance for a gallery-js-v* tag,
with the NPM_TOKEN secret until npm trusted publishing is set up. The component depends on
visualci-gallery with workspace:^, so it's published as a caret range.
The fleetlayer fixture's Mac approver tab needs its groups option, so the test site reads the whole
options.json rather than copying some of it.
…avigation

Under Astro's ClientRouter the component's script runs once per document, so a gallery on the next
page stayed dead. It now hydrates on astro:page-load too (hydrate ignores a gallery it already has)
and destroys the old page's galleries on astro:before-swap, so their listeners don't leak.
@ndbroadbent
ndbroadbent force-pushed the sc-9306-gallery-astro branch from 6cb58e8 to 53b5338 Compare December 4, 2026 12:48
@ndbroadbent
ndbroadbent merged commit ef8a7a9 into main Dec 4, 2026
16 checks passed
@ndbroadbent
ndbroadbent deleted the sc-9306-gallery-astro branch December 4, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant