feat: expand UI Lab media fixtures

Add a derived dev-media fixture pack and wire UI Lab scenarios to use the broader image set for more useful browser screenshots.
This commit is contained in:
2026-06-29 00:06:58 +01:00
parent 7a18011b0f
commit 24d4e82950
51 changed files with 19 additions and 40 deletions
+9 -7
View File
@@ -79,14 +79,17 @@ src/dev/mockScenarios.ts
src/dev/applyMockScenario.ts
```
Happy-path fixture media is imported from the existing onboarding assets in:
Happy-path fixture media is generated from existing onboarding images and
website screenshots into:
```text
src/assets/onboarding/
public/dev-media/fixture-*.webp
```
Synthetic or deliberately broken fixture paths can still use the `mock://`
scheme described below.
The pack is deliberately small and deterministic, but varied enough for browser
screenshots: square, portrait, landscape, monochrome, tinted, framed, and
interface-like crops. Synthetic or deliberately broken fixture paths can still
use the `mock://` scheme described below.
## Mock Media
@@ -100,9 +103,8 @@ const src = mediaSrc(image.thumbnail_path);
```
In normal Tauri modes, `mediaSrc` delegates to `convertFileSrc`. In UI Lab,
already-resolved Vite asset URLs are returned as-is, so fixtures can reuse
existing imported assets. Paths beginning with `mock://` are served from
`public/dev-media`:
root-relative asset URLs such as `/dev-media/fixture-01.webp` are returned
as-is. Paths beginning with `mock://` are also served from `public/dev-media`:
```text
mock://thumb-1.svg -> /dev-media/thumb-1.svg
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+2 -33
View File
@@ -12,21 +12,7 @@ import type {
TagCloudEntry,
} from "../store";
import type { MockScenario } from "./mockScenarios";
import alpineLake from "../assets/onboarding/alpinelake.webp";
import architecture from "../assets/onboarding/architecture.webp";
import balloon from "../assets/onboarding/balloon.webp";
import beach from "../assets/onboarding/beach.webp";
import cat from "../assets/onboarding/cat.webp";
import cityNight from "../assets/onboarding/citynight.webp";
import cozy from "../assets/onboarding/cozy.webp";
import dunes from "../assets/onboarding/dunes.webp";
import flower from "../assets/onboarding/flower.webp";
import forest from "../assets/onboarding/forest.webp";
import landscape1 from "../assets/onboarding/landscape1.webp";
import landscape2 from "../assets/onboarding/landscape2.webp";
import sunset from "../assets/onboarding/sunset.webp";
import sunsetCoast from "../assets/onboarding/sunsetcoast.webp";
import sunsetLake from "../assets/onboarding/sunsetlake.webp";
import { fixtureMediaPath } from "./mockMedia";
export interface MockDb {
scenario: MockScenario;
@@ -72,23 +58,6 @@ const tags = [
"select",
];
const aiRatings: AiRating[] = ["general", "sensitive", "questionable"];
const fixtureAssets = [
alpineLake,
architecture,
balloon,
beach,
cat,
cityNight,
cozy,
dunes,
flower,
forest,
landscape1,
landscape2,
sunset,
sunsetCoast,
sunsetLake,
];
function daysAgo(days: number): string {
return new Date(Date.now() - days * 86_400_000).toISOString();
@@ -99,7 +68,7 @@ function mockPath(folder: number, name: string, index: number, ext: string): str
}
function mockThumb(index: number): string {
return fixtureAssets[index % fixtureAssets.length];
return fixtureMediaPath(index);
}
function makeImage(index: number, folderId: number, scenario: MockScenario): ImageRecord {
+8
View File
@@ -0,0 +1,8 @@
const fixtureMedia = Array.from(
{ length: 48 },
(_, index) => `/dev-media/fixture-${String(index + 1).padStart(2, "0")}.webp`,
);
export function fixtureMediaPath(index: number): string {
return fixtureMedia[index % fixtureMedia.length];
}