@vectoriox/iox-ui 5.204.0 → 5.206.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data-core/index.d.ts +13 -4
- package/design-core/index.d.ts +277 -6
- package/fesm2022/vectoriox-iox-ui-data-core.mjs +23 -4
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +3065 -2673
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1313 -197
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +71 -19
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs +32 -4
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +145 -82
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +462 -41
- package/harness-core/index.d.ts +52 -12
- package/index.d.ts +44 -3
- package/package.json +1 -1
- package/scene-core/index.d.ts +16 -2
- package/src/data-core/placeholder-rows.ts +24 -3
- package/src/design-core/colour-eval.ts +22 -0
- package/src/design-core/contrast-audit.ts +96 -2
- package/src/design-core/design-token.model.ts +2 -0
- package/src/design-core/flavor-spec.generated.ts +184 -0
- package/src/design-core/font-metrics.ts +14 -1
- package/src/design-core/font-vertical.ts +80 -0
- package/src/design-core/node-links.ts +12 -0
- package/src/design-core/public-api.ts +1 -0
- package/src/design-core/style-presets.ts +20 -1
- package/src/design-core/token-css.ts +3 -1
- package/src/generation-core/ai-run.ts +31 -0
- package/src/generation-core/audit-site.ts +5 -3
- package/src/generation-core/compose-free.ts +1 -1
- package/src/generation-core/compose-layout.ts +172 -22
- package/src/generation-core/critic-calibration.ts +30 -10
- package/src/generation-core/critic-numbers.ts +259 -0
- package/src/generation-core/critic-prompt.ts +74 -6
- package/src/generation-core/critic-rubric.generated.ts +7 -7
- package/src/generation-core/critic-sheet.ts +184 -6
- package/src/generation-core/critic.ts +27 -13
- package/src/generation-core/designer-brief.ts +4 -3
- package/src/generation-core/designer-estimate.ts +3 -3
- package/src/generation-core/layout-render-check.ts +35 -2
- package/src/generation-core/nav-shape.ts +67 -8
- package/src/generation-core/opening-mix.ts +61 -17
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/social-links.ts +47 -8
- package/src/generation-core/stock-photos.ts +149 -14
- package/src/generation-core/stock-search.ts +108 -19
- package/src/generation-core/stock-subjects.ts +204 -0
- package/src/harness-core/business-types.ts +3 -0
- package/src/harness-core/harness-spec.generated.ts +54 -15
- package/src/harness-core/intake.ts +18 -5
- package/src/scene-core/scene.ts +34 -3
- package/styles/iox-design.css +41 -2
- package/styles/iox-forms.css +7 -6
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { CriticDimension } from './critic';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* THE CARD'S NUMBERS, FOR BOTH SIDES (ai-designer-plan "The hotel level offset", AD-D29 (1)): a reference card
|
|
5
|
+
* (`team/reference-cards/<name>.md`) prints the reference's measured numbers row by row — palette shares, hero px, skeletons,
|
|
6
|
+
* picture area per screen, header and footer — while our page was read off downscaled stills, so the critic under-read our
|
|
7
|
+
* sizes by 15–35% (the hotel's hero 140 / 80 / 80 px against a measured 176 / 96 / 88). A round now runs the same visitor
|
|
8
|
+
* measures (iox-render `measures/visitor.mjs`: TYPE_AND_LAYOUT, PICTURE_AREA per screen, HEADER, FOOTER, the colours) and
|
|
9
|
+
* this ONE formatter prints both sides in the card's words (ported from the tester's `refnums-1128.cjs`). Row 7, motion, is
|
|
10
|
+
* `motionLine` (AD-D27). Pure.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** A screenshot's dominant colours (iox-render `colours`): `#482808 6%` each, and the mean saturation and luminance. */
|
|
14
|
+
export interface VisitColours {
|
|
15
|
+
top?: string[];
|
|
16
|
+
meanSat?: number;
|
|
17
|
+
meanLum?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** TYPE_AND_LAYOUT's `type`: the hero (the largest text on the first screen), the largest anywhere, the body size, the faces. */
|
|
21
|
+
export interface VisitType {
|
|
22
|
+
heroPx?: number;
|
|
23
|
+
heroText?: string;
|
|
24
|
+
heroFam?: string;
|
|
25
|
+
heroWeight?: string;
|
|
26
|
+
largestPx?: number;
|
|
27
|
+
largestFam?: string;
|
|
28
|
+
bodyPx?: number;
|
|
29
|
+
families?: string[];
|
|
30
|
+
headingFaces?: string[];
|
|
31
|
+
upperSharePct?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** TYPE_AND_LAYOUT's `layout`. */
|
|
35
|
+
export interface VisitLayout {
|
|
36
|
+
paraWidthMedian?: number;
|
|
37
|
+
textLeftP10?: number;
|
|
38
|
+
contentSpan?: number;
|
|
39
|
+
docHeight?: number;
|
|
40
|
+
screens?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** TYPE_AND_LAYOUT's `sections` (the tall full-width blocks and their skeletons). */
|
|
44
|
+
export interface VisitSections {
|
|
45
|
+
count?: number;
|
|
46
|
+
distinctSkeletons?: number;
|
|
47
|
+
consecutiveRepeats?: number;
|
|
48
|
+
padTopMedian?: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** HEADER: the bar's box and ground. */
|
|
52
|
+
export interface VisitHeader {
|
|
53
|
+
pos?: string;
|
|
54
|
+
top?: number;
|
|
55
|
+
h?: number;
|
|
56
|
+
bg?: string;
|
|
57
|
+
backdrop?: string;
|
|
58
|
+
visibleLinks?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** FOOTER. */
|
|
62
|
+
export interface VisitFooter {
|
|
63
|
+
h?: number;
|
|
64
|
+
bg?: string;
|
|
65
|
+
bgImage?: boolean;
|
|
66
|
+
links?: number;
|
|
67
|
+
columnsApprox?: number;
|
|
68
|
+
hasForm?: boolean;
|
|
69
|
+
social?: string[];
|
|
70
|
+
legal?: boolean;
|
|
71
|
+
largestTextPx?: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The visitor measures of one width, under a visit's `metrics.json` keys (iox-render `visit.mjs`) — a round writes the same
|
|
76
|
+
* keys under `measures.<width>.visit`, so one reader serves both.
|
|
77
|
+
*/
|
|
78
|
+
export interface VisitNumbers {
|
|
79
|
+
colourFirst?: VisitColours;
|
|
80
|
+
colourFull?: VisitColours;
|
|
81
|
+
colourFooter?: VisitColours;
|
|
82
|
+
typeLayoutFirst?: { type?: VisitType };
|
|
83
|
+
typeLayout?: { type?: VisitType; layout?: VisitLayout; sections?: VisitSections };
|
|
84
|
+
firstPictureAreaPct?: number;
|
|
85
|
+
pictureAreaByScreen?: number[];
|
|
86
|
+
pictureAreaMean?: number;
|
|
87
|
+
headerAtLoad?: VisitHeader;
|
|
88
|
+
headerScrolledUp?: VisitHeader;
|
|
89
|
+
footer?: VisitFooter;
|
|
90
|
+
overflow?: { docW?: number; vw?: number };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type Raw = Record<string, unknown>;
|
|
94
|
+
const obj = (v: unknown): Raw | undefined => (v && typeof v === 'object' && !Array.isArray(v) ? v as Raw : undefined);
|
|
95
|
+
const num = (v: unknown): number | undefined => (typeof v === 'number' && Number.isFinite(v) ? v : undefined);
|
|
96
|
+
const str = (v: unknown): string | undefined => (typeof v === 'string' && v.trim() ? v : undefined);
|
|
97
|
+
const bool = (v: unknown): boolean | undefined => (typeof v === 'boolean' ? v : undefined);
|
|
98
|
+
const strs = (v: unknown): string[] | undefined => (Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : undefined);
|
|
99
|
+
const nums = (v: unknown): number[] | undefined => (Array.isArray(v) ? v.filter((x): x is number => typeof x === 'number' && Number.isFinite(x)) : undefined);
|
|
100
|
+
|
|
101
|
+
/** The keys of `o` that `read` gives a value for; undefined when none. */
|
|
102
|
+
function pick<T extends object>(raw: unknown, read: Readonly<Record<keyof T, (v: unknown) => unknown>>): T | undefined {
|
|
103
|
+
const o = obj(raw);
|
|
104
|
+
if (!o) return undefined;
|
|
105
|
+
const out: Raw = {};
|
|
106
|
+
for (const k of Object.keys(read) as Array<keyof T & string>) {
|
|
107
|
+
const v = read[k](o[k]);
|
|
108
|
+
if (v !== undefined) out[k] = v;
|
|
109
|
+
}
|
|
110
|
+
return Object.keys(out).length ? out as T : undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const COLOURS = { top: strs, meanSat: num, meanLum: num } as const;
|
|
114
|
+
const TYPE = {
|
|
115
|
+
heroPx: num, heroText: str, heroFam: str, heroWeight: (v: unknown) => str(v) ?? (num(v) !== undefined ? String(v) : undefined), largestPx: num,
|
|
116
|
+
largestFam: str, bodyPx: num, families: strs, headingFaces: strs, upperSharePct: num,
|
|
117
|
+
} as const;
|
|
118
|
+
const LAYOUT = { paraWidthMedian: num, textLeftP10: num, contentSpan: num, docHeight: num, screens: num } as const;
|
|
119
|
+
const SECTIONS = { count: num, distinctSkeletons: num, consecutiveRepeats: num, padTopMedian: num } as const;
|
|
120
|
+
const HEADER = { pos: str, top: num, h: num, bg: str, backdrop: str, visibleLinks: num } as const;
|
|
121
|
+
const FOOTER = { h: num, bg: str, bgImage: bool, links: num, columnsApprox: num, hasForm: bool, social: strs, legal: bool, largestTextPx: num } as const;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The card's numbers out of one width's measures (a visit's `metrics.json`, a round's `measures.<width>.visit`): each part
|
|
125
|
+
* kept only when it has its type — a measure that failed (`{ error }`) or was never taken is left out, never read as 0.
|
|
126
|
+
*/
|
|
127
|
+
export function visitNumbersOf(raw: unknown): VisitNumbers | undefined {
|
|
128
|
+
return pick<VisitNumbers>(raw, {
|
|
129
|
+
colourFirst: v => pick<VisitColours>(v, COLOURS),
|
|
130
|
+
colourFull: v => pick<VisitColours>(v, COLOURS),
|
|
131
|
+
colourFooter: v => pick<VisitColours>(v, COLOURS),
|
|
132
|
+
typeLayoutFirst: v => pick<{ type?: VisitType }>(v, { type: t => pick<VisitType>(t, TYPE) }),
|
|
133
|
+
typeLayout: v => pick<{ type?: VisitType; layout?: VisitLayout; sections?: VisitSections }>(v, {
|
|
134
|
+
type: t => pick<VisitType>(t, TYPE), layout: l => pick<VisitLayout>(l, LAYOUT), sections: s => pick<VisitSections>(s, SECTIONS),
|
|
135
|
+
}),
|
|
136
|
+
firstPictureAreaPct: num,
|
|
137
|
+
pictureAreaByScreen: v => { const a = nums(v); return a?.length ? a : undefined; },
|
|
138
|
+
pictureAreaMean: num,
|
|
139
|
+
headerAtLoad: v => pick<VisitHeader>(v, HEADER),
|
|
140
|
+
headerScrolledUp: v => pick<VisitHeader>(v, HEADER),
|
|
141
|
+
footer: v => pick<VisitFooter>(v, FOOTER),
|
|
142
|
+
overflow: v => pick<{ docW?: number; vw?: number }>(v, { docW: num, vw: num }),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** The rows the numbers fill, in the card's order. Motion (row 7) is `motionLine`'s, beside these. */
|
|
147
|
+
export const CARD_NUMBER_ROWS: ReadonlyArray<CriticDimension> = [
|
|
148
|
+
CriticDimension.Colour, CriticDimension.Type, CriticDimension.Composition, CriticDimension.Imagery,
|
|
149
|
+
CriticDimension.Header, CriticDimension.Footer, CriticDimension.Polish,
|
|
150
|
+
];
|
|
151
|
+
|
|
152
|
+
/** One width's numbers, row by row, in the card's words. A row with nothing measured is absent. */
|
|
153
|
+
export type CardNumbers = Partial<Record<CriticDimension, string>>;
|
|
154
|
+
|
|
155
|
+
const px = (v: number) => `${Math.round(v)}px`;
|
|
156
|
+
/** The row's parts that were measured, joined; a part is a string, or a falsy guard (`0` from an empty list's length). */
|
|
157
|
+
const parts = (...p: Array<string | number | false | undefined | null>) => p.filter((x): x is string => typeof x === 'string' && x !== '').join('; ');
|
|
158
|
+
/** How much of the hero's words the row quotes (enough to see what was counted as the hero — a clock, a label). */
|
|
159
|
+
export const CARD_HERO_TEXT_MAX = 32;
|
|
160
|
+
|
|
161
|
+
function colourRow(n: VisitNumbers): string {
|
|
162
|
+
const mean = n.colourFull ?? n.colourFirst;
|
|
163
|
+
return parts(
|
|
164
|
+
n.colourFirst?.top?.length && `first screen ${n.colourFirst.top.slice(0, 5).join(', ')}`,
|
|
165
|
+
n.colourFull?.top?.length && `whole page ${n.colourFull.top.slice(0, 5).join(', ')}`,
|
|
166
|
+
mean && mean.meanSat !== undefined && mean.meanLum !== undefined && `mean saturation ${mean.meanSat}, luminance ${mean.meanLum}`,
|
|
167
|
+
n.colourFooter?.top?.length && `footer ${n.colourFooter.top.slice(0, 3).join(', ')}`,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function typeRow(n: VisitNumbers): string {
|
|
172
|
+
const hero = n.typeLayoutFirst?.type;
|
|
173
|
+
const page = n.typeLayout?.type;
|
|
174
|
+
const text = hero?.heroText?.replace(/\s+/g, ' ').trim();
|
|
175
|
+
return parts(
|
|
176
|
+
hero?.heroPx !== undefined && `first-screen largest ${px(hero.heroPx)}${hero.heroFam ? ` ${hero.heroFam}` : ''}${hero.heroWeight ? ` ${hero.heroWeight}` : ''}`
|
|
177
|
+
+ `${text ? ` ("${text.length > CARD_HERO_TEXT_MAX ? `${text.slice(0, CARD_HERO_TEXT_MAX)}…` : text}")` : ''}`,
|
|
178
|
+
page?.largestPx !== undefined && `largest text ${px(page.largestPx)}${page.largestFam ? ` (${page.largestFam})` : ''}`,
|
|
179
|
+
page?.bodyPx !== undefined && `body ${px(page.bodyPx)}`,
|
|
180
|
+
hero?.heroPx !== undefined && !!page?.bodyPx && `hero ÷ body ${(hero.heroPx / page.bodyPx).toFixed(1)}`,
|
|
181
|
+
page?.families?.length && `families by characters: ${page.families.join(' · ')}`,
|
|
182
|
+
page?.headingFaces?.length && `heading faces: ${page.headingFaces.join(' · ')}`,
|
|
183
|
+
page?.upperSharePct !== undefined && `caps share ${page.upperSharePct}%`,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function compositionRow(n: VisitNumbers): string {
|
|
188
|
+
const l = n.typeLayout?.layout;
|
|
189
|
+
const s = n.typeLayout?.sections;
|
|
190
|
+
return parts(
|
|
191
|
+
l?.docHeight !== undefined && `page ${px(l.docHeight)}${l.screens !== undefined ? ` = ${l.screens} screens` : ''}`,
|
|
192
|
+
l?.contentSpan !== undefined && `text span ${px(l.contentSpan)}${l.textLeftP10 !== undefined ? ` from x=${Math.round(l.textLeftP10)}` : ''}`,
|
|
193
|
+
l?.paraWidthMedian !== undefined && `paragraph width median ${px(l.paraWidthMedian)}`,
|
|
194
|
+
s?.count !== undefined && `${s.count} blocks${s.distinctSkeletons !== undefined ? `, ${s.distinctSkeletons} distinct skeletons` : ''}`
|
|
195
|
+
+ `${s.consecutiveRepeats !== undefined ? `, ${s.consecutiveRepeats} back-to-back repeats` : ''}`,
|
|
196
|
+
s?.padTopMedian !== undefined && `first text sits ${px(s.padTopMedian)} into a block (median)`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function imageryRow(n: VisitNumbers): string {
|
|
201
|
+
return parts(
|
|
202
|
+
n.firstPictureAreaPct !== undefined && `picture area: first screen ${n.firstPictureAreaPct}%`,
|
|
203
|
+
n.pictureAreaMean !== undefined && `mean per screen ${n.pictureAreaMean}%${n.pictureAreaByScreen?.length ? ` (per screen ${n.pictureAreaByScreen.join('/')})` : ''}`,
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const bar = (h: VisitHeader, scrolled: boolean) => [
|
|
208
|
+
h.pos, scrolled && h.top !== undefined ? `top ${Math.round(h.top)}` : '', h.h !== undefined ? px(h.h) : '', h.bg ? `bg ${h.bg}` : '',
|
|
209
|
+
h.backdrop && h.backdrop !== 'none' ? h.backdrop : '', !scrolled && h.visibleLinks !== undefined ? `links ${h.visibleLinks}` : '',
|
|
210
|
+
].filter(Boolean).join(' ');
|
|
211
|
+
|
|
212
|
+
function headerRow(n: VisitNumbers): string {
|
|
213
|
+
return parts(
|
|
214
|
+
n.headerAtLoad && bar(n.headerAtLoad, false) && `at load: ${bar(n.headerAtLoad, false)}`,
|
|
215
|
+
n.headerScrolledUp && bar(n.headerScrolledUp, true) && `after down→up: ${bar(n.headerScrolledUp, true)}`,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** A footer measured 0 px tall is a measure that missed (an empty `<footer>` landmark), never a fact: the row is left out. */
|
|
220
|
+
function footerRow(n: VisitNumbers): string {
|
|
221
|
+
const f = n.footer;
|
|
222
|
+
if (!f || !(f.h! > 0)) return '';
|
|
223
|
+
return [
|
|
224
|
+
px(f.h!), f.bg ? `bg ${f.bg}${f.bgImage ? ' +image' : ''}` : '', f.links !== undefined ? `links ${f.links}` : '',
|
|
225
|
+
f.columnsApprox !== undefined ? `cols~${f.columnsApprox}` : '', f.hasForm !== undefined ? `form ${f.hasForm}` : '',
|
|
226
|
+
f.social ? `social [${f.social.join(',')}]` : '', f.legal !== undefined ? `legal ${f.legal}` : '',
|
|
227
|
+
f.largestTextPx !== undefined ? `biggest ${px(f.largestTextPx)}` : '',
|
|
228
|
+
].filter(Boolean).join(' ');
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function polishRow(n: VisitNumbers): string {
|
|
232
|
+
const o = n.overflow;
|
|
233
|
+
if (o?.docW === undefined || o.vw === undefined) return '';
|
|
234
|
+
return o.docW > o.vw ? `sideways overflow ${Math.round(o.docW)}px > ${Math.round(o.vw)}px` : 'sideways overflow: none';
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const ROW_FORMATS: Readonly<Partial<Record<CriticDimension, (n: VisitNumbers) => string>>> = {
|
|
238
|
+
[CriticDimension.Colour]: colourRow,
|
|
239
|
+
[CriticDimension.Type]: typeRow,
|
|
240
|
+
[CriticDimension.Composition]: compositionRow,
|
|
241
|
+
[CriticDimension.Imagery]: imageryRow,
|
|
242
|
+
[CriticDimension.Header]: headerRow,
|
|
243
|
+
[CriticDimension.Footer]: footerRow,
|
|
244
|
+
[CriticDimension.Polish]: polishRow,
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* ONE width's numbers in the reference card's words, row by row (`CARD_NUMBER_ROWS`) — the same function for the
|
|
249
|
+
* reference's visit and our round, so the critic compares numbers with numbers. Only what was measured is printed.
|
|
250
|
+
*/
|
|
251
|
+
export function cardNumbers(n: VisitNumbers | undefined): CardNumbers {
|
|
252
|
+
const out: CardNumbers = {};
|
|
253
|
+
if (!n) return out;
|
|
254
|
+
for (const row of CARD_NUMBER_ROWS) {
|
|
255
|
+
const line = ROW_FORMATS[row]?.(n);
|
|
256
|
+
if (line) out[row] = line;
|
|
257
|
+
}
|
|
258
|
+
return out;
|
|
259
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CRITIC_CHANGES, CRITIC_SCORE, CriticAnswer, criticVerdict } from './critic';
|
|
2
2
|
import { CRITIC_RUBRIC_DIMENSIONS, CRITIC_RUBRIC_HEADLINE, CRITIC_RUBRIC_POLISH, CRITIC_RUBRIC_SOURCE } from './critic-rubric.generated';
|
|
3
|
-
import { CaptureBox, CaptureView, CaptureWidth, CritiqueSheet, SheetPair } from './critic-sheet';
|
|
3
|
+
import { CaptureBox, CaptureView, CaptureWidth, CritiqueSheet, SheetMotion, SheetNumbers, SheetPair } from './critic-sheet';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* THE CRITIC'S PROMPT (ai-designer-plan §2d, AD3, AD-D18, R-H22): the instructions (stable — cached across rounds) and one
|
|
@@ -42,11 +42,48 @@ export enum CriticSheetLayout {
|
|
|
42
42
|
Paired = 'paired',
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/** AD-D29 (2): the card's numbers describe the reference's level, never a target (the AD3 Opus answers marked every hotel
|
|
46
|
+
* footer down for being ≈ 850px beside the reference's ≈ 1,270px). Part of `CRITIC_LEVEL_RULE`. */
|
|
47
|
+
export const CRITIC_CARD_LEVEL_WORDS = 'The card\'s numbers describe the reference\'s level, not a target: a size, a height, a share or '
|
|
48
|
+
+ 'a count is never better for being nearer the reference\'s — a footer 850px tall is not worse for being shorter than the '
|
|
49
|
+
+ 'reference\'s 1,270px. Judge what ours does with its own numbers.';
|
|
50
|
+
|
|
45
51
|
/** AD-D18, in the words the critic reads. */
|
|
46
52
|
export const CRITIC_LEVEL_RULE = 'Score the LEVEL, never the likeness. Ask "is this page as good as the reference?", never "does it look '
|
|
47
53
|
+ 'like it?". Resemblance earns nothing: a page that borrows the reference\'s arrangement scores no higher than a different page made '
|
|
48
54
|
+ 'with the same care, and a page unlike the reference can score 10. The reference and its card show the standard to reach — its '
|
|
49
|
-
+ 'precision, its restraint, its finish — not a design to copy.'
|
|
55
|
+
+ 'precision, its restraint, its finish — not a design to copy. A capability the reference has and ours lacks lowers a score only '
|
|
56
|
+
+ 'where a visitor would feel the page is poorer for it; a different choice made with the same care scores the same (a slim bar '
|
|
57
|
+
+ 'beside a floating pill, a solid header beside a transparent one — say it as a change, never a lower score). This never '
|
|
58
|
+
+ 'softens the scale: a page that is plain, careless or unfinished scores 3–6 however different it is, and nothing is raised '
|
|
59
|
+
+ 'for being unlike the reference. ' + CRITIC_CARD_LEVEL_WORDS;
|
|
60
|
+
|
|
61
|
+
/** What a still sheet cannot show (AD3 calibration: a third of the critic's bugs, and every 5.0 cap on a proof page, were
|
|
62
|
+
* a Scene's scroll runway or an unplayed reveal on the whole-page view, or a menu caught mid-fade). */
|
|
63
|
+
export const CRITIC_STILL_RULE = 'THE SHOTS ARE STILL. The whole-page view is taken in one frame: a Scene pins its picture while '
|
|
64
|
+
+ 'the visitor scrolls through a tall runway, and a reveal waits for the visitor to reach it — on that view both show as a tall '
|
|
65
|
+
+ 'empty band. That band is not a bug and not a fault of composition: judge the Scene and the reveals under motion, from the '
|
|
66
|
+
+ 'Scene views when the sheet has them. A band is a bug only when a screen-sized view, taken while scrolling like a visitor (the '
|
|
67
|
+
+ 'first screen, the header after scrolling, the footer, a list), shows it empty too. Likewise a view that shows two states at '
|
|
68
|
+
+ 'once (a menu half over the page, a logo drawn twice) was caught mid-transition: say so under motion, never mark it broken. '
|
|
69
|
+
+ 'The same holds for COLOUR: a Scene\'s ground — a dark runway, a film\'s night — seen on the whole-page view is judged at the '
|
|
70
|
+
+ 'Scene views, where the visitor sees it with its picture, never as a band of colour on its own (AD-D29).';
|
|
71
|
+
|
|
72
|
+
/** What a bug is, so one fault is scored once (AD3 calibration: the critic listed ≈ 3× the tester's bugs). */
|
|
73
|
+
export const CRITIC_BUG_RULE = 'A BUG is a fault in the build a visitor would notice: words over words, a cut-off line, an empty '
|
|
74
|
+
+ 'frame where a picture belongs, a dead button, a contrast fail, placeholder text. A design choice — spacing, rhythm, an '
|
|
75
|
+
+ 'off palette, a weak picture — is not a bug: it is scored in its own dimension, once. Never list one fault twice, and never '
|
|
76
|
+
+ 'list it as a bug AND lower a design dimension for it: a header defect (the name against the edge, a button over the bar\'s '
|
|
77
|
+
+ 'edge) lowers Header and is not listed again. Content faults — a placeholder, a mislabelled picture, a list repeated — are '
|
|
78
|
+
+ 'the gate\'s to fix: list them together as ONE bug. Marks only the phone shows — a focus ring, a few px off — are listed '
|
|
79
|
+
+ 'together as ONE bug, never broken.';
|
|
80
|
+
|
|
81
|
+
/** How motion is judged when the shots are still (AD-D27; the AD3 calibration on 5.205.0: motion −0.92 below the tester, the
|
|
82
|
+
* reference card listing its motion while ours was read off stills). */
|
|
83
|
+
export const CRITIC_MOTION_RULE = 'MOTION is judged from the Scene views and from THE MOTION rows: what moves on each live page, '
|
|
84
|
+
+ 'counted the same way on both at the first screen (the card\'s Motion row prints the same counts — lenis is smooth scroll, '
|
|
85
|
+
+ 'sticky the pinned elements, anims the animations running, transitions the controls that ease). Compare those rows, not '
|
|
86
|
+
+ 'what a still cannot show: motion the reference has is a fault only when ours has nothing in its place.';
|
|
50
87
|
|
|
51
88
|
const WIDTH_WORDS: Readonly<Record<CaptureWidth, string>> = { [CaptureWidth.Laptop]: 'Laptop 1440', [CaptureWidth.Phone]: 'Phone 390' };
|
|
52
89
|
const VIEW_WORDS: Readonly<Record<CaptureView, string>> = {
|
|
@@ -63,8 +100,31 @@ const VIEW_WORDS: Readonly<Record<CaptureView, string>> = {
|
|
|
63
100
|
[CaptureView.Footer]: 'the footer',
|
|
64
101
|
[CaptureView.Full]: 'the whole page, scaled down',
|
|
65
102
|
};
|
|
103
|
+
/** The label of a view the reference has no shot of (a Scene stop): ours is judged for motion on its own. */
|
|
104
|
+
export const OURS_ALONE_WORDS = 'ours alone (the reference has no such view) — judge our motion: the Scene as the visitor scrolls';
|
|
66
105
|
const where = (width: CaptureWidth, view: CaptureView) => `${WIDTH_WORDS[width]} · ${VIEW_WORDS[view]}`;
|
|
67
106
|
|
|
107
|
+
/** THE MOTION rows (AD-D27): each width, the reference's count then ours, in the card's words; a side not measured says so. */
|
|
108
|
+
export function motionText(motion: ReadonlyArray<SheetMotion>, reference: string): string {
|
|
109
|
+
return [
|
|
110
|
+
'THE MOTION, counted the same way on both live pages at the first screen (the stills cannot show it):',
|
|
111
|
+
...motion.map(m => `${WIDTH_WORDS[m.width]} — ${reference}: ${m.reference ?? 'not measured'}; ours: ${m.ours ?? 'not measured'}`),
|
|
112
|
+
].join('\n');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** The rubric's name of a dimension (`Imagery`), for the numbers' rows. */
|
|
116
|
+
const DIMENSION_WORDS = (d: string) => CRITIC_RUBRIC_DIMENSIONS.find(r => r.key === d)?.name ?? d;
|
|
117
|
+
|
|
118
|
+
/** THE NUMBERS (AD-D29): row by row, each width, the reference's numbers then ours, in the card's words; a side not
|
|
119
|
+
* measured says so. */
|
|
120
|
+
export function numbersText(numbers: ReadonlyArray<SheetNumbers>, reference: string): string {
|
|
121
|
+
return [
|
|
122
|
+
'THE NUMBERS, row by row as the reference\'s card prints them, measured the same way on both live pages (read sizes and '
|
|
123
|
+
+ 'shares here, never off a scaled-down picture; the reference\'s numbers show its level, not a target):',
|
|
124
|
+
...numbers.map(n => `${DIMENSION_WORDS(n.dimension)} · ${WIDTH_WORDS[n.width]} — ${reference}: ${n.reference ?? 'not measured'}; ours: ${n.ours ?? 'not measured'}`),
|
|
125
|
+
].join('\n');
|
|
126
|
+
}
|
|
127
|
+
|
|
68
128
|
/** The rubric as the critic reads it: each dimension with what it compares, then the headline and the polish rule. */
|
|
69
129
|
export function criticRubricText(): string {
|
|
70
130
|
return [
|
|
@@ -87,10 +147,13 @@ export function criticSystem(): CriticPromptPart[] {
|
|
|
87
147
|
},
|
|
88
148
|
{ text: CRITIC_LEVEL_RULE },
|
|
89
149
|
{ text: criticRubricText() },
|
|
150
|
+
{ text: `${CRITIC_STILL_RULE}\n${CRITIC_MOTION_RULE}\n${CRITIC_BUG_RULE}` },
|
|
90
151
|
{
|
|
91
152
|
text: [
|
|
92
153
|
'EVIDENCE: one line per dimension, read off the sheet as a position, a size or a colour — "<reference> sets the hero at '
|
|
93
|
-
+ '≈ 100px on paper #FFFFFC; ours sets it at 64px on #F3F0EA". A line with no measurement is refused.'
|
|
154
|
+
+ '≈ 100px on paper #FFFFFC; ours sets it at 64px on #F3F0EA". A line with no measurement is refused. Where THE '
|
|
155
|
+
+ 'NUMBERS give a size or a share, take it from there: the pictures are scaled down, and a size read off them runs '
|
|
156
|
+
+ 'small.',
|
|
94
157
|
`CHANGES: ${CRITIC_CHANGES.min}–${CRITIC_CHANGES.max}, the ones that move the LOWEST score most, at least one aimed at it. Write `
|
|
95
158
|
+ 'each as a brief for the designer, in our own terms (what to change, where, by how much). Never name the reference in a '
|
|
96
159
|
+ 'brief, and never ask to copy it or make it look like it.',
|
|
@@ -129,19 +192,24 @@ export function criticRoundContent(input: CriticRoundInput, sheet: CritiqueSheet
|
|
|
129
192
|
out.push(text(`THE REFERENCE'S CARD (its level, in words and numbers — not a design to copy):\n${input.referenceCard}`));
|
|
130
193
|
if (layout === CriticSheetLayout.Cached) {
|
|
131
194
|
out.push(text(`THE REFERENCE, ${input.reference}, view by view:`));
|
|
132
|
-
for (const p of sheet.pairs) out.push(text(`${where(p.width, p.view)} — the reference:`), shot(p.reference));
|
|
195
|
+
for (const p of sheet.pairs) if (p.reference) out.push(text(`${where(p.width, p.view)} — the reference:`), shot(p.reference));
|
|
133
196
|
out[out.length - 1] = { ...out[out.length - 1], cache: true };
|
|
134
197
|
out.push(page, text('OUR PAGE, the same views:'));
|
|
135
|
-
for (const p of sheet.pairs) out.push(text(`${where(p.width, p.view)} — ours:`), shot(p.ours));
|
|
198
|
+
for (const p of sheet.pairs) out.push(text(`${where(p.width, p.view)} — ${p.reference ? 'ours' : OURS_ALONE_WORDS}:`), shot(p.ours));
|
|
136
199
|
} else {
|
|
137
200
|
out.unshift(page);
|
|
138
|
-
for (const p of sheet.pairs)
|
|
201
|
+
for (const p of sheet.pairs) {
|
|
202
|
+
if (p.reference) out.push(text(`${where(p.width, p.view)} — the reference:`), shot(p.reference));
|
|
203
|
+
out.push(text(`${where(p.width, p.view)} — ${p.reference ? 'ours' : OURS_ALONE_WORDS}:`), shot(p.ours));
|
|
204
|
+
}
|
|
139
205
|
}
|
|
140
206
|
sheet.crops.forEach((c, i) => {
|
|
141
207
|
const head = `Crop ${i + 1}, ${c.why} (${where(c.width, c.view)}, ×${c.zoom})`;
|
|
142
208
|
if (c.reference) out.push(text(`${head} — the reference:`), { kind: CriticContentKind.Crop, ref: c.reference.ref, box: c.reference.box, zoom: c.zoom });
|
|
143
209
|
out.push(text(`${head} — ours:`), { kind: CriticContentKind.Crop, ref: c.ours.ref, box: c.ours.box, zoom: c.zoom });
|
|
144
210
|
});
|
|
211
|
+
if (sheet.numbers?.length) out.push(text(numbersText(sheet.numbers, input.reference)));
|
|
212
|
+
if (sheet.motion?.length) out.push(text(motionText(sheet.motion, input.reference)));
|
|
145
213
|
if (input.measures?.length) out.push(text(`THE MEASURES (ours):\n${input.measures.join('\n')}`));
|
|
146
214
|
if (input.gateFindings?.length) out.push(text(`THE GATE'S FINDINGS:\n${input.gateFindings.join('\n')}`));
|
|
147
215
|
if (input.lastCritique) {
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
5
|
/** Where the rubric came from, and a hash of its section (a changed rubric is a new hash). */
|
|
6
|
-
export const CRITIC_RUBRIC_SOURCE = { file: 'team/reference-score.md', section: '§2', hash: "
|
|
6
|
+
export const CRITIC_RUBRIC_SOURCE = { file: 'team/reference-score.md', section: '§2', hash: "08ab197d4bfd" } as const;
|
|
7
7
|
|
|
8
8
|
/** The eight dimensions in the rubric's order: the key the critic answers under, the name, what is compared. */
|
|
9
9
|
export const CRITIC_RUBRIC_DIMENSIONS: ReadonlyArray<{ readonly n: number; readonly key: string; readonly name: string; readonly compares: string }> = [
|
|
10
|
-
{ n: 1, key: "colour", name: "Colour", compares: "ground colour, how much accent and where, dark bands vs grey-black, palette harmony. Numbers: dominant colours, ΔE to the nearest target palette, contrast" },
|
|
10
|
+
{ n: 1, key: "colour", name: "Colour", compares: "ground colour, how much accent and where, dark bands vs grey-black, palette harmony. A Scene's ground (a dark runway, a film's night) is judged at the Scene views with its picture, never as a band on the whole-page still. Numbers: dominant colours, ΔE to the nearest target palette, contrast" },
|
|
11
11
|
{ n: 2, key: "type", name: "Type", compares: "the display face's character, hero size ÷ body size, weights, tracking, uppercase use. Numbers: hero px, ratio, families" },
|
|
12
12
|
{ n: 3, key: "composition", name: "Composition", compares: "column width, whitespace rhythm, asymmetry and overlap, section variety (two sections in a row on one skeleton = a fault). Numbers: content width, section padding, distinct skeletons per page" },
|
|
13
|
-
{ n: 4, key: "imagery", name: "Imagery", compares: "share of the screen that is picture, full-bleed use, crops, on-subject
|
|
14
|
-
{ n: 5, key: "header", name: "Header", compares: "
|
|
13
|
+
{ n: 4, key: "imagery", name: "Imagery", compares: "share of the screen that is picture, full-bleed use, crops, on-subject (an empty picture frame is a Polish bug, not scored here again). Numbers: picture area % per screen" },
|
|
14
|
+
{ n: 5, key: "header", name: "Header", compares: "how well it is made: its craft, legibility, the menu (shelves, full screen), its behaviour on scroll, how it sits on the opening picture. Judged at its own level: a shape or a scroll behaviour different from the targets' is not a fault (a slim bar beside a floating pill, solid beside transparent), say it as a change, never a lower score. A header defect (the name against the edge, a button over the bar's edge, no menu control on the phone) is scored here, once" },
|
|
15
15
|
{ n: 6, key: "footer", name: "Footer", compares: "layout, richness (newsletter, social, facts), ground, legal row" },
|
|
16
|
-
{ n: 7, key: "motion", name: "Motion & feel", compares: "scroll scenes, reveals, hover, page transitions, smoothness on the phone" },
|
|
17
|
-
{ n: 8, key: "polish", name: "Polish (UI bugs)", compares: "overlaps, clipped text, misalignment, broken 390 layout, contrast fails, placeholder text, empty boxes. Each bug −1. Any bug a visitor would call broken caps the whole score at 5. Every bug becomes a GitHub issue" },
|
|
16
|
+
{ n: 7, key: "motion", name: "Motion & feel", compares: "scroll scenes, reveals, hover, page transitions, smoothness on the phone. Stills cannot show motion: judge it from the Scene views and from the motion rows, the card's and ours, measured the same way on both live pages (smooth scroll, sticky, animations running, transitions declared). Motion a target has is a fault only when ours has nothing in its place" },
|
|
17
|
+
{ n: 8, key: "polish", name: "Polish (UI bugs)", compares: "overlaps, clipped text, misalignment, broken 390 layout, contrast fails, placeholder text, empty boxes. A bug is a fault in the build, counted here once and never again in 1–7; a design choice (spacing, rhythm, palette) is scored in its own dimension, not here, and a header defect is scored under Header, not again here. Content faults (a placeholder, a mislabelled picture, a list repeated) are the gate's to fix: they are listed together as ONE bug. Marks only the phone shows (a focus ring, a few px off) are listed together as ONE bug, never broken. A still capture's blank Scene runway, an unplayed reveal or a menu caught mid-fade is not a bug. Each bug −1. Any bug a visitor would call broken caps the whole score at 5. Every bug becomes a GitHub issue" },
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
/** The headline rule, in the rubric's words. */
|
|
21
|
-
export const CRITIC_RUBRIC_HEADLINE = "Headline = the mean of 1–7, capped by 8. Every score has one sentence of evidence: \"hotelaurelia does X; ours does Y\", with the two crops side by side.";
|
|
21
|
+
export const CRITIC_RUBRIC_HEADLINE = "Headline = the mean of 1–7, capped by 8. Every score has one sentence of evidence: \"hotelaurelia does X; ours does Y\", with the two crops side by side. The scale: 9–10 the reference's own level (a target reference scores 8–10, §3.1); 8 it stands beside the reference; 6 a careful template; 5 competent and plain; 3 unfinished. A capability a target has and ours lacks lowers a score only where a visitor would feel the page is poorer for it; a different choice made with the same care scores the same. The card's numbers describe the target's level, not a target to reach: a size, a height, a share or a count is never better for being nearer the target's (a footer 850px tall is not worse for being shorter than 1,270px); ours is read from its own numbers, measured the same way. The scale does not soften: a page that is plain, careless or unfinished scores 3–6 however different it is, and a page is never raised for being unlike the targets.";
|
|
22
22
|
|
|
23
23
|
/** The polish row's numbers: what each bug costs, and the cap a bug a visitor would call broken puts on the page. */
|
|
24
24
|
export const CRITIC_RUBRIC_POLISH = { bugPenalty: 1, brokenCap: 5 } as const;
|