De-template the frontend and apply the design system
- FastAPI branding replaced throughout: title, favicon, logo (now the org/ brand SVGs), footer links, route titles; workspace package renamed - shadcn primitives restyled to the component radius/shadow map: pill controls, rounded-lg surfaces, shadow-e1/e2/e3 - floating frosted AppSidebar over a bg-card content region - theme storage key aligned with the pre-paint script, MotionConfig added - scripts/capture-screenshots.mjs backs the root 'make verify' Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
bd2155603e
commit
5988822053
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Visual verification for the integrated local stack (root `make verify`).
|
||||
*
|
||||
* Logs into the dashboard with the bootstrap superuser and captures the app
|
||||
* shell plus the website hero in both themes. This is the standard "did the
|
||||
* change actually work" gate — look at the PNGs, do not just trust the build.
|
||||
*
|
||||
* Env (all set by the root Makefile):
|
||||
* APP_URL, WEBSITE_URL, FIRST_SUPERUSER, FIRST_SUPERUSER_PASSWORD
|
||||
* SCREENSHOT_DIR (default: ./screenshots)
|
||||
*/
|
||||
import { mkdir } from "node:fs/promises"
|
||||
import { chromium } from "@playwright/test"
|
||||
|
||||
const APP_URL = process.env.APP_URL || "http://app.localhost"
|
||||
const WEBSITE_URL = process.env.WEBSITE_URL || "http://localhost"
|
||||
const EMAIL = process.env.FIRST_SUPERUSER
|
||||
const PASSWORD = process.env.FIRST_SUPERUSER_PASSWORD
|
||||
const OUT = process.env.SCREENSHOT_DIR || "screenshots"
|
||||
|
||||
if (!EMAIL || !PASSWORD) {
|
||||
console.error(
|
||||
"FIRST_SUPERUSER / FIRST_SUPERUSER_PASSWORD are unset — run from the root `make verify`.",
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
/** Force the theme through the same storage key the pre-paint script reads. */
|
||||
async function withTheme(browser, theme) {
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: 1440, height: 900 },
|
||||
colorScheme: theme,
|
||||
})
|
||||
await context.addInitScript((t) => {
|
||||
localStorage.setItem("fluksio-ui-theme", t)
|
||||
}, theme)
|
||||
return context
|
||||
}
|
||||
|
||||
const browser = await chromium.launch()
|
||||
|
||||
for (const theme of ["light", "dark"]) {
|
||||
const dir = `${OUT}/${theme}`
|
||||
await mkdir(dir, { recursive: true })
|
||||
const context = await withTheme(browser, theme)
|
||||
const page = await context.newPage()
|
||||
|
||||
await page.goto(`${WEBSITE_URL}/`, { waitUntil: "networkidle" })
|
||||
await page.screenshot({ path: `${dir}/website-hero.png` })
|
||||
|
||||
await page.goto(`${APP_URL}/login`, { waitUntil: "networkidle" })
|
||||
await page.screenshot({ path: `${dir}/app-login.png` })
|
||||
|
||||
await page.getByPlaceholder(/email/i).fill(EMAIL)
|
||||
await page.getByPlaceholder(/password/i).fill(PASSWORD)
|
||||
await page.getByRole("button", { name: /log in/i }).click()
|
||||
await page.waitForURL(`${APP_URL}/`, { timeout: 15000 })
|
||||
await page.waitForLoadState("networkidle")
|
||||
await page.screenshot({ path: `${dir}/app-dashboard.png` })
|
||||
|
||||
await context.close()
|
||||
console.log(` wrote ${dir}/{website-hero,app-login,app-dashboard}.png`)
|
||||
}
|
||||
|
||||
await browser.close()
|
||||
Reference in New Issue
Block a user