Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

docs: refresh product screenshots from the current app

Andrej Acevski714695319d8e
diff --git a/apps/docs/images/product/board-dark.png b/apps/docs/images/product/board-dark.png
index 775f04841..f2a7a4504 100644
Binary files a/apps/docs/images/product/board-dark.png and b/apps/docs/images/product/board-dark.png differ
diff --git a/apps/docs/images/product/board-light.png b/apps/docs/images/product/board-light.png
index 652ac8f7e..4c34e5d42 100644
Binary files a/apps/docs/images/product/board-light.png and b/apps/docs/images/product/board-light.png differ
diff --git a/apps/docs/images/product/list-dark.png b/apps/docs/images/product/list-dark.png
index 77eb95a2d..53dd39739 100644
Binary files a/apps/docs/images/product/list-dark.png and b/apps/docs/images/product/list-dark.png differ
diff --git a/apps/docs/images/product/list-light.png b/apps/docs/images/product/list-light.png
index 7dd5d385e..ec03d1e06 100644
Binary files a/apps/docs/images/product/list-light.png and b/apps/docs/images/product/list-light.png differ
diff --git a/apps/docs/images/product/task-dark.png b/apps/docs/images/product/task-dark.png
index 5ac25909c..a1fe4df26 100644
Binary files a/apps/docs/images/product/task-dark.png and b/apps/docs/images/product/task-dark.png differ
diff --git a/apps/docs/images/product/task-light.png b/apps/docs/images/product/task-light.png
index 3781db2b1..cf416045f 100644
Binary files a/apps/docs/images/product/task-light.png and b/apps/docs/images/product/task-light.png differ
diff --git a/apps/docs/images/product/timeline-dark.png b/apps/docs/images/product/timeline-dark.png
index cbb0dadbd..0328d0336 100644
Binary files a/apps/docs/images/product/timeline-dark.png and b/apps/docs/images/product/timeline-dark.png differ
diff --git a/apps/docs/images/product/timeline-light.png b/apps/docs/images/product/timeline-light.png
index 5978247b5..f71fc686c 100644
Binary files a/apps/docs/images/product/timeline-light.png and b/apps/docs/images/product/timeline-light.png differ
diff --git a/apps/site/public/images/dark.png b/apps/site/public/images/dark.png
index b77a9efc2..f2a7a4504 100644
Binary files a/apps/site/public/images/dark.png and b/apps/site/public/images/dark.png differ
diff --git a/apps/site/public/images/light.png b/apps/site/public/images/light.png
index 71b2486c6..4c34e5d42 100644
Binary files a/apps/site/public/images/light.png and b/apps/site/public/images/light.png differ
diff --git a/apps/site/public/images/product/board-dark.png b/apps/site/public/images/product/board-dark.png
index b77a9efc2..f2a7a4504 100644
Binary files a/apps/site/public/images/product/board-dark.png and b/apps/site/public/images/product/board-dark.png differ
diff --git a/apps/site/public/images/product/board-light.png b/apps/site/public/images/product/board-light.png
index 71b2486c6..4c34e5d42 100644
Binary files a/apps/site/public/images/product/board-light.png and b/apps/site/public/images/product/board-light.png differ
diff --git a/apps/site/public/images/product/list-dark.png b/apps/site/public/images/product/list-dark.png
index 2f8b625f4..53dd39739 100644
Binary files a/apps/site/public/images/product/list-dark.png and b/apps/site/public/images/product/list-dark.png differ
diff --git a/apps/site/public/images/product/list-light.png b/apps/site/public/images/product/list-light.png
index 43b10592b..ec03d1e06 100644
Binary files a/apps/site/public/images/product/list-light.png and b/apps/site/public/images/product/list-light.png differ
diff --git a/apps/site/public/images/product/task-dark.png b/apps/site/public/images/product/task-dark.png
index 993912bc2..a1fe4df26 100644
Binary files a/apps/site/public/images/product/task-dark.png and b/apps/site/public/images/product/task-dark.png differ
diff --git a/apps/site/public/images/product/task-light.png b/apps/site/public/images/product/task-light.png
index f8975ecb0..cf416045f 100644
Binary files a/apps/site/public/images/product/task-light.png and b/apps/site/public/images/product/task-light.png differ
diff --git a/apps/site/public/images/product/timeline-dark.png b/apps/site/public/images/product/timeline-dark.png
index e1a009997..0328d0336 100644
Binary files a/apps/site/public/images/product/timeline-dark.png and b/apps/site/public/images/product/timeline-dark.png differ
diff --git a/apps/site/public/images/product/timeline-light.png b/apps/site/public/images/product/timeline-light.png
index dd91fa31e..f71fc686c 100644
Binary files a/apps/site/public/images/product/timeline-light.png and b/apps/site/public/images/product/timeline-light.png differ
diff --git a/scripts/ui-review-bot/docs-screenshots.mjs b/scripts/ui-review-bot/docs-screenshots.mjs
index b95bc9252..e39da28e9 100644
--- a/scripts/ui-review-bot/docs-screenshots.mjs
+++ b/scripts/ui-review-bot/docs-screenshots.mjs
@@ -1,15 +1,11 @@
import assert from "node:assert/strict";
-import { spawn } from "node:child_process";
import { mkdir } from "node:fs/promises";
-import { fileURLToPath } from "node:url";
import { chromium } from "playwright";
import { fixture, installFixtures } from "./fixtures.mjs";
+import { api, fulfillJSON, origin, root, startWebApp } from "./web-app.mjs";
// Real frontend, fictional data. The fixture layer blocks all live API traffic.
-const root = fileURLToPath(new URL("../../", import.meta.url));
const output = `${root}apps/docs/images/product`;
-const origin = "http://127.0.0.1:5188";
-const api = "http://127.0.0.1:4799";
const workspaceId = "ui-review-workspace";
const projectId = "ui-review-project";
const date = "2026-09-23T10:00:00.000Z";
@@ -90,50 +86,9 @@ const views = [
["security", "/dashboard/settings/account/security", "Current password"],
];
await mkdir(output, { recursive: true });
-const server = spawn(
- process.execPath,
- [
- "node_modules/vite-plus/bin/vp",
- "dev",
- "--host",
- "127.0.0.1",
- "--port",
- "5188",
- "--strictPort",
- ],
- {
- cwd: `${root}apps/web`,
- stdio: ["ignore", "pipe", "pipe"],
- env: {
- PATH: process.env.PATH,
- HOME: process.env.HOME,
- NODE_ENV: "development",
- VITE_API_URL: api,
- VITE_APP_URL: origin,
- BROWSER: "none",
- },
- },
-);
-let log = "";
-server.stdout.on("data", (chunk) => {
- log += chunk;
-});
-server.stderr.on("data", (chunk) => {
- log += chunk;
-});
+const server = await startWebApp();
let browser;
try {
- for (let attempt = 0; ; attempt++) {
- if (server.exitCode !== null || attempt > 60) throw new Error(log);
- if (
- await fetch(origin).then(
- (r) => r.ok,
- () => false,
- )
- )
- break;
- await new Promise((resolve) => setTimeout(resolve, 500));
- }
browser = await chromium.launch();
for (const theme of ["light", "dark"]) {
for (const [view, path, readyText] of views) {
@@ -241,15 +196,7 @@ try {
else if (p === `/api/label/workspace/${workspaceId}`) data = labels;
if (data === undefined || request.method() === "OPTIONS")
return route.fallback();
- await route.fulfill({
- status: 200,
- contentType: "application/json",
- headers: {
- "access-control-allow-origin": origin,
- "access-control-allow-credentials": "true",
- },
- body: JSON.stringify(data),
- });
+ await fulfillJSON(route, data);
});
const page = await context.newPage();
const errors = [];
diff --git a/scripts/ui-review-bot/product-fixtures.mjs b/scripts/ui-review-bot/product-fixtures.mjs
new file mode 100644
index 000000000..2710caffe
--- /dev/null
+++ b/scripts/ui-review-bot/product-fixtures.mjs
@@ -0,0 +1,329 @@
+import { fixture } from "./fixtures.mjs";
+import { api } from "./web-app.mjs";
+
+export const date = "2026-09-23T10:00:00.000Z";
+export const workspaceId = "ui-review-workspace";
+export const projectId = "ui-review-project";
+const createdAt = "2026-09-01T10:00:00.000Z";
+const day = (d) => `2026-09-${String(d).padStart(2, "0")}T12:00:00.000Z`;
+
+const baseUser = fixture(`${api}/api/auth/get-session`, "GET").user;
+export const people = Object.fromEntries(
+ [
+ ["AM", "Alex Morgan", "ui-review-user"],
+ ["JC", "Jamie Chen", "product-person-jc"],
+ ["SR", "Sam Rivera", "product-person-sr"],
+ ["TR", "Taylor Reed", "product-person-tr"],
+ ].map(([initials, name, id]) => [
+ initials,
+ {
+ ...baseUser,
+ id,
+ name,
+ email: `${name.split(" ")[0].toLowerCase()}@example.test`,
+ },
+ ]),
+);
+export const members = Object.values(people).map((user, i) => ({
+ id: `product-member-${i}`,
+ organizationId: workspaceId,
+ userId: user.id,
+ role: i === 0 ? "owner" : "member",
+ createdAt,
+ user,
+}));
+export const workspace = {
+ ...fixture(`${api}/api/auth/organization/list`, "GET")[0],
+ name: "Studio North",
+ slug: "studio-north",
+};
+
+export const labels = Object.fromEntries(
+ [
+ ["Engineering", "#60a5fa"],
+ ["Bug", "#f87171"],
+ ["Content", "#fbbf24"],
+ ["Design", "#a78bfa"],
+ ["Performance", "#22d3ee"],
+ ["Research", "#34d399"],
+ ].map(([name, color]) => [
+ name,
+ { id: `product-label-${name.toLowerCase()}`, workspaceId, name, color },
+ ]),
+);
+
+export const columns = [
+ ["to-do", "To Do"],
+ ["in-progress", "In Progress"],
+ ["in-review", "In Review"],
+ ["done", "Done"],
+].map(([slug, name], position) => ({
+ id: slug,
+ projectId,
+ name,
+ slug,
+ position,
+ icon: null,
+ color: null,
+ isFinal: slug === "done",
+ createdAt,
+ updatedAt: createdAt,
+}));
+
+const homepageDescription = `## A clearer first impression
+
+The new layout is in. Keep the customer story above the fold on mobile; the video can come after it.
+
+- [x] Build the responsive hero and navigation
+- [x] Add the product walkthrough
+- [ ] Check the mobile spacing
+- [ ] Get the final copy from Sam
+`;
+
+const checklist = (items, done) =>
+ items.map((item, i) => `- [${i < done ? "x" : " "}] ${item}`).join("\n");
+
+const rows = [
+ [
+ "to-do",
+ 31,
+ "Redirect the old pricing links",
+ "AM",
+ ["Engineering", "Bug"],
+ "high",
+ 22,
+ 22,
+ ],
+ [
+ "to-do",
+ 27,
+ "Draft the launch email",
+ "SR",
+ ["Content"],
+ "medium",
+ 25,
+ 29,
+ checklist(
+ ["Outline the story", "Write the first draft", "Send it to Alex"],
+ 1,
+ ),
+ ],
+ [
+ "to-do",
+ 36,
+ "A quieter success state for the contact form",
+ "JC",
+ ["Design"],
+ "low",
+ ],
+ ["to-do", 38, "Do we still need the FAQ?", null, [], "no-priority"],
+ [
+ "to-do",
+ 33,
+ "Customer quotes: ask Maya for approval",
+ null,
+ ["Content"],
+ "medium",
+ 28,
+ 28,
+ ],
+ [
+ "in-progress",
+ 22,
+ "Build the new homepage",
+ "JC",
+ ["Design", "Engineering"],
+ "high",
+ 16,
+ 25,
+ homepageDescription,
+ ],
+ [
+ "in-progress",
+ 35,
+ "Safari: mobile menu stays open after navigation",
+ "TR",
+ ["Bug"],
+ "urgent",
+ 23,
+ 23,
+ ],
+ [
+ "in-progress",
+ 29,
+ "Get the hero video under 2 MB",
+ "TR",
+ ["Engineering", "Performance"],
+ "medium",
+ 22,
+ 24,
+ ],
+ [
+ "in-review",
+ 24,
+ "Pricing copy: final review",
+ "SR",
+ ["Content"],
+ "high",
+ 18,
+ 24,
+ ],
+ [
+ "done",
+ 8,
+ "Five customer interviews",
+ "AM",
+ ["Research"],
+ "medium",
+ 7,
+ 16,
+ checklist(["Book the calls", "Run the interviews", "Share the notes"], 3),
+ ],
+ ["done", 14, "Pick the typefaces", "JC", ["Design"], "low", 11, 12],
+ [
+ "done",
+ 19,
+ "Remove the unused font weights",
+ "TR",
+ ["Performance"],
+ "no-priority",
+ ],
+ ["done", 11, "Agree on the launch scope", "AM", [], "high", 9, 10],
+];
+
+export const tasks = rows.map(
+ (
+ [
+ status,
+ number,
+ title,
+ assignee,
+ taskLabels,
+ priority,
+ start,
+ due,
+ description = null,
+ ],
+ i,
+ ) => {
+ const user = assignee ? people[assignee] : null;
+ return {
+ id: `product-task-${number}`,
+ title,
+ number,
+ description,
+ status,
+ columnId: status,
+ priority,
+ startDate: start ? day(start) : null,
+ dueDate: due ? day(due) : null,
+ recurrence: null,
+ position: i,
+ createdAt,
+ userId: user?.id ?? null,
+ assigneeName: user?.name ?? null,
+ assigneeId: user?.id ?? null,
+ assigneeImage: null,
+ projectId,
+ subtaskCounts: { completed: 0, total: 0 },
+ labels: taskLabels.map((name) => {
+ const { id, color } = labels[name];
+ return { id, name, color };
+ }),
+ externalLinks: [],
+ };
+ },
+);
+const byNumber = (number) => tasks.find((task) => task.number === number);
+export const homepageTask = byNumber(22);
+const homepageSubtasks = [byNumber(29), byNumber(19)];
+homepageTask.subtaskCounts = {
+ completed: homepageSubtasks.filter((task) => task.status === "done").length,
+ total: homepageSubtasks.length,
+};
+homepageTask.externalLinks = [
+ {
+ id: "product-link-pr",
+ taskId: homepageTask.id,
+ integrationId: "product-github",
+ resourceType: "pull_request",
+ externalId: "142",
+ url: "https://github.com/studio-north/website/pull/142",
+ title: "New homepage layout",
+ metadata: { merged: false, draft: false },
+ createdAt,
+ updatedAt: createdAt,
+ },
+];
+export const relations = [
+ ...homepageSubtasks.map((task) => [task, "subtask"]),
+ [byNumber(27), "blocks"],
+].map(([task, relationType]) => ({
+ id: `product-relation-${task.number}`,
+ sourceTaskId: homepageTask.id,
+ targetTaskId: task.id,
+ relationType,
+ createdAt,
+}));
+export const relatedTask = (task) => ({
+ id: task.id,
+ title: task.title,
+ status: task.status,
+ isCompleted: task.status === "done",
+ priority: task.priority,
+ number: task.number,
+ projectId,
+ userId: task.userId,
+ assigneeName: task.assigneeName,
+});
+
+export const project = {
+ ...fixture(`${api}/api/project/${projectId}`, "GET"),
+ name: "Website launch",
+ slug: "WEB",
+ lastTaskNumber: 38,
+ statistics: {
+ completionPercentage: 31,
+ totalTasks: tasks.length,
+ dueDate: day(30),
+ },
+};
+export const board = {
+ id: projectId,
+ name: project.name,
+ slug: project.slug,
+ icon: project.icon,
+ description: project.description,
+ isPublic: false,
+ workspaceId,
+ backgroundVersion: null,
+ columns: columns.map(({ id, slug, name, icon, isFinal, position }) => ({
+ id,
+ slug,
+ name,
+ icon,
+ isFinal,
+ position,
+ tasks: tasks.filter((task) => task.status === slug),
+ })),
+ archivedTasks: [],
+ plannedTasks: [],
+};
+
+export const comments = [
+ {
+ id: "product-comment-1",
+ taskId: homepageTask.id,
+ type: "comment",
+ createdAt: "2026-09-23T09:00:00.000Z",
+ updatedAt: "2026-09-23T09:00:00.000Z",
+ userId: people.SR.id,
+ content:
+ "The shorter headline reads much better on mobile. I'll send the approved customer quote this afternoon.",
+ eventData: null,
+ externalUserName: null,
+ externalUserAvatar: null,
+ externalSource: null,
+ externalUrl: null,
+ },
+];
diff --git a/scripts/ui-review-bot/product-screenshots.mjs b/scripts/ui-review-bot/product-screenshots.mjs
new file mode 100644
index 000000000..85ad044ba
--- /dev/null
+++ b/scripts/ui-review-bot/product-screenshots.mjs
@@ -0,0 +1,252 @@
+import assert from "node:assert/strict";
+import { copyFile, mkdir, stat } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { chromium } from "playwright";
+import { WORKSPACE_CAPABILITY_NAMES } from "../../packages/permissions/src/capabilities.ts";
+import { fixture, installFixtures } from "./fixtures.mjs";
+import {
+ board,
+ columns,
+ comments,
+ date,
+ homepageTask,
+ relatedTask,
+ relations,
+ labels,
+ members,
+ project,
+ projectId,
+ tasks,
+ workspace,
+ workspaceId,
+} from "./product-fixtures.mjs";
+import { api, fulfillJSON, origin, root, startWebApp } from "./web-app.mjs";
+
+const output = `${root}apps/site/public/images/product`;
+const docsOutput = `${root}apps/docs/images/product`;
+const projectPath = `/dashboard/workspace/${workspaceId}/project/${projectId}`;
+const views = [
+ ["board", `${projectPath}/board`, "board", "Redirect the old pricing links"],
+ ["list", `${projectPath}/board`, "list", "Redirect the old pricing links"],
+ ["timeline", `${projectPath}/gantt`, "board", "Five customer interviews"],
+ [
+ "task",
+ `${projectPath}/task/${homepageTask.id}`,
+ "board",
+ "Check the mobile spacing",
+ ],
+];
+
+function respond(url, method) {
+ const p = new URL(url).pathname.replace(/\/$/, "");
+ const taskMatch = p.match(/^\/api\/task\/(product-task-\d+)$/);
+ if (taskMatch) {
+ const task = tasks.find((item) => item.id === taskMatch[1]);
+ return task && { ...task, workspaceId };
+ }
+ if (p === "/api/project") return [project];
+ if (p === `/api/project/${projectId}`) return project;
+ if (p === `/api/task/tasks/${projectId}`)
+ return {
+ data: board,
+ pagination: {
+ total: tasks.length,
+ page: 1,
+ pageSize: 100,
+ totalPages: 1,
+ relatedPage: 1,
+ relatedPageSize: 100,
+ relatedTotalPages: 1,
+ },
+ };
+ if (p === `/api/column/${projectId}`) return columns;
+ if (p === `/api/workspace/${workspaceId}/capabilities`)
+ return Object.fromEntries(
+ WORKSPACE_CAPABILITY_NAMES.map((name) => [name, true]),
+ );
+ if (p === `/api/workspace/${workspaceId}/members`)
+ return members.map(({ user, role }) => ({
+ id: user.id,
+ name: user.name,
+ email: user.email,
+ image: null,
+ role,
+ }));
+ if (p === "/api/task/assigned") {
+ const assigned = tasks
+ .filter((task) => task.userId === members[0].userId)
+ .filter((task) => task.status !== "done")
+ .map((task) => ({
+ id: task.id,
+ projectId,
+ number: task.number,
+ title: task.title,
+ status: task.status,
+ statusName: columns.find((c) => c.slug === task.status).name,
+ statusIcon: null,
+ priority: task.priority,
+ dueDate: task.dueDate,
+ projectName: project.name,
+ projectSlug: project.slug,
+ projectIcon: project.icon,
+ labels: task.labels,
+ }));
+ return { tasks: assigned, total: assigned.length };
+ }
+ if (p === `/api/activity/${homepageTask.id}`) return comments;
+ if (p === `/api/label/task/${homepageTask.id}`) return homepageTask.labels;
+ if (p === `/api/external-link/task/${homepageTask.id}`)
+ return homepageTask.externalLinks;
+ if (p === `/api/task-relation/project/${projectId}`) return relations;
+ if (p.startsWith("/api/task-relation/product-task-")) {
+ const taskId = p.split("/").pop();
+ return relations
+ .filter((r) => r.sourceTaskId === taskId || r.targetTaskId === taskId)
+ .map((r) => ({
+ ...r,
+ sourceTask: relatedTask(tasks.find((t) => t.id === r.sourceTaskId)),
+ targetTask: relatedTask(tasks.find((t) => t.id === r.targetTaskId)),
+ }));
+ }
+ if (p === `/api/gitlab-integration/project/${projectId}`) return null;
+ if (p === `/api/label/workspace/${workspaceId}`) return Object.values(labels);
+ if (
+ p === `/api/custom-field/project/${projectId}/values` ||
+ p === `/api/custom-field/project/${projectId}/filter-values` ||
+ /^\/api\/(external-link\/task|custom-field\/task)\/product-task-\d+$/.test(
+ p,
+ )
+ )
+ return [];
+ if (p.endsWith("/organization/list-members"))
+ return { members, total: members.length };
+ if (p.endsWith("/organization/get-full-organization"))
+ return { ...fixture(url, method), ...workspace, members };
+ if (p.endsWith("/organization/list")) return [workspace];
+ return undefined;
+}
+
+async function showTimelineFrom(page, dayLabel) {
+ await page.evaluate((dayLabel) => {
+ const container = document.querySelector(
+ '[data-testid="gantt-scroll-container"]',
+ );
+ const leaves = [...container.querySelectorAll("*")].filter(
+ (el) => el.children.length === 0,
+ );
+ const day = leaves.find((el) => el.textContent.trim() === dayLabel);
+ const rail = leaves
+ .find((el) => el.textContent.trim().toLowerCase() === "task")
+ .closest("*:is(div, th)");
+ let sticky = rail;
+ while (sticky && getComputedStyle(sticky).position !== "sticky")
+ sticky = sticky.parentElement;
+ const column = day.closest("*:is(div, th)");
+ container.scrollLeft +=
+ column.getBoundingClientRect().left -
+ (sticky ?? rail).getBoundingClientRect().right;
+ }, dayLabel);
+ await page.evaluate(
+ () => new Promise((resolve) => requestAnimationFrame(() => resolve())),
+ );
+}
+
+await mkdir(output, { recursive: true });
+const server = await startWebApp();
+let browser;
+try {
+ browser = await chromium.launch();
+ for (const theme of ["light", "dark"]) {
+ for (const [view, path, viewMode, readyText] of views) {
+ if (
+ process.env.PRODUCT_SCREENSHOT_VIEW &&
+ process.env.PRODUCT_SCREENSHOT_VIEW !== view
+ )
+ continue;
+ const context = await browser.newContext({
+ viewport: { width: 1728, height: 1000 },
+ deviceScaleFactor: 2,
+ locale: "en-US",
+ timezoneId: "UTC",
+ colorScheme: theme,
+ reducedMotion: "reduce",
+ serviceWorkers: "block",
+ });
+ const diagnostics = { unhandled: [], blocked: [] };
+ await installFixtures(context, origin, diagnostics);
+ await context.addInitScript(
+ ([theme, viewMode]) => {
+ localStorage.setItem(
+ "user-preferences",
+ JSON.stringify({
+ state: { theme, viewMode, weekStartsOn: 1 },
+ version: 0,
+ }),
+ );
+ },
+ [theme, viewMode],
+ );
+ await context.route(`${api}/**`, async (route) => {
+ const request = route.request();
+ const data =
+ request.method() === "GET"
+ ? respond(request.url(), request.method())
+ : undefined;
+ if (data === undefined) return route.fallback();
+ await fulfillJSON(route, data);
+ });
+ const page = await context.newPage();
+ const errors = [];
+ const consoleErrors = [];
+ page.on("pageerror", (e) => errors.push(e.message));
+ page.on("requestfailed", (r) =>
+ consoleErrors.push(`${r.url()} ${r.failure()?.errorText}`),
+ );
+ page.on("framenavigated", (f) => consoleErrors.push(`frame ${f.url()}`));
+ await page.clock.setFixedTime(new Date(date));
+ await page.goto(`${origin}${path}`);
+ await page
+ .getByText(readyText, { exact: true })
+ .first()
+ .waitFor()
+ .catch(async (error) => {
+ const failure = `${tmpdir()}/product-${view}-${theme}-failure.png`;
+ await page.screenshot({ path: failure });
+ console.error(
+ JSON.stringify({
+ view,
+ theme,
+ failure,
+ errors,
+ consoleErrors,
+ ...diagnostics,
+ }),
+ );
+ throw error;
+ });
+ await page.waitForLoadState("networkidle");
+ await page.evaluate(() => document.fonts.ready);
+ if (view === "timeline") await showTimelineFrom(page, "6");
+ await page.mouse.move(0, 0);
+ await page.screenshot({
+ path: `${output}/${view}-${theme}.png`,
+ animations: "disabled",
+ });
+ console.log(JSON.stringify({ view, theme, errors, ...diagnostics }));
+ assert.deepEqual(errors, []);
+ assert.deepEqual(diagnostics.unhandled, []);
+ await context.close();
+ const docsFile = `${docsOutput}/${view}-${theme}.png`;
+ if (await stat(docsFile).catch(() => null))
+ await copyFile(`${output}/${view}-${theme}.png`, docsFile);
+ if (view === "board")
+ await copyFile(
+ `${output}/${view}-${theme}.png`,
+ `${root}apps/site/public/images/${theme}.png`,
+ );
+ }
+ }
+} finally {
+ await browser?.close();
+ server.kill("SIGTERM");
+}
diff --git a/scripts/ui-review-bot/web-app.mjs b/scripts/ui-review-bot/web-app.mjs
new file mode 100644
index 000000000..0f392ac31
--- /dev/null
+++ b/scripts/ui-review-bot/web-app.mjs
@@ -0,0 +1,70 @@
+import { spawn } from "node:child_process";
+import { fileURLToPath } from "node:url";
+
+export const root = fileURLToPath(new URL("../../", import.meta.url));
+export const origin = "http://127.0.0.1:5188";
+export const api = "http://127.0.0.1:4799";
+
+export async function startWebApp() {
+ const server = spawn(
+ process.execPath,
+ [
+ "node_modules/vite-plus/bin/vp",
+ "dev",
+ "--host",
+ "127.0.0.1",
+ "--port",
+ "5188",
+ "--strictPort",
+ ],
+ {
+ cwd: `${root}apps/web`,
+ stdio: ["ignore", "pipe", "pipe"],
+ env: {
+ PATH: process.env.PATH,
+ HOME: process.env.HOME,
+ ...(process.env.TMPDIR && { TMPDIR: process.env.TMPDIR }),
+ NODE_ENV: "development",
+ VITE_API_URL: api,
+ VITE_APP_URL: origin,
+ BROWSER: "none",
+ },
+ },
+ );
+ let log = "";
+ server.stdout.on("data", (chunk) => {
+ log += chunk;
+ });
+ server.stderr.on("data", (chunk) => {
+ log += chunk;
+ });
+ try {
+ for (let attempt = 0; ; attempt++) {
+ if (server.exitCode !== null || attempt > 60) throw new Error(log);
+ if (
+ await fetch(origin).then(
+ (r) => r.ok,
+ () => false,
+ )
+ )
+ break;
+ await new Promise((resolve) => setTimeout(resolve, 500));
+ }
+ } catch (error) {
+ server.kill("SIGTERM");
+ throw error;
+ }
+ return server;
+}
+
+export function fulfillJSON(route, data) {
+ return route.fulfill({
+ status: 200,
+ contentType: "application/json",
+ headers: {
+ "access-control-allow-origin": origin,
+ "access-control-allow-credentials": "true",
+ },
+ body: JSON.stringify(data),
+ });
+}