chore(test): format golden fixtures

This commit is contained in:
Kayshen-X 2026-05-23 23:55:00 +08:00
parent 66b6330914
commit caa53e55ff
8 changed files with 66 additions and 46 deletions

View file

@ -13,18 +13,14 @@
"id": "categories",
"role": "categories",
"layout": "vertical",
"children": [
{ "type": "text", "id": "cat-label", "content": "Categories" }
]
"children": [{ "type": "text", "id": "cat-label", "content": "Categories" }]
},
{
"type": "frame",
"id": "list",
"role": "list",
"layout": "vertical",
"children": [
{ "type": "text", "id": "list-item", "content": "First item" }
]
"children": [{ "type": "text", "id": "list-item", "content": "First item" }]
}
]
}

View file

@ -10,30 +10,72 @@
"type": "frame",
"id": "stacked-effects",
"effects": [
{ "type": "shadow", "offsetX": 0, "offsetY": 1, "blur": 4, "spread": 0, "color": "#000000" },
{ "type": "shadow", "offsetX": 0, "offsetY": 2, "blur": 8, "spread": 0, "color": "#000000" },
{ "type": "shadow", "offsetX": 0, "offsetY": 4, "blur": 12, "spread": 0, "color": "#000000" }
{
"type": "shadow",
"offsetX": 0,
"offsetY": 1,
"blur": 4,
"spread": 0,
"color": "#000000"
},
{
"type": "shadow",
"offsetX": 0,
"offsetY": 2,
"blur": 8,
"spread": 0,
"color": "#000000"
},
{
"type": "shadow",
"offsetX": 0,
"offsetY": 4,
"blur": 12,
"spread": 0,
"color": "#000000"
}
]
},
{
"type": "frame",
"id": "halo-blur",
"effects": [
{ "type": "shadow", "offsetX": 0, "offsetY": 0, "blur": 64, "spread": 0, "color": "#000000" }
{
"type": "shadow",
"offsetX": 0,
"offsetY": 0,
"blur": 64,
"spread": 0,
"color": "#000000"
}
]
},
{
"type": "frame",
"id": "spiked-spread",
"effects": [
{ "type": "shadow", "offsetX": 0, "offsetY": 2, "blur": 16, "spread": 8, "color": "#000000" }
{
"type": "shadow",
"offsetX": 0,
"offsetY": 2,
"blur": 16,
"spread": 8,
"color": "#000000"
}
]
},
{
"type": "frame",
"id": "subtle-shadow",
"effects": [
{ "type": "shadow", "offsetX": 0, "offsetY": 2, "blur": 16, "spread": 0, "color": "#000000" }
{
"type": "shadow",
"offsetX": 0,
"offsetY": 2,
"blur": 16,
"spread": 0,
"color": "#000000"
}
]
}
]

View file

@ -12,9 +12,7 @@
"id": "light-on-light",
"layout": "vertical",
"fill": [{ "type": "solid", "color": "#FFFFFF" }],
"children": [
{ "type": "text", "id": "lol-label", "content": "Inside light wrapper" }
]
"children": [{ "type": "text", "id": "lol-label", "content": "Inside light wrapper" }]
},
{
"type": "frame",
@ -27,9 +25,7 @@
"id": "dark-on-dark",
"layout": "vertical",
"fill": [{ "type": "solid", "color": "#0A0A0A" }],
"children": [
{ "type": "text", "id": "dod-label", "content": "Inside dark wrapper" }
]
"children": [{ "type": "text", "id": "dod-label", "content": "Inside dark wrapper" }]
}
]
}

View file

@ -15,18 +15,14 @@
"role": "section",
"layout": "vertical",
"padding": [0, 24, 0, 24],
"children": [
{ "type": "text", "id": "specials-title", "content": "Today's Specials" }
]
"children": [{ "type": "text", "id": "specials-title", "content": "Today's Specials" }]
},
{
"type": "frame",
"id": "menu",
"role": "section",
"layout": "vertical",
"children": [
{ "type": "text", "id": "menu-title", "content": "Menu" }
]
"children": [{ "type": "text", "id": "menu-title", "content": "Menu" }]
}
]
}

View file

@ -5,12 +5,7 @@
"severity": "warning",
"property": "padding",
"currentValue": null,
"suggestedValue": [
0,
16,
0,
16
],
"suggestedValue": [0, 16, 0, 16],
"reason": "mobile root has 0 horizontal padding while 2 content section(s) glue text/icon to screen edge"
}
]

View file

@ -4,12 +4,7 @@
"category": "stacked-horizontal-padding",
"severity": "info",
"property": "padding",
"currentValue": [
0,
24,
0,
24
],
"currentValue": [0, 24, 0, 24],
"suggestedValue": null,
"reason": "section h-padding [24/24] stacks with root h-padding [16/16] — combined gutter 40/40"
}

View file

@ -1,10 +1,6 @@
[
{ "name": "compact-mobile-login", "fn": "compact",
"prompt": "a mobile login screen" },
{ "name": "compact-fintech-landing", "fn": "compact",
"prompt": "a fintech marketing site" },
{ "name": "compact-dashboard", "fn": "compact",
"prompt": "an analytics admin dashboard" },
{ "name": "compact-component", "fn": "compact",
"prompt": "a pricing card" }
{ "name": "compact-mobile-login", "fn": "compact", "prompt": "a mobile login screen" },
{ "name": "compact-fintech-landing", "fn": "compact", "prompt": "a fintech marketing site" },
{ "name": "compact-dashboard", "fn": "compact", "prompt": "an analytics admin dashboard" },
{ "name": "compact-component", "fn": "compact", "prompt": "a pricing card" }
]

View file

@ -6,14 +6,18 @@ import { buildCompactPlanningPrompt } from '../../../apps/web/src/services/ai/or
const dir = join(import.meta.dir, '../tests/planner-golden');
const cases = JSON.parse(readFileSync(join(dir, 'cases.json'), 'utf8')) as Array<{
name: string; fn: string; prompt: string;
name: string;
fn: string;
prompt: string;
}>;
let written = 0;
for (const c of cases) {
if (c.fn === 'compact') {
const { systemPrompt, userPrompt, selectedStyleGuideName } = buildCompactPlanningPrompt(
c.prompt, undefined, undefined,
c.prompt,
undefined,
undefined,
);
writeFileSync(
join(dir, `${c.name}.json`),