Remove alternate hosts from tooling probes

Keep the probe suite on the Material composition so browser fixtures and capture drivers no longer render or select Cupertino hosts. Record the final residual legacy arguments and implementation checks for the delivery gate.
This commit is contained in:
2026-11-11 21:38:30 +00:00
parent 7cb95471cb
commit b60ad6d98f
68 changed files with 405 additions and 747 deletions
+28
View File
@@ -0,0 +1,28 @@
# Material tooling final sweep
This sweep changed 68 tracked files in this worktree (including this note),
with 374 insertions and 744 deletions in the source/driver diff (the note is
not included in those counts). The final inventory under `app/tool` contains no Cupertino
imports/widgets, iOS target branches, `PROBE_HOST`/`PROBE_PLATFORM`/
`PROBE_VARIANT` selectors, `material|material` selectors, or `platform=`/
`host=` query arguments.
The only remaining Cupertino-named arguments are these three required legacy
parameters, retained because the current library APIs still require them and
ignore them:
- `app/tool/app_host_probe_entry.dart:21` — `cupertino: false`
- `app/tool/template_create_probe.dart:123` — `cupertino: false`
- `app/tool/templates_wiring_probe_entry.dart:16` — `cupertino: false`
Checks:
- `node --check`: all 48 changed `.mjs` drivers, clean.
- `tool/analyze.sh`: clean, exit 0.
- `flutter analyze` on all 19 changed Dart tool entrypoints: clean, exit 0.
- `flutter build web --target tool/search_selection_probe_entry.dart --output
build/probe-app`: passed.
- `flutter build web --target tool/artifact_gallery_probe.dart --output
build/probe-artifacts`: passed.
- No focused Flutter tests were run; this tooling-only sweep has no requested
behavioral test path.
+3 -5
View File
@@ -1,13 +1,11 @@
// The normal application composition with an explicit host, for browser // The normal application composition for browser captures.
// captures of the Cupertino app (the web build is Material by design, see
// `prefersCupertino`).
// //
// Build and capture (from app/): // Build and capture (from app/):
// flutter build web --target tool/app_host_probe_entry.dart \ // flutter build web --target tool/app_host_probe_entry.dart \
// -o build/probe-app-host // -o build/probe-app-host
// serve it with the runs or pipelines fixture server // serve it with the runs or pipelines fixture server
// (`tool/runs_probe_server.mjs`, `tool/pipelines_wiring_probe_server.mjs`) // (`tool/runs_probe_server.mjs`, `tool/pipelines_wiring_probe_server.mjs`)
// and open `/runs?host=cupertino`; without `host=cupertino` it is Material. // and open `/runs`.
// //
// It connects only to the page's own origin, like the web app. // It connects only to the page's own origin, like the web app.
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@@ -20,7 +18,7 @@ void main() {
runApp( runApp(
PipelinesApp( PipelinesApp(
server: ServerEndpoint.resolve(base: Uri.base, web: true), server: ServerEndpoint.resolve(base: Uri.base, web: true),
cupertino: Uri.base.queryParameters['host'] == 'cupertino', cupertino: false,
), ),
); );
} }
+8 -30
View File
@@ -8,7 +8,6 @@
// the app consumes. The recorded urls point at the probe's own loopback origin, // the app consumes. The recorded urls point at the probe's own loopback origin,
// so the external Open action has a real target. No server or operator run is // so the external Open action has a real target. No server or operator run is
// touched. // touched.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_gallery_page.dart'; import 'package:pipelines_app/features/artifacts/ui/artifact_gallery_page.dart';
@@ -272,7 +271,6 @@ JsonMap _run(String origin, String state) => <String, dynamic>{
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
final theme = params['theme'] == 'dark' ? Brightness.dark : Brightness.light; final theme = params['theme'] == 'dark' ? Brightness.dark : Brightness.light;
final origin = params['origin'] ?? 'https://artifacts.invalid'; final origin = params['origin'] ?? 'https://artifacts.invalid';
final state = params['state'] ?? 'default'; final state = params['state'] ?? 'default';
@@ -300,28 +298,14 @@ void main() {
).copyWith(textScaler: TextScaler.linear(textScale)), ).copyWith(textScaler: TextScaler.linear(textScale)),
child: app!, child: app!,
); );
if (cupertino) { runApp(
runApp( MaterialApp(
CupertinoApp( title: 'Artifacts probe',
title: 'Artifacts probe', theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
theme: CupertinoThemeData(brightness: theme), builder: scaled,
builder: (context, app) => Theme( home: body,
data: ThemeData(platform: TargetPlatform.iOS), ),
child: scaled(context, app), );
),
home: body,
),
);
} else {
runApp(
MaterialApp(
title: 'Artifacts probe',
theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
builder: scaled,
home: body,
),
);
}
} }
class _ProbeBody extends StatefulWidget { class _ProbeBody extends StatefulWidget {
@@ -371,12 +355,6 @@ class _ProbeBodyState extends State<_ProbeBody> {
gateway: _gateway, gateway: _gateway,
onBack: () {}, onBack: () {},
); );
if (Theme.of(context).platform == TargetPlatform.iOS) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Runs')),
child: SafeArea(child: detail),
);
}
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Runs')), appBar: AppBar(title: const Text('Runs')),
body: detail, body: detail,
+41 -45
View File
@@ -7,7 +7,7 @@
// Serves the built fixture on an OS-assigned loopback port, drives headless // Serves the built fixture on an OS-assigned loopback port, drives headless
// Chrome, and records the actual recorded rows, the selection dialog, the safe // Chrome, and records the actual recorded rows, the selection dialog, the safe
// external Open, the empty/unavailable states, both native hosts, dark // external Open, the empty/unavailable states, both native hosts, dark
// Cupertino and the 320/2x states. No server or operator run is touched. // Material and the 320/2x states. No server or operator run is touched.
import { createServer } from 'node:http'; import { createServer } from 'node:http';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import { spawn } from 'node:child_process'; import { spawn } from 'node:child_process';
@@ -552,8 +552,8 @@ try {
// In-app artifact viewer: image, text, unsupported, paging, back and HTTP // In-app artifact viewer: image, text, unsupported, paging, back and HTTP
// failure. The fixture serves same-origin artifact urls on this loopback // failure. The fixture serves same-origin artifact urls on this loopback
// origin, so the viewer is allowed to fetch them; no browser tab may open. // origin, so the viewer is allowed to fetch them; no browser tab may open.
const galleryView = (extra = '', platform = 'material') => const galleryView = (extra = '') =>
`${origin}/?view=gallery&platform=${platform}&origin=${encodeURIComponent(origin)}${extra}`; `${origin}/?view=gallery&origin=${encodeURIComponent(origin)}${extra}`;
const beforeViewerTargets = await targetCount(); const beforeViewerTargets = await targetCount();
await navigate(galleryView(), 'Artifacts'); await navigate(galleryView(), 'Artifacts');
await clickLowestPrefix('shot.png'); await clickLowestPrefix('shot.png');
@@ -648,10 +648,10 @@ try {
evidence.checks.push({ check: 'an external artifact opens marked, unfetched, with facts and actions', value: true }); evidence.checks.push({ check: 'an external artifact opens marked, unfetched, with facts and actions', value: true });
await capture('a1w-viewer-external'); await capture('a1w-viewer-external');
// 320 px at 2x text on both hosts: the viewer keeps its facts, paging and // 320 px at 2x text: the viewer keeps its facts, paging and
// controls whole. // controls whole.
const scaledViewer = async (platform, prefix) => { const scaledViewer = async (prefix) => {
await navigate(galleryView('', platform), 'Artifacts'); await navigate(galleryView(), 'Artifacts');
await clickLowestPrefix('shot.png'); await clickLowestPrefix('shot.png');
await delay(700); await delay(700);
const scaledBody = await bodyText(); const scaledBody = await bodyText();
@@ -665,57 +665,55 @@ try {
} }
await capture(`${prefix}-viewer`, 320, 720, 1); await capture(`${prefix}-viewer`, 320, 720, 1);
}; };
await scaledViewer('material', 'a1w-material-2x-320'); await scaledViewer('a1w-material-2x-320');
evidence.checks.push({ check: 'Material 2x/320 viewer keeps facts and paging', value: true }); evidence.checks.push({ check: 'Material 2x/320 viewer keeps facts and paging', value: true });
await scaledViewer('cupertino', 'a1w-cupertino-2x-320');
evidence.checks.push({ check: 'Cupertino 2x/320 viewer keeps facts and paging', value: true });
// Cupertino light: the tinted action, the native dialog and its actions. // Material light: the tinted action, the native dialog and its actions.
await openGallery(`platform=cupertino&theme=light&origin=${encodeURIComponent(origin)}`); await openGallery(`theme=light&origin=${encodeURIComponent(origin)}`);
const cupertinoBody = await bodyText(); const materialBody = await bodyText();
if (!cupertinoBody.includes('shot.png') || !cupertinoBody.includes('reviewer · visit 2')) { if (!materialBody.includes('shot.png') || !materialBody.includes('reviewer · visit 2')) {
throw new Error(`Cupertino gallery missing recorded rows: ${JSON.stringify(cupertinoBody)}`); throw new Error(`Material gallery missing recorded rows: ${JSON.stringify(materialBody)}`);
} }
evidence.checks.push({ check: 'Cupertino lists the same recorded rows', value: true }); evidence.checks.push({ check: 'Material lists the same recorded rows', value: true });
await capture('a1w-cupertino-gallery'); await capture('a1w-material-gallery');
await clickLowestPrefix('result.zip'); await clickLowestPrefix('result.zip');
if (!(await hasLabel('Open')) || !(await hasLabel('Copy link'))) { if (!(await hasLabel('Open')) || !(await hasLabel('Copy link'))) {
throw new Error(`Cupertino selection offers no actions: ${JSON.stringify(await labels())}`); throw new Error(`Material selection offers no actions: ${JSON.stringify(await labels())}`);
} }
const cupertinoSelected = await bodyText(); const materialSelected = await bodyText();
if (!cupertinoSelected.includes('Artifacts · 1 recorded · partial capture')) { if (!materialSelected.includes('Artifacts · 1 recorded · partial capture')) {
throw new Error(`Cupertino selection lost its capture facts: ${JSON.stringify(cupertinoSelected)}`); throw new Error(`Material selection lost its capture facts: ${JSON.stringify(materialSelected)}`);
} }
evidence.checks.push({ check: 'Cupertino selection shows the recorded facts and native actions', value: true }); evidence.checks.push({ check: 'Material selection shows the recorded facts and native actions', value: true });
await capture('a1w-cupertino-selected'); await capture('a1w-material-selected');
// Cupertino dark: the gallery and its dialog on the dark host. // Material dark: the gallery and its dialog on the dark host.
await openGallery(`platform=cupertino&theme=dark&origin=${encodeURIComponent(origin)}`); await openGallery(`theme=dark&origin=${encodeURIComponent(origin)}`);
await capture('a1w-cupertino-dark-gallery'); await capture('a1w-material-dark-gallery');
await clickLowestPrefix('result.zip'); await clickLowestPrefix('result.zip');
const darkLabels = await labels(); const darkLabels = await labels();
const darkTitle = darkLabels.find((label) => label.startsWith('result.zip')); const darkTitle = darkLabels.find((label) => label.startsWith('result.zip'));
const titleRect = await rectOfPrefix('result.zip'); const titleRect = await rectOfPrefix('result.zip');
const darkText = [await bodyText(), ...darkLabels].join('\n'); const darkText = [await bodyText(), ...darkLabels].join('\n');
if (!darkText.includes('Artifacts · 1 recorded · partial capture')) { if (!darkText.includes('Artifacts · 1 recorded · partial capture')) {
throw new Error(`Dark Cupertino dialog did not render: ${JSON.stringify(darkText)}`); throw new Error(`Dark Material dialog did not render: ${JSON.stringify(darkText)}`);
} }
if (!titleRect) throw new Error(`Dark Cupertino dialog title missing: ${JSON.stringify(darkLabels)}`); if (!titleRect) throw new Error(`Dark Material dialog title missing: ${JSON.stringify(darkLabels)}`);
const luminance = await brightestPixel(titleRect); const luminance = await brightestPixel(titleRect);
if (luminance.max < 0.5) { if (luminance.max < 0.5) {
throw new Error(`Dark Cupertino dialog text is not light: ${JSON.stringify(luminance)}`); throw new Error(`Dark Material dialog text is not light: ${JSON.stringify(luminance)}`);
} }
evidence.checks.push({ evidence.checks.push({
check: 'dark Cupertino dialog text is light on the popup surface', check: 'dark Material dialog text is light on the popup surface',
value: true, value: true,
luminance: luminance.max, luminance: luminance.max,
title: darkTitle, title: darkTitle,
}); });
await capture('a1w-cupertino-dark-selected'); await capture('a1w-material-dark-selected');
// 320 px at 2x text on both hosts: the recorded rows and facts stay whole. // 320 px at 2x text: the recorded rows and facts stay whole.
const openScaled = async (platform, prefix) => { const openScaled = async (prefix) => {
await openGallery(`platform=${platform}&theme=light&scale=2&origin=${encodeURIComponent(origin)}`); await openGallery(`theme=light&scale=2&origin=${encodeURIComponent(origin)}`);
const scaled = await bodyText(); const scaled = await bodyText();
for (const recorded of ['build.log', 'shot.png', 'reviewer · visit 1']) { for (const recorded of ['build.log', 'shot.png', 'reviewer · visit 1']) {
if (!scaled.includes(recorded)) { if (!scaled.includes(recorded)) {
@@ -734,18 +732,17 @@ try {
} }
await capture(`${prefix}-selected`, 320, 720, 1); await capture(`${prefix}-selected`, 320, 720, 1);
}; };
await openScaled('material', 'a1w-material-2x-320'); await openScaled('a1w-material-2x-320');
evidence.checks.push({ check: 'Material 2x/320 keeps the recorded rows, facts and actions', value: true }); evidence.checks.push({ check: 'Material 2x/320 keeps the recorded rows, facts and actions', value: true });
await openScaled('cupertino', 'a1w-cupertino-2x-320');
evidence.checks.push({ check: 'Cupertino 2x/320 keeps the recorded rows, facts and actions', value: true });
// Turn documents: recorded input/memory/output/session.html are their own // Turn documents: recorded input/memory/output/session.html are their own
// rows per visit, absent ones carry the exact wording, markdown opens in the // rows per visit, absent ones carry the exact wording, markdown opens in the
// renderer and the session export stays external-only even when sniffed as // renderer and the session export stays external-only even when sniffed as
// text/plain. // text/plain.
for (const platform of ['material', 'cupertino']) { {
const prefix = `a4-${platform}`; const platform = 'material';
await navigate(galleryView('&state=documents', platform), 'Artifacts'); const prefix = 'a4-material';
await navigate(galleryView('&state=documents'), 'Artifacts');
const documentsBody = await bodyText(); const documentsBody = await bodyText();
for (const fact of [ for (const fact of [
'Turn documents', 'Turn documents',
@@ -782,7 +779,7 @@ try {
await clickExact('Close'); await clickExact('Close');
await delay(300); await delay(300);
await navigate(galleryView('&state=documents', platform), 'Artifacts'); await navigate(galleryView('&state=documents'), 'Artifacts');
await clickExact('input.md'); await clickExact('input.md');
await delay(700); await delay(700);
const inputBody = await visibleText(); const inputBody = await visibleText();
@@ -857,12 +854,12 @@ try {
Array.isArray(actual) && Array.isArray(actual) &&
actual.length === expected.length && actual.length === expected.length &&
actual.every((value, index) => value === expected[index]); actual.every((value, index) => value === expected[index]);
const fileProbe = async (platform, prefix, extra = '') => { const fileProbe = async (prefix, extra = '') => {
await send('Emulation.setDeviceMetricsOverride', { await send('Emulation.setDeviceMetricsOverride', {
width: 390, height: 844, deviceScaleFactor: 1, mobile: true, width: 390, height: 844, deviceScaleFactor: 1, mobile: true,
}, session); }, session);
const before = await targetCount(); const before = await targetCount();
await navigate(galleryView(`&state=files${extra}`, platform), 'Artifacts'); await navigate(galleryView(`&state=files${extra}`), 'Artifacts');
await clickExact('report.zip'); await clickExact('report.zip');
await delay(500); await delay(500);
if (!(await hasLabel('Download')) || !(await hasLabel('Share'))) { if (!(await hasLabel('Download')) || !(await hasLabel('Share'))) {
@@ -949,9 +946,8 @@ try {
}); });
await capture(`${prefix}-files-shared`); await capture(`${prefix}-files-shared`);
}; };
await fileProbe('material', 'a3-material'); await fileProbe('a3-material');
await fileProbe('cupertino', 'a3-cupertino'); await fileProbe('a3-material-dark', '&theme=dark');
await fileProbe('cupertino', 'a3-cupertino-dark', '&theme=dark');
console.log(JSON.stringify(evidence, null, 2)); console.log(JSON.stringify(evidence, null, 2));
} finally { } finally {
+2 -27
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/features/attention/domain/attention_models.dart'; import 'package:pipelines_app/features/attention/domain/attention_models.dart';
@@ -36,7 +35,6 @@ List<AttentionEntry> _entries() => [
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['host'] == 'cupertino';
final scale = double.tryParse(params['scale'] ?? '') ?? 1; final scale = double.tryParse(params['scale'] ?? '') ?? 1;
final empty = params['mode'] == 'empty'; final empty = params['mode'] == 'empty';
final brightness = params['theme'] == 'light' final brightness = params['theme'] == 'light'
@@ -46,20 +44,7 @@ void main() {
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(scale)), data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(scale)),
child: app!, child: app!,
); );
final home = _ProbeHome( final home = _ProbeHome(entries: empty ? const [] : _entries());
cupertino: cupertino,
entries: empty ? const [] : _entries(),
);
if (cupertino) {
runApp(
CupertinoApp(
theme: CupertinoThemeData(brightness: brightness),
builder: scaled,
home: home,
),
);
return;
}
runApp( runApp(
MaterialApp( MaterialApp(
theme: ThemeData( theme: ThemeData(
@@ -73,9 +58,8 @@ void main() {
} }
class _ProbeHome extends StatefulWidget { class _ProbeHome extends StatefulWidget {
const _ProbeHome({required this.cupertino, required this.entries}); const _ProbeHome({required this.entries});
final bool cupertino;
final List<AttentionEntry> entries; final List<AttentionEntry> entries;
@override @override
@@ -121,15 +105,6 @@ class _ProbeHomeState extends State<_ProbeHome> {
Text('${_entries.length} needing attention now'), Text('${_entries.length} needing attention now'),
], ],
); );
if (widget.cupertino) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: const Text('Runs'),
trailing: bell,
),
child: SafeArea(child: body),
);
}
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Runs'), actions: [bell]), appBar: AppBar(title: const Text('Runs'), actions: [bell]),
body: SafeArea(child: body), body: SafeArea(child: body),
+10 -9
View File
@@ -115,10 +115,10 @@ try {
await send('Input.dispatchKeyEvent', { type: 'keyUp', ...key }, session); await send('Input.dispatchKeyEvent', { type: 'keyUp', ...key }, session);
}; };
let viewport = { width: 320, height: 640 }; let viewport = { width: 320, height: 640 };
const navigate = async (host, { mode = '', theme = 'dark', scale = 2, width = 320, height = 640 } = {}) => { const navigate = async ({ mode = '', theme = 'dark', scale = 2, width = 320, height = 640 } = {}) => {
viewport = { width, height }; viewport = { width, height };
await send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: theme }] }, session); await send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: theme }] }, session);
const query = new URLSearchParams({ host, theme, scale: String(scale) }); const query = new URLSearchParams({ theme, scale: String(scale) });
if (mode) query.set('mode', mode); if (mode) query.set('mode', mode);
await send('Page.navigate', { url: `http://127.0.0.1:${port}/?${query}` }, session); await send('Page.navigate', { url: `http://127.0.0.1:${port}/?${query}` }, session);
await delay(3000); await delay(3000);
@@ -138,9 +138,10 @@ try {
captures.push(name); captures.push(name);
}; };
for (const host of ['material', 'cupertino']) { {
const host = 'material';
// The hardest case: narrow, scaled text in dark. // The hardest case: narrow, scaled text in dark.
await navigate(host); await navigate();
requireLabels(await labels(), ['Notifications, 2 needing attention'], `${host} bell`); requireLabels(await labels(), ['Notifications, 2 needing attention'], `${host} bell`);
await record(`attention-${host}-dark-320-2x-bell.png`); await record(`attention-${host}-dark-320-2x-bell.png`);
@@ -191,7 +192,7 @@ try {
], `${host} closed sheet`); ], `${host} closed sheet`);
// Light and the default text scale on a normal phone width. // Light and the default text scale on a normal phone width.
await navigate(host, { theme: 'light', scale: 1, width: 390, height: 844 }); await navigate({ theme: 'light', scale: 1, width: 390, height: 844 });
requireLabels(await labels(), ['Notifications, 2 needing attention'], `${host} light bell`); requireLabels(await labels(), ['Notifications, 2 needing attention'], `${host} light bell`);
await record(`attention-${host}-light-390-1x-bell.png`); await record(`attention-${host}-light-390-1x-bell.png`);
if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: light bell not clickable`); if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: light bell not clickable`);
@@ -202,7 +203,7 @@ try {
], `${host} light sheet`); ], `${host} light sheet`);
await record(`attention-${host}-light-390-1x-sheet.png`); await record(`attention-${host}-light-390-1x-sheet.png`);
await navigate(host, { mode: 'empty' }); await navigate({ mode: 'empty' });
const emptyBell = await labels(); const emptyBell = await labels();
requireLabels(emptyBell, ['Notifications'], `${host} empty bell`); requireLabels(emptyBell, ['Notifications'], `${host} empty bell`);
if (emptyBell.some((label) => label.startsWith('Notifications,'))) throw new Error(`${host}: empty bell announced a count`); if (emptyBell.some((label) => label.startsWith('Notifications,'))) throw new Error(`${host}: empty bell announced a count`);
@@ -217,7 +218,7 @@ try {
// Clear all leaves the sheet open and honest: the empty copy, no Clear all // Clear all leaves the sheet open and honest: the empty copy, no Clear all
// and no row dismiss. Closing then shows a plain bell and no remaining work. // and no row dismiss. Closing then shows a plain bell and no remaining work.
await navigate(host); await navigate();
if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: bell not clickable for Clear all`); if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: bell not clickable for Clear all`);
await delay(1000); await delay(1000);
if (!(await clickScrolled('Clear all', { exact: true }))) throw new Error(`${host}: Clear all not clickable`); if (!(await clickScrolled('Clear all', { exact: true }))) throw new Error(`${host}: Clear all not clickable`);
@@ -236,7 +237,7 @@ try {
// Opening a Decision row closes the sheet and leaves the identity in place: // Opening a Decision row closes the sheet and leaves the identity in place:
// only answering the decision clears it. // only answering the decision clears it.
await navigate(host); await navigate();
if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: bell not clickable for Decision row`); if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: bell not clickable for Decision row`);
await delay(1000); await delay(1000);
if (!(await clickScrolled('Approve the release candidate'))) throw new Error(`${host}: Decision row not clickable`); if (!(await clickScrolled('Approve the release candidate'))) throw new Error(`${host}: Decision row not clickable`);
@@ -251,7 +252,7 @@ try {
// Opening a Failed row dismisses its identity before opening it, so the // Opening a Failed row dismisses its identity before opening it, so the
// bell no longer asks for a run the operator has already looked at. // bell no longer asks for a run the operator has already looked at.
await navigate(host); await navigate();
if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: bell not clickable for Failed row`); if (!(await clickLabel('Notifications, 2 needing attention', true))) throw new Error(`${host}: bell not clickable for Failed row`);
await delay(1000); await delay(1000);
if (!(await clickScrolled('Nightly audit with a label long enough'))) throw new Error(`${host}: Failed row not clickable`); if (!(await clickScrolled('Nightly audit with a label long enough'))) throw new Error(`${host}: Failed row not clickable`);
+1 -2
View File
@@ -205,13 +205,12 @@ try {
return { host, bell, sheet }; return { host, bell, sheet };
}; };
const cupertino = await drive('cupertino');
const material = await drive('material', { const material = await drive('material', {
userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
platform: 'Linux x86_64', platform: 'Linux x86_64',
}); });
const state = await (await fetch(`${fixture.url}/fixture/state`)).json(); const state = await (await fetch(`${fixture.url}/fixture/state`)).json();
console.log(JSON.stringify({ captures, cupertino, material, fixture: state }, null, 2)); console.log(JSON.stringify({ captures, material, fixture: state }, null, 2));
} finally { } finally {
try { ws?.close(); } catch {} try { ws?.close(); } catch {}
chrome.kill('SIGTERM'); chrome.kill('SIGTERM');
+19 -19
View File
@@ -526,7 +526,7 @@ try {
await capture('d1-changes-desktop-diff', 1280, 800); await capture('d1-changes-desktop-diff', 1280, 800);
await clickExact('Close diff'); await clickExact('Close diff');
// Presentation revision: the light theme and a narrow Cupertino surface, at // Presentation revision: the light theme and a narrow Material surface, at
// 2x so glyph advance, line tints and the popup inset are inspectable. // 2x so glyph advance, line tints and the popup inset are inspectable.
await navigate(`${origin}/?theme=light`); await navigate(`${origin}/?theme=light`);
await capture('d1-changes-phone-light-list', 390, 844); await capture('d1-changes-phone-light-list', 390, 844);
@@ -548,34 +548,34 @@ try {
await capture('d1-changes-desktop-light-diff', 1280, 800); await capture('d1-changes-desktop-light-diff', 1280, 800);
await clickExact('Close diff'); await clickExact('Close diff');
await navigate(`${origin}/?platform=cupertino&theme=light`); await navigate(`${origin}/?theme=light`);
await capture('d1-changes-cupertino-light-list', 390, 844); await capture('d1-changes-material-light-list', 390, 844);
// The Cupertino pager uses native buttons; paging keeps the visit heading. // The Material pager uses native buttons; paging keeps the visit heading.
await clickExact('Next visit'); await clickExact('Next visit');
const cupertinoSecond = await bodyText(); const materialSecond = await bodyText();
evidence.checks.push({ evidence.checks.push({
check: 'Cupertino pages to the second visit', check: 'Material pages to the second visit',
page: visitPage(cupertinoSecond), page: visitPage(materialSecond),
stage: visitStage(cupertinoSecond, 'reviewer'), stage: visitStage(materialSecond, 'reviewer'),
}); });
if (visitPage(cupertinoSecond) !== '2 of 5 recorded visits') { if (visitPage(materialSecond) !== '2 of 5 recorded visits') {
throw new Error(`Cupertino pager did not advance: ${JSON.stringify(cupertinoSecond)}`); throw new Error(`Material pager did not advance: ${JSON.stringify(materialSecond)}`);
} }
await capture('d1-changes-cupertino-light-page2', 390, 844); await capture('d1-changes-material-light-page2', 390, 844);
await clickExact('Previous visit'); await clickExact('Previous visit');
await clickPrefix('Open diff for lib/features/changes/domain/unified_patch.dart'); await clickPrefix('Open diff for lib/features/changes/domain/unified_patch.dart');
await capture('d1-changes-cupertino-light-diff', 390, 844); await capture('d1-changes-material-light-diff', 390, 844);
await capture('d1-changes-cupertino-light-diff-2x', 390, 844, 2); await capture('d1-changes-material-light-diff-2x', 390, 844, 2);
await navigate(`${origin}/?platform=cupertino`); await navigate(`${origin}/`);
const cupertinoLabels = await labels(); const materialLabels = await labels();
if (!cupertinoLabels.some((label) => label.includes('Changes probe'))) { if (!materialLabels.some((label) => label.includes('Changes probe'))) {
throw new Error('Cupertino fixture did not load'); throw new Error('Material fixture did not load');
} }
await clickPrefix('Open diff for lib/features/changes/domain/unified_patch.dart'); await clickPrefix('Open diff for lib/features/changes/domain/unified_patch.dart');
await capture('d1-changes-cupertino-diff', 1280, 800); await capture('d1-changes-material-diff', 1280, 800);
evidence.checks.push({ check: 'Cupertino viewer opened', value: true }); evidence.checks.push({ check: 'Material viewer opened', value: true });
evidence.checks.push({ check: 'visit capture written', value: visitFile }); evidence.checks.push({ check: 'visit capture written', value: visitFile });
console.log(JSON.stringify(evidence, null, 2)); console.log(JSON.stringify(evidence, null, 2));
} finally { } finally {
+8 -35
View File
@@ -6,7 +6,6 @@
// //
// These are server-shaped fixtures for rendering only. They are not a live run // These are server-shaped fixtures for rendering only. They are not a live run
// and never mutate a server. // and never mutate a server.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/changes/changes.dart'; import 'package:pipelines_app/features/changes/changes.dart';
@@ -210,52 +209,26 @@ List<JsonMap> probeVisitSteps() => [
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
final brightness = params['theme'] == 'light' final brightness = params['theme'] == 'light'
? Brightness.light ? Brightness.light
: Brightness.dark; : Brightness.dark;
final steps = params['visits'] == '1' ? probeVisitSteps() : probeSteps(); final steps = params['visits'] == '1' ? probeVisitSteps() : probeSteps();
if (cupertino) { runApp(
runApp( MaterialApp(
CupertinoApp( title: 'Changes probe',
title: 'Changes probe', theme: ThemeData(brightness: brightness, platform: TargetPlatform.android),
theme: CupertinoThemeData(brightness: brightness), home: _ProbeHome(steps: steps),
home: _ProbeHome(cupertino: true, steps: steps), ),
), );
);
} else {
runApp(
MaterialApp(
title: 'Changes probe',
theme: ThemeData(
brightness: brightness,
// Chrome on macOS reports a macOS default platform; the fixture
// states Material explicitly so both control sets are capturable.
platform: TargetPlatform.android,
),
home: _ProbeHome(cupertino: false, steps: steps),
),
);
}
} }
class _ProbeHome extends StatelessWidget { class _ProbeHome extends StatelessWidget {
const _ProbeHome({required this.cupertino, required this.steps}); const _ProbeHome({required this.steps});
final bool cupertino;
final List<JsonMap> steps; final List<JsonMap> steps;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final viewer = ChangesViewer(steps: steps); final viewer = ChangesViewer(steps: steps);
if (cupertino) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Changes probe'),
),
child: SafeArea(child: viewer),
);
}
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Changes probe')), appBar: AppBar(title: const Text('Changes probe')),
body: viewer, body: viewer,
+1 -1
View File
@@ -7,7 +7,7 @@
// node tool/chat_approvals_probe.mjs \ // node tool/chat_approvals_probe.mjs \
// --root build/probe-chat-approvals-material --out DIR --style material // --root build/probe-chat-approvals-material --out DIR --style material
// //
// The same fixture is built with CHAT_APPROVALS_PROBE_STYLE=cupertino. The // The same fixture is built with CHAT_APPROVALS_PROBE_STYLE=material. The
// script drives the real widget/controller through Chrome DevTools semantics, // script drives the real widget/controller through Chrome DevTools semantics,
// approves one permission and answers one question, and asserts the recorded // approves one permission and answers one question, and asserts the recorded
// answered states plus saved captures. // answered states plus saved captures.
+2 -8
View File
@@ -1,5 +1,5 @@
// Measures normal-app Back against a populated loopback chat, never operator data. // Measures normal-app Back against a populated loopback chat, never operator data.
// PROBE_PLATFORM=android CPU_RATE=4 CHAT_PAIRS=100 node tool/chat_back_latency_probe.mjs <web-build> <out> // CPU_RATE=4 CHAT_PAIRS=100 node tool/chat_back_latency_probe.mjs <web-build> <out>
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { mkdir, mkdtemp, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, writeFile } from 'node:fs/promises';
import { once } from 'node:events'; import { once } from 'node:events';
@@ -26,19 +26,13 @@ await mkdir(output, { recursive: true });
const fixture = await startFixture({ root: resolve(process.argv[2]), chatMessages: messages }); const fixture = await startFixture({ root: resolve(process.argv[2]), chatMessages: messages });
const profile = await mkdtemp(join(tmpdir(), 'chat-back-latency-')); const profile = await mkdtemp(join(tmpdir(), 'chat-back-latency-'));
const chrome = launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', profile, 'about:blank'); const chrome = launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', profile, 'about:blank');
const log = { pairs, width, folded, roundTrip: process.env.SCROLL_ROUNDTRIP === '1', fromList: process.env.OPEN_FROM_LIST === '1', streaming: process.env.CHAT_STREAM === '1', cpuRate: Number(process.env.CPU_RATE ?? 1), host: process.env.PROBE_PLATFORM ?? 'cupertino', checks: [], captures: [] }; const log = { pairs, width, folded, roundTrip: process.env.SCROLL_ROUNDTRIP === '1', fromList: process.env.OPEN_FROM_LIST === '1', streaming: process.env.CHAT_STREAM === '1', cpuRate: Number(process.env.CPU_RATE ?? 1), checks: [], captures: [] };
let c; let c;
let streamTimer; let streamTimer;
const requests = new Set(); const requests = new Set();
try { try {
c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl); c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
if (log.host === 'android') await c.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Linux; Android 16; BrowserFixture) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Mobile Safari/537.36', platform: 'Linux armv8l',
});
if (log.host === 'material') await c.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36', platform: 'Win32',
});
await c.send('Emulation.setDeviceMetricsOverride', { width, height: 844, deviceScaleFactor: 1, mobile: true }); await c.send('Emulation.setDeviceMetricsOverride', { width, height: 844, deviceScaleFactor: 1, mobile: true });
await c.send('Emulation.setCPUThrottlingRate', { rate: log.cpuRate }); await c.send('Emulation.setCPUThrottlingRate', { rate: log.cpuRate });
const opened = performance.now(); const opened = performance.now();
@@ -8,9 +8,8 @@ import { startFixture } from './runs_probe_server.mjs';
import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs'; import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs';
import { axNodes, enableSemantics, waitFor, capture, click } from './pipelines_probe_cdp_input.mjs'; import { axNodes, enableSemantics, waitFor, capture, click } from './pipelines_probe_cdp_input.mjs';
const platform = process.env.PROBE_PLATFORM ?? 'material';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
const output = resolve(process.argv[3] ?? `build/background-task-modal-${platform}`); const output = resolve(process.argv[3] ?? 'build/background-task-modal-material');
await mkdir(output, { recursive: true }); await mkdir(output, { recursive: true });
const fixture = await startFixture({ root:resolve(process.argv[2]), chatMessages: [], chatShells: [ const fixture = await startFixture({ root:resolve(process.argv[2]), chatMessages: [], chatShells: [
{ id:'a', status:'running', command:'tail -f fixture.log' }, { id:'a', status:'running', command:'tail -f fixture.log' },
@@ -19,7 +18,7 @@ const fixture = await startFixture({ root:resolve(process.argv[2]), chatMessages
], chatShellOutput: Array.from({length:200},(_,i)=>`Recorded output line ${i}`).join('\n') }); ], chatShellOutput: Array.from({length:200},(_,i)=>`Recorded output line ${i}`).join('\n') });
const profile = await mkdtemp(join(tmpdir(),'background-task-modal-')); const profile = await mkdtemp(join(tmpdir(),'background-task-modal-'));
const chrome = launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',profile,'about:blank'); const chrome = launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',profile,'about:blank');
const log = {platform,width,checks:[],captures:[]}; const log = {width,checks:[],captures:[]};
let c; let c;
const names = async () => (await axNodes(c)).flatMap(n=>[n.name?.value??'',n.value?.value??'']); const names = async () => (await axNodes(c)).flatMap(n=>[n.name?.value??'',n.value?.value??'']);
const node = async name => (await axNodes(c)).find(n=>n.name?.value===name&&n.backendDOMNodeId); const node = async name => (await axNodes(c)).find(n=>n.name?.value===name&&n.backendDOMNodeId);
@@ -27,8 +26,8 @@ const emit = body => fetch(fixture.url+'/fixture/chat-event',{method:'POST',body
try { try {
c = await connect((await waitForPage(await waitForPort(join(profile,'DevToolsActivePort')))).webSocketDebuggerUrl); c = await connect((await waitForPage(await waitForPort(join(profile,'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
if(platform==='material') await c.send('Emulation.setUserAgentOverride',{ await c.send('Emulation.setUserAgentOverride',{
userAgent:'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36',platform:'Win32', userAgent:'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36', platform:'Win32',
}); });
await c.send('Emulation.setDeviceMetricsOverride',{width,height:844,deviceScaleFactor:1,mobile:false}); await c.send('Emulation.setDeviceMetricsOverride',{width,height:844,deviceScaleFactor:1,mobile:false});
await c.send('Page.navigate',{url:fixture.url+'/chat/ses_probechat'}); await c.send('Page.navigate',{url:fixture.url+'/chat/ses_probechat'});
+8 -8
View File
@@ -13,17 +13,17 @@ import { tmpdir } from 'node:os';
// flutter build web -t tool/chat_composer_probe_entry.dart \ // flutter build web -t tool/chat_composer_probe_entry.dart \
// --dart-define=CHAT_COMPOSER_PROBE_STYLE=material -o build/composer_probe_material // --dart-define=CHAT_COMPOSER_PROBE_STYLE=material -o build/composer_probe_material
// flutter build web -t tool/chat_composer_probe_entry.dart \ // flutter build web -t tool/chat_composer_probe_entry.dart \
// --dart-define=CHAT_COMPOSER_PROBE_STYLE=cupertino -o build/composer_probe_cupertino // --dart-define=CHAT_COMPOSER_PROBE_STYLE=material -o build/composer_probe_material
// OPENCODE_ARTIFACT_DIR=<dir> PROBE_VARIANT=material \ // OPENCODE_ARTIFACT_DIR=<dir> \
// node tool/chat_composer_probe.mjs build/composer_probe_material
// OPENCODE_ARTIFACT_DIR=<dir> \
// node tool/chat_composer_probe.mjs build/composer_probe_material // node tool/chat_composer_probe.mjs build/composer_probe_material
// OPENCODE_ARTIFACT_DIR=<dir> PROBE_VARIANT=cupertino \
// node tool/chat_composer_probe.mjs build/composer_probe_cupertino
// //
// The fixture is served over loopback only. Flutter paints text on a canvas, so // The fixture is served over loopback only. Flutter paints text on a canvas, so
// assertions read the semantics tree (aria-label/innerText) and the focused // assertions read the semantics tree (aria-label/innerText) and the focused
// editing element; captures are PNGs for visual inspection. // editing element; captures are PNGs for visual inspection.
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const artifactDir = process.env.OPENCODE_ARTIFACT_DIR; const artifactDir = process.env.OPENCODE_ARTIFACT_DIR;
if (!artifactDir) throw new Error('Set OPENCODE_ARTIFACT_DIR for the captures'); if (!artifactDir) throw new Error('Set OPENCODE_ARTIFACT_DIR for the captures');
await mkdir(artifactDir, { recursive: true }); await mkdir(artifactDir, { recursive: true });
@@ -241,7 +241,7 @@ try {
checks.push({ check: 'Enter inserted a newline without sending', value: multiline.value }); checks.push({ check: 'Enter inserted a newline without sending', value: multiline.value });
const usersBefore = (await labels()).filter(label => label === 'User message').length; const usersBefore = (await labels()).filter(label => label === 'User message').length;
await pressEnter(variant === 'cupertino' ? 4 : 2); await pressEnter(variant === 'material' ? 4 : 2);
await waitFor(async () => (await semanticText()).includes('Stop'), 'Stop after send'); await waitFor(async () => (await semanticText()).includes('Stop'), 'Stop after send');
const usersAfter = (await labels()).filter(label => label === 'User message').length; const usersAfter = (await labels()).filter(label => label === 'User message').length;
if (usersAfter <= usersBefore) { if (usersAfter <= usersBefore) {
@@ -259,7 +259,7 @@ try {
await type('Queued follow-up'); await type('Queued follow-up');
const queuedDraft = await editingValue(); const queuedDraft = await editingValue();
if (process.env.PROBE_DEBUG) console.log('queued draft', JSON.stringify(queuedDraft)); if (process.env.PROBE_DEBUG) console.log('queued draft', JSON.stringify(queuedDraft));
await pressEnter(variant === 'cupertino' ? 4 : 2); await pressEnter(variant === 'material' ? 4 : 2);
await delay(900); await delay(900);
const queuedCapture = await capture('composer-queued'); const queuedCapture = await capture('composer-queued');
const queuedRead = await ocr(queuedCapture); const queuedRead = await ocr(queuedCapture);
@@ -276,7 +276,7 @@ try {
await focusField(); await focusField();
await type('refuse me'); await type('refuse me');
await pressEnter(variant === 'cupertino' ? 4 : 2); await pressEnter(variant === 'material' ? 4 : 2);
await waitFor( await waitFor(
async () => (await semanticText()).includes('The fixture refused this prompt.'), async () => (await semanticText()).includes('The fixture refused this prompt.'),
'the refusal line', 'the refusal line',
+1 -1
View File
@@ -11,7 +11,7 @@ import { axNodes, enableSemantics, waitFor, capture } from './pipelines_probe_cd
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
const height = Number(process.env.PROBE_HEIGHT ?? 800); const height = Number(process.env.PROBE_HEIGHT ?? 800);
const platform = process.env.PROBE_PLATFORM ?? 'cupertino'; const platform = 'material';
const dark = process.env.PROBE_DARK === '1'; const dark = process.env.PROBE_DARK === '1';
const messages = Array.from({ length: 6 }, (_, i) => ({ const messages = Array.from({ length: 6 }, (_, i) => ({
id: `m${i}`, id: `m${i}`,
+1 -1
View File
@@ -7,7 +7,7 @@
// node tool/chat_markdown_probe.mjs --root build/probe-chat-markdown-material \ // node tool/chat_markdown_probe.mjs --root build/probe-chat-markdown-material \
// --out DIR --style material // --out DIR --style material
// //
// The Cupertino host is the same build with CHAT_MARKDOWN_PROBE_STYLE=cupertino. // The Material host is the same build with CHAT_MARKDOWN_PROBE_STYLE=material.
// Flutter web paints SelectableText on the canvas, so OCR checks the rendered // Flutter web paints SelectableText on the canvas, so OCR checks the rendered
// prose while the semantics tree checks headings and the dark host. // prose while the semantics tree checks headings and the dark host.
import { createServer } from 'node:http'; import { createServer } from 'node:http';
+1 -1
View File
@@ -8,7 +8,7 @@
// --root build/probe-chat-markdown-wire-material \ // --root build/probe-chat-markdown-wire-material \
// --out DIR --style material // --out DIR --style material
// //
// The Cupertino host is the same fixture built with the cupertino define. // The Material host is the same fixture built with the material define.
// Requires Google Chrome and Tesseract: Flutter web paints text on the canvas, // Requires Google Chrome and Tesseract: Flutter web paints text on the canvas,
// so OCR confirms the rendered answer while the semantics tree confirms the // so OCR confirms the rendered answer while the semantics tree confirms the
// heading and the row structure. // heading and the row structure.
+2 -2
View File
@@ -7,7 +7,7 @@
// node tool/chat_message_probe.mjs --root build/probe-chat-message-material \ // node tool/chat_message_probe.mjs --root build/probe-chat-message-material \
// --out DIR --style material // --out DIR --style material
// //
// The Cupertino host is the same build with CHAT_MESSAGE_PROBE_STYLE=cupertino. // The Material host is the same build with CHAT_MESSAGE_PROBE_STYLE=material.
// Requires Google Chrome and Tesseract: Flutter web paints selectable text on // Requires Google Chrome and Tesseract: Flutter web paints selectable text on
// the canvas, so OCR checks the rendered body and its leading edge while the // the canvas, so OCR checks the rendered body and its leading edge while the
// semantics tree checks the controls and the expanded state. // semantics tree checks the controls and the expanded state.
@@ -334,7 +334,7 @@ try {
for (const text of [ for (const text of [
'Please keep every word of this prompt', 'Please keep every word of this prompt',
'plan.md', 'plan.md',
// `report.csv` covers both hosts; Cupertino's small paperclip glyph makes // `report.csv` covers both hosts; Material's small paperclip glyph makes
// OCR drop the leading `r`, so the suffix is the stable part. // OCR drop the leading `r`, so the suffix is the stable part.
'eport.csv', 'eport.csv',
'checked the transcript and kept the original order.', 'checked the transcript and kept the original order.',
+3 -3
View File
@@ -1,6 +1,6 @@
// Switches an open chat's permission mode in a real browser against a loopback // Switches an open chat's permission mode in a real browser against a loopback
// fixture, never operator data. // fixture, never operator data.
// PROBE_WIDTH=1280 PROBE_HOST=material|cupertino node tool/chat_mode_probe.mjs <web-build> <out> // PROBE_WIDTH=1280 node tool/chat_mode_probe.mjs <web-build> <out>
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { mkdir, mkdtemp, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, writeFile } from 'node:fs/promises';
import { once } from 'node:events'; import { once } from 'node:events';
@@ -11,7 +11,7 @@ import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipeli
import { axNodes, enableSemantics, waitFor, capture } from './pipelines_probe_cdp_input.mjs'; import { axNodes, enableSemantics, waitFor, capture } from './pipelines_probe_cdp_input.mjs';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
const host = process.env.PROBE_HOST ?? 'material'; const host = 'material';
const output = resolve(process.argv[3] ?? 'build/chat-mode-probe'); const output = resolve(process.argv[3] ?? 'build/chat-mode-probe');
await mkdir(output, { recursive: true }); await mkdir(output, { recursive: true });
const messages = [ const messages = [
@@ -39,7 +39,7 @@ const first = async (pattern, what) => {
try { try {
c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl); c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
if (host === 'cupertino') { if (host === 'material') {
await c.send('Emulation.setUserAgentOverride', { await c.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15', platform: 'MacIntel', userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15', platform: 'MacIntel',
}); });
+1 -4
View File
@@ -34,7 +34,7 @@ const fixture = await startFixture({
}); });
const profile = await mkdtemp(join(tmpdir(), 'chat-reopen-')); const profile = await mkdtemp(join(tmpdir(), 'chat-reopen-'));
const chrome = launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', profile, 'about:blank'); const chrome = launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', profile, 'about:blank');
const log = { pairs, width, historyDelayMs, cpuRate: Number(process.env.CPU_RATE ?? 1), host: process.env.PROBE_PLATFORM ?? 'cupertino', visits: [], checks: [], captures: [] }; const log = { pairs, width, historyDelayMs, cpuRate: Number(process.env.CPU_RATE ?? 1), visits: [], checks: [], captures: [] };
let c; let c;
// Transcript text is in the semantics DOM once the view has painted it; the // Transcript text is in the semantics DOM once the view has painted it; the
@@ -56,9 +56,6 @@ async function tapNode(node) {
try { try {
c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl); c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
if (log.host === 'android') await c.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Linux; Android 16; BrowserFixture) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Mobile Safari/537.36', platform: 'Linux armv8l',
});
await c.send('Emulation.setDeviceMetricsOverride', { width, height: 844, deviceScaleFactor: 1, mobile: true }); await c.send('Emulation.setDeviceMetricsOverride', { width, height: 844, deviceScaleFactor: 1, mobile: true });
await c.send('Emulation.setCPUThrottlingRate', { rate: log.cpuRate }); await c.send('Emulation.setCPUThrottlingRate', { rate: log.cpuRate });
await c.send('Page.navigate', { url: fixture.url + '/chat' }); await c.send('Page.navigate', { url: fixture.url + '/chat' });
+1 -1
View File
@@ -8,7 +8,7 @@ import { startFixture } from './runs_probe_server.mjs';
import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs'; import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs';
import { axNodes, enableSemantics, waitFor, capture, click, clickAt } from './pipelines_probe_cdp_input.mjs'; import { axNodes, enableSemantics, waitFor, capture, click, clickAt } from './pipelines_probe_cdp_input.mjs';
const platform = process.env.PROBE_PLATFORM ?? 'material'; const platform = 'material';
const enterSends = process.env.PROBE_ENTER === '1'; const enterSends = process.env.PROBE_ENTER === '1';
const output = resolve(process.argv[3] ?? `build/chat-response-pending-${platform}`); const output = resolve(process.argv[3] ?? `build/chat-response-pending-${platform}`);
await mkdir(output, { recursive: true }); await mkdir(output, { recursive: true });
+4 -4
View File
@@ -12,14 +12,14 @@ import { mkdir, mkdtemp, rm } from 'node:fs/promises';
// Usage (from app/): // Usage (from app/):
// flutter build web -t tool/chat_sessions_probe_entry.dart \ // flutter build web -t tool/chat_sessions_probe_entry.dart \
// --dart-define=CHAT_PROBE_STYLE=material -o build/chat-list-material // --dart-define=CHAT_PROBE_STYLE=material -o build/chat-list-material
// PROBE_WEB_ROOT=$PWD/build/chat-list-material PROBE_VARIANT=material \ // PROBE_WEB_ROOT=$PWD/build/chat-list-material \
// OPENCODE_ARTIFACT_DIR=<dir> node tool/chat_sessions_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/chat_sessions_probe.mjs
// //
// The fixture answers the app's real protocol in-process: accepted create, // The fixture answers the app's real protocol in-process: accepted create,
// rename, star and close calls change the list the next chat_sessions read // rename, star and close calls change the list the next chat_sessions read
// returns, and the title `Refused title` is refused with the server's words. // returns, and the title `Refused title` is refused with the server's words.
const root = resolve(process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/web')); const root = resolve(process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/web'));
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const artifactDir = process.env.OPENCODE_ARTIFACT_DIR ?? join(tmpdir(), 'chat-sessions-capture'); const artifactDir = process.env.OPENCODE_ARTIFACT_DIR ?? join(tmpdir(), 'chat-sessions-capture');
await mkdir(artifactDir, { recursive: true }); await mkdir(artifactDir, { recursive: true });
const mime = { '.html': 'text/html', '.js': 'text/javascript', '.json': 'application/json', '.wasm': 'application/wasm', '.png': 'image/png', '.ico': 'image/x-icon' }; const mime = { '.html': 'text/html', '.js': 'text/javascript', '.json': 'application/json', '.wasm': 'application/wasm', '.png': 'image/png', '.ico': 'image/x-icon' };
@@ -181,7 +181,7 @@ try {
await delay(600); await delay(600);
if (!(await visibleText()).includes('Open fixture')) { if (!(await visibleText()).includes('Open fixture')) {
// Flutter web's semantics DOM swallows the coordinate hit for this // Flutter web's semantics DOM swallows the coordinate hit for this
// Cupertino button; activate the same rendered node through its semantics // Material button; activate the same rendered node through its semantics
// action instead of pretending the Undo happened. // action instead of pretending the Undo happened.
const activated = await evaluate(`(() => { const e = [...document.querySelectorAll('flt-semantics')].find(x => (x.getAttribute('aria-label') || x.innerText || '') === 'Undo'); e?.click(); return !!e; })()`); const activated = await evaluate(`(() => { const e = [...document.querySelectorAll('flt-semantics')].find(x => (x.getAttribute('aria-label') || x.innerText || '') === 'Undo'); e?.click(); return !!e; })()`);
if (!activated) throw new Error('Could not activate Undo'); if (!activated) throw new Error('Could not activate Undo');
@@ -307,7 +307,7 @@ try {
await click('Cancel', 'Cancel after the refusal'); await click('Cancel', 'Cancel after the refusal');
// A refused row action keeps the server's whole reason under its own row on // A refused row action keeps the server's whole reason under its own row on
// both hosts — never one ellipsised line inside a Cupertino subtitle. // both hosts — never one ellipsised line inside a Material subtitle.
await clickFirst('Chat actions for Closed fixture'); await clickFirst('Chat actions for Closed fixture');
await click('Reopen', 'Reopen on the closed fixture'); await click('Reopen', 'Reopen on the closed fixture');
await waitText('the chat is locked by another operator', 'the row refusal'); await waitText('the chat is locked by another operator', 'the row refusal');
+1 -1
View File
@@ -8,7 +8,7 @@ import { startFixture } from './runs_probe_server.mjs';
import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs'; import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs';
import { axNodes, enableSemantics, waitFor, capture, click, clickAt } from './pipelines_probe_cdp_input.mjs'; import { axNodes, enableSemantics, waitFor, capture, click, clickAt } from './pipelines_probe_cdp_input.mjs';
const platform = process.env.PROBE_PLATFORM ?? 'material'; const platform = 'material';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
const output = resolve(process.argv[3] ?? `build/stable-activity-${platform}`); const output = resolve(process.argv[3] ?? `build/stable-activity-${platform}`);
await mkdir(output, { recursive: true }); await mkdir(output, { recursive: true });
+2 -2
View File
@@ -49,7 +49,7 @@ try {
if (process.env.CHECK_STOP_ROTATION === '1') { if (process.env.CHECK_STOP_ROTATION === '1') {
await connection.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-reduced-motion', value: 'no-preference' }] }); await connection.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-reduced-motion', value: 'no-preference' }] });
} }
if (process.env.PROBE_PLATFORM === 'material') { {
await connection.send('Emulation.setUserAgentOverride', { await connection.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36',
platform: 'Win32', platform: 'Win32',
@@ -144,7 +144,7 @@ try {
const [x1, y1, , , x3, y3] = model.content; const [x1, y1, , , x3, y3] = model.content;
await clickAt(connection, (x1 + x3) / 2, (y1 + y3) / 2); await clickAt(connection, (x1 + x3) / 2, (y1 + y3) / 2);
await connection.send('Input.insertText', { text: 'A follow-up while you work' }); await connection.send('Input.insertText', { text: 'A follow-up while you work' });
// The empty Cupertino hint is two lines; typing shrinks the field to one. // The empty Material hint is two lines; typing shrinks the field to one.
// Wait for that layout before taking the Send control's bounds. // Wait for that layout before taking the Send control's bounds.
await sleep(300); await sleep(300);
await click('Send'); await click('Send');
+3 -3
View File
@@ -7,7 +7,7 @@
// node tool/chat_wire_probe.mjs --root build/probe-chat-wire-material \ // node tool/chat_wire_probe.mjs --root build/probe-chat-wire-material \
// --out DIR --style material // --out DIR --style material
// //
// The Cupertino host is the same fixture built with CHAT_WIRE_PROBE_STYLE=cupertino. // The Material host is the same fixture built with CHAT_WIRE_PROBE_STYLE=material.
// Requires Google Chrome and Tesseract: Flutter web paints selectable text on // Requires Google Chrome and Tesseract: Flutter web paints selectable text on
// the canvas, so OCR confirms the actual message body, not just nav labels. // the canvas, so OCR confirms the actual message body, not just nav labels.
import { createServer } from 'node:http'; import { createServer } from 'node:http';
@@ -396,7 +396,7 @@ try {
// Repro A: the same action while the server still reports `has_more`, so the // Repro A: the same action while the server still reports `has_more`, so the
// paging control remains in the indexed list. // paging control remains in the indexed list.
await click(style === 'cupertino' ? 'Back' : 'Back to chats'); await click(style === 'material' ? 'Back' : 'Back to chats');
await waitFor( await waitFor(
async () => hasText('Probe paging session'), async () => hasText('Probe paging session'),
'list after Back', 'list after Back',
@@ -456,7 +456,7 @@ try {
keepsControl: false, keepsControl: false,
}, },
]) { ]) {
await click(style === 'cupertino' ? 'Back' : 'Back to chats'); await click(style === 'material' ? 'Back' : 'Back to chats');
await waitFor( await waitFor(
async () => hasText(fold.title), async () => hasText(fold.title),
`list before ${fold.tag}`, `list before ${fold.tag}`,
+8 -30
View File
@@ -6,7 +6,6 @@
// //
// Server-shaped fixtures only: a fake gateway answers the same get_run envelope // Server-shaped fixtures only: a fake gateway answers the same get_run envelope
// the app consumes. No server or operator run is touched. // the app consumes. No server or operator run is touched.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/runs/data/runs_repository.dart'; import 'package:pipelines_app/features/runs/data/runs_repository.dart';
@@ -84,7 +83,6 @@ JsonMap _run({
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
final stepsUnavailable = params['capture'] == 'unavailable'; final stepsUnavailable = params['capture'] == 'unavailable';
final status = params['run'] == 'failed' final status = params['run'] == 'failed'
? 'failed' ? 'failed'
@@ -107,28 +105,14 @@ void main() {
).copyWith(textScaler: TextScaler.linear(textScale)), ).copyWith(textScaler: TextScaler.linear(textScale)),
child: app!, child: app!,
); );
if (cupertino) { runApp(
runApp( MaterialApp(
CupertinoApp( title: 'Run changes probe',
title: 'Run changes probe', theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
theme: CupertinoThemeData(brightness: theme), builder: scaled,
builder: (context, app) => Theme( home: body,
data: ThemeData(platform: TargetPlatform.iOS), ),
child: scaled(context, app), );
),
home: body,
),
);
} else {
runApp(
MaterialApp(
title: 'Run changes probe',
theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
builder: scaled,
home: body,
),
);
}
} }
class _ProbeBody extends StatefulWidget { class _ProbeBody extends StatefulWidget {
@@ -177,12 +161,6 @@ class _ProbeBodyState extends State<_ProbeBody> {
gateway: _gateway, gateway: _gateway,
onBack: () {}, onBack: () {},
); );
if (Theme.of(context).platform == TargetPlatform.iOS) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Runs')),
child: SafeArea(child: detail),
);
}
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Runs')), appBar: AppBar(title: const Text('Runs')),
body: detail, body: detail,
+31 -39
View File
@@ -7,7 +7,7 @@
// The fixture serves the actual RunDetailView over a fake gateway, then drives // The fixture serves the actual RunDetailView over a fake gateway, then drives
// headless Chrome over loopback: the native Changes button, the recorded file, // headless Chrome over loopback: the native Changes button, the recorded file,
// its diff, Close diff, Back, the failed-run evidence without a run-wide // its diff, Close diff, Back, the failed-run evidence without a run-wide
// summary, the absent action while executing, and the Cupertino raw/dark // summary, the absent action while executing, and the Material raw/dark
// surfaces. No server or operator run is touched. // surfaces. No server or operator run is touched.
import { createServer } from 'node:http'; import { createServer } from 'node:http';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
@@ -322,57 +322,57 @@ try {
evidence.checks.push({ check: 'an executing run offers no snapshot Changes page', value: true }); evidence.checks.push({ check: 'an executing run offers no snapshot Changes page', value: true });
await capture('d1-wire-material-running'); await capture('d1-wire-material-running');
await navigate(`${origin}/?platform=cupertino&theme=light`); await navigate(`${origin}/?theme=light`);
if (!(await hasLabel('Changes'))) { if (!(await hasLabel('Changes'))) {
throw new Error(`Cupertino run detail has no Changes action: ${JSON.stringify(await labels())}`); throw new Error(`Material run detail has no Changes action: ${JSON.stringify(await labels())}`);
} }
await capture('d1-wire-cupertino-detail'); await capture('d1-wire-material-detail');
await clickExact('Changes'); await clickExact('Changes');
const cupertinoChanges = await bodyText(); const materialChanges = await bodyText();
if (!cupertinoChanges.includes(file)) { if (!materialChanges.includes(file)) {
throw new Error(`Cupertino Changes did not open the recorded file: ${JSON.stringify(cupertinoChanges)}`); throw new Error(`Material Changes did not open the recorded file: ${JSON.stringify(materialChanges)}`);
} }
evidence.checks.push({ check: 'Cupertino Changes opened the recorded file', value: true }); evidence.checks.push({ check: 'Material Changes opened the recorded file', value: true });
await capture('d1-wire-cupertino-changes'); await capture('d1-wire-material-changes');
await clickPrefix(rowPrefix); await clickPrefix(rowPrefix);
if (!(await bodyText()).includes('const recorded = true;')) { if (!(await bodyText()).includes('const recorded = true;')) {
throw new Error('Cupertino recorded diff missing'); throw new Error('Material recorded diff missing');
} }
await capture('d1-wire-cupertino-diff'); await capture('d1-wire-material-diff');
await clickExact('Raw patch'); await clickExact('Raw patch');
const rawLabels = await labels(); const rawLabels = await labels();
const rawBody = await bodyText(); const rawBody = await bodyText();
if (!rawLabels.some((label) => label.includes('Raw patch for')) if (!rawLabels.some((label) => label.includes('Raw patch for'))
&& !rawBody.includes('const recorded = true;')) { && !rawBody.includes('const recorded = true;')) {
throw new Error(`Cupertino raw patch did not render: ${JSON.stringify(rawLabels)}`); throw new Error(`Material raw patch did not render: ${JSON.stringify(rawLabels)}`);
} }
if (!(await hasLabel('Copy patch'))) { if (!(await hasLabel('Copy patch'))) {
throw new Error(`Cupertino raw view lost its actions: ${JSON.stringify(await labels())}`); throw new Error(`Material raw view lost its actions: ${JSON.stringify(await labels())}`);
} }
evidence.checks.push({ check: 'Cupertino Raw patch uses a native selectable body', value: true }); evidence.checks.push({ check: 'Material Raw patch uses a native selectable body', value: true });
await capture('d1-wire-cupertino-raw'); await capture('d1-wire-material-raw');
await clickExact('Close diff'); await clickExact('Close diff');
await delay(600); await delay(600);
await clickExact('Back'); await clickExact('Back');
await delay(800); await delay(800);
if (!(await bodyText()).includes('Changes wiring probe')) { if (!(await bodyText()).includes('Changes wiring probe')) {
throw new Error('Cupertino Back did not return to the run detail'); throw new Error('Material Back did not return to the run detail');
} }
evidence.checks.push({ check: 'Cupertino diff and Back returned', value: true }); evidence.checks.push({ check: 'Material diff and Back returned', value: true });
await capture('d1-wire-cupertino-back'); await capture('d1-wire-material-back');
await navigate(`${origin}/?platform=cupertino&theme=dark`); await navigate(`${origin}/?theme=dark`);
await clickExact('Changes'); await clickExact('Changes');
const darkText = [await bodyText(), ...(await labels())].join('\n'); const darkText = [await bodyText(), ...(await labels())].join('\n');
if (!darkText.includes(file) || !darkText.includes('file changed')) { if (!darkText.includes(file) || !darkText.includes('file changed')) {
throw new Error(`Cupertino dark Changes did not render: ${JSON.stringify(darkText)}`); throw new Error(`Material dark Changes did not render: ${JSON.stringify(darkText)}`);
} }
evidence.checks.push({ check: 'Cupertino dark Changes renders the recorded summary', value: true }); evidence.checks.push({ check: 'Material dark Changes renders the recorded summary', value: true });
await capture('d1-wire-cupertino-dark-changes'); await capture('d1-wire-material-dark-changes');
await clickPrefix(rowPrefix); await clickPrefix(rowPrefix);
if (!(await bodyText()).includes('const recorded = true;')) { if (!(await bodyText()).includes('const recorded = true;')) {
throw new Error('Cupertino dark recorded diff missing'); throw new Error('Material dark recorded diff missing');
} }
// The header is a merged semantics label, so anchor the pixel crop on the // The header is a merged semantics label, so anchor the pixel crop on the
// controls below it: the form control and the title share the 16 px inset, // controls below it: the form control and the title share the 16 px inset,
@@ -389,15 +389,15 @@ try {
height: 22, height: 22,
}); });
if (titleLuminance.max < 0.5) { if (titleLuminance.max < 0.5) {
throw new Error(`Dark Cupertino diff header is not light: ${JSON.stringify(titleLuminance)}`); throw new Error(`Dark Material diff header is not light: ${JSON.stringify(titleLuminance)}`);
} }
evidence.checks.push({ evidence.checks.push({
check: 'Cupertino dark diff header text is light on the popup surface', check: 'Material dark diff header text is light on the popup surface',
value: true, value: true,
luminance: titleLuminance.max, luminance: titleLuminance.max,
}); });
evidence.checks.push({ check: 'Cupertino dark diff renders its recorded lines', value: true }); evidence.checks.push({ check: 'Material dark diff renders its recorded lines', value: true });
await capture('d1-wire-cupertino-dark-diff'); await capture('d1-wire-material-dark-diff');
// A 320-px host at 2x text is the narrowest documented state. The native // A 320-px host at 2x text is the narrowest documented state. The native
// controls must keep the whole browser words; the strip scrolls and reveals // controls must keep the whole browser words; the strip scrolls and reveals
@@ -408,14 +408,11 @@ try {
}, session); }, session);
await delay(400); await delay(400);
}; };
const openScaledDiff = async ({ platform, prefix }) => { const openScaledDiff = async ({ prefix }) => {
await send('Emulation.setDeviceMetricsOverride', { await send('Emulation.setDeviceMetricsOverride', {
width: 320, height: 720, deviceScaleFactor: 1, mobile: true, width: 320, height: 720, deviceScaleFactor: 1, mobile: true,
}, session); }, session);
const query = platform === 'cupertino' await navigate(`${origin}/?theme=light&scale=2`);
? '?platform=cupertino&theme=light&scale=2'
: '?theme=light&scale=2';
await navigate(`${origin}/${query}`);
await clickExact('Changes'); await clickExact('Changes');
// The 2x summary pushes the recorded file below the fold: scroll the // The 2x summary pushes the recorded file below the fold: scroll the
// Changes list until its row is built and offered. // Changes list until its row is built and offered.
@@ -440,7 +437,7 @@ try {
// The native menu carries both fixed words on a host too narrow for the // The native menu carries both fixed words on a host too narrow for the
// segmented control; the sheet/list must show each of them whole. A real // segmented control; the sheet/list must show each of them whole. A real
// pointer tap is used because the Cupertino label sits on a semantic // pointer tap is used because the Material label sits on a semantic
// wrapper above the actual button. // wrapper above the actual button.
const menuRect = await rectOfLabel('Diff form'); const menuRect = await rectOfLabel('Diff form');
if (!menuRect) { if (!menuRect) {
@@ -477,16 +474,11 @@ try {
await delay(600); await delay(600);
}; };
await openScaledDiff({ platform: 'material', prefix: 'd1-wire-material-2x-320' }); await openScaledDiff({ prefix: 'd1-wire-material-2x-320' });
evidence.checks.push({ evidence.checks.push({
check: 'Material 2x/320 diff keeps its controls and opens Raw patch', check: 'Material 2x/320 diff keeps its controls and opens Raw patch',
value: true, value: true,
}); });
await openScaledDiff({ platform: 'cupertino', prefix: 'd1-wire-cupertino-2x-320' });
evidence.checks.push({
check: 'Cupertino 2x/320 diff keeps its controls and opens Raw patch',
value: true,
});
console.log(JSON.stringify(evidence, null, 2)); console.log(JSON.stringify(evidence, null, 2));
} finally { } finally {
+4 -27
View File
@@ -6,12 +6,11 @@
// python3 -I -m http.server 0 --bind 127.0.0.1 \ // python3 -I -m http.server 0 --bind 127.0.0.1 \
// --directory build/probe-floating-tabs // --directory build/probe-floating-tabs
// Chrome --headless=new --window-size=W,H --screenshot=OUT \ // Chrome --headless=new --window-size=W,H --screenshot=OUT \
// 'http://127.0.0.1:PORT/?platform=cupertino&theme=dark' // 'http://127.0.0.1:PORT/?theme=dark'
// //
// Query: platform=cupertino (else Material), theme=dark, tab=runs|chat|... // Query: theme=dark, tab=runs|chat|...
// The destinations are long local lists, so the capture shows content passing // The destinations are long local lists, so the capture shows content passing
// behind the bar and the last row clearing it. No server is involved. // behind the bar and the last row clearing it. No server is involved.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/shell/adaptive_shell.dart'; import 'package:pipelines_app/shell/adaptive_shell.dart';
import 'package:pipelines_app/shell/destination.dart'; import 'package:pipelines_app/shell/destination.dart';
@@ -19,25 +18,22 @@ import 'package:pipelines_app/shell/shell_bar.dart';
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
final dark = params['theme'] == 'dark'; final dark = params['theme'] == 'dark';
final tab = AppDestination.values.firstWhere( final tab = AppDestination.values.firstWhere(
(value) => value.name == params['tab'], (value) => value.name == params['tab'],
orElse: () => AppDestination.pipelines, orElse: () => AppDestination.pipelines,
); );
final end = params['end'] == '1'; final end = params['end'] == '1';
runApp(_Probe(cupertino: cupertino, dark: dark, tab: tab, end: end)); runApp(_Probe(dark: dark, tab: tab, end: end));
} }
class _Probe extends StatelessWidget { class _Probe extends StatelessWidget {
const _Probe({ const _Probe({
required this.cupertino,
required this.dark, required this.dark,
required this.tab, required this.tab,
required this.end, required this.end,
}); });
final bool cupertino;
final bool dark; final bool dark;
final AppDestination tab; final AppDestination tab;
@@ -45,12 +41,11 @@ class _Probe extends StatelessWidget {
final bool end; final bool end;
Widget _list(String noun, {required int count}) => Widget _list(String noun, {required int count}) =>
_ProbeList(noun: noun, count: count, cupertino: cupertino, end: end); _ProbeList(noun: noun, count: count, end: end);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final shell = AdaptiveShell( final shell = AdaptiveShell(
cupertino: cupertino,
destination: tab, destination: tab,
attentionCount: 3, attentionCount: 3,
destinationBodies: { destinationBodies: {
@@ -67,15 +62,6 @@ class _Probe extends StatelessWidget {
), ),
}, },
); );
if (cupertino) {
return CupertinoApp(
debugShowCheckedModeBanner: false,
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
home: shell,
);
}
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
theme: ThemeData( theme: ThemeData(
@@ -91,13 +77,11 @@ class _ProbeList extends StatefulWidget {
const _ProbeList({ const _ProbeList({
required this.noun, required this.noun,
required this.count, required this.count,
required this.cupertino,
required this.end, required this.end,
}); });
final String noun; final String noun;
final int count; final int count;
final bool cupertino;
final bool end; final bool end;
@override @override
@@ -137,13 +121,6 @@ class _ProbeListState extends State<_ProbeList> {
final subtitle = index.isEven final subtitle = index.isEven
? 'Succeeded · 2m 05s' ? 'Succeeded · 2m 05s'
: 'Running · started 1m ago'; : 'Running · started 1m ago';
if (widget.cupertino) {
return CupertinoListTile(
leading: const Icon(CupertinoIcons.circle_fill, size: 12),
title: Text(title),
subtitle: Text(subtitle),
);
}
return ListTile( return ListTile(
leading: Icon( leading: Icon(
index.isEven ? Icons.check_circle_outline : Icons.timelapse, index.isEven ? Icons.check_circle_outline : Icons.timelapse,
+2 -2
View File
@@ -5,7 +5,7 @@
// native node/label semantics, selection identity, measured node rectangles and // native node/label semantics, selection identity, measured node rectangles and
// that a real drag pans the stock InteractiveViewer, then writes captures. // that a real drag pans the stock InteractiveViewer, then writes captures.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
// PROBE_WEB_ROOT=<probe build> OPENCODE_ARTIFACT_DIR=<dir> \ // PROBE_WEB_ROOT=<probe build> OPENCODE_ARTIFACT_DIR=<dir> \
// node tool/graph_canvas_probe.mjs // node tool/graph_canvas_probe.mjs
import { createServer } from 'node:http'; import { createServer } from 'node:http';
@@ -17,7 +17,7 @@ import { tmpdir } from 'node:os';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
const root = resolve(process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/graph_canvas_probe')); const root = resolve(process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/graph_canvas_probe'));
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const scale = process.env.PROBE_SCALE ?? '1'; const scale = process.env.PROBE_SCALE ?? '1';
const artifactDir = process.env.OPENCODE_ARTIFACT_DIR ?? join(tmpdir(), 'graph-canvas-capture'); const artifactDir = process.env.OPENCODE_ARTIFACT_DIR ?? join(tmpdir(), 'graph-canvas-capture');
+2 -2
View File
@@ -4,7 +4,7 @@
// an OS-assigned loopback port, drives a real headless Chrome, asserts labels, // an OS-assigned loopback port, drives a real headless Chrome, asserts labels,
// selection identity and the selected ARIA state, and writes captures. // selection identity and the selected ARIA state, and writes captures.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light \ // PROBE_SCHEME=dark|light \
// OPENCODE_ARTIFACT_DIR=<dir> node tool/graph_node_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/graph_node_probe.mjs
import { createServer } from 'node:http'; import { createServer } from 'node:http';
import { spawn } from 'node:child_process'; import { spawn } from 'node:child_process';
@@ -15,7 +15,7 @@ import { tmpdir } from 'node:os';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
const root = resolve(process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/web')); const root = resolve(process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/web'));
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const artifactDir = process.env.OPENCODE_ARTIFACT_DIR ?? join(tmpdir(), 'graph-node-capture'); const artifactDir = process.env.OPENCODE_ARTIFACT_DIR ?? join(tmpdir(), 'graph-node-capture');
const prefix = scheme === 'light' ? 'light-' : ''; const prefix = scheme === 'light' ? 'light-' : '';
+1 -1
View File
@@ -3,7 +3,7 @@
// Build and probe (from app/): // Build and probe (from app/):
// flutter build web -t tool/graph_zoom_probe.dart \ // flutter build web -t tool/graph_zoom_probe.dart \
// --output build/probe-graph-zoom // --output build/probe-graph-zoom
// PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR node tool/graph_zoom_probe.mjs // OPENCODE_ARTIFACT_DIR=DIR node tool/graph_zoom_probe.mjs
// //
// Server-shaped fixtures only; no server, run or operator session is touched. // Server-shaped fixtures only; no server, run or operator session is touched.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
+3 -3
View File
@@ -6,7 +6,7 @@
// wheel zooms, Fit restores the fitted scale, Expand opens the same canvas with // wheel zooms, Fit restores the fitted scale, Expand opens the same canvas with
// the selected node, and Close returns to the previous place and selection. // the selected node, and Close returns to the previous place and selection.
// //
// PROBE_VARIANT=material|cupertino PROBE_VIEW=pipeline|run \ // PROBE_VIEW=pipeline|run \
// PROBE_SCHEME=dark|light PROBE_SCALE=1|2 PROBE_WIDTH=1280 PROBE_HEIGHT=800 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 PROBE_WIDTH=1280 PROBE_HEIGHT=800 \
// PROBE_WEB_ROOT=<probe build> OPENCODE_ARTIFACT_DIR=<dir> \ // PROBE_WEB_ROOT=<probe build> OPENCODE_ARTIFACT_DIR=<dir> \
// node tool/graph_zoom_probe.mjs // node tool/graph_zoom_probe.mjs
@@ -21,7 +21,7 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
const root = resolve( const root = resolve(
process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/probe-graph-zoom'), process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/probe-graph-zoom'),
); );
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const view = process.env.PROBE_VIEW ?? 'pipeline'; const view = process.env.PROBE_VIEW ?? 'pipeline';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const scale = process.env.PROBE_SCALE ?? '1'; const scale = process.env.PROBE_SCALE ?? '1';
@@ -303,7 +303,7 @@ try {
// Fit restores the fitted scale. This activation goes through the control's // Fit restores the fitted scale. This activation goes through the control's
// semantics element, so a labelled button with no tap action fails here (the // semantics element, so a labelled button with no tap action fails here (the
// Cupertino regression). // Material regression).
await semanticsClick('Fit graph to view'); await semanticsClick('Fit graph to view');
const fitted = await rectOf('build'); const fitted = await rectOf('build');
if (!fitted || Math.abs(fitted.width - initial.width) > initial.width * 0.03) { if (!fitted || Math.abs(fitted.width - initial.width) > initial.width * 0.03) {
+1 -1
View File
@@ -9,7 +9,7 @@ import { startWiringFixture } from './pipelines_wiring_probe_server.mjs';
import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs'; import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs';
import { axNodes, enableSemantics, waitFor, capture, clickAt } from './pipelines_probe_cdp_input.mjs'; import { axNodes, enableSemantics, waitFor, capture, clickAt } from './pipelines_probe_cdp_input.mjs';
const platform = process.env.PROBE_PLATFORM ?? 'material'; const platform = 'material';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
const dark = process.env.PROBE_DARK === '1'; const dark = process.env.PROBE_DARK === '1';
const output = resolve(process.argv[3] ?? `build/list-detail-${platform}`); const output = resolve(process.argv[3] ?? `build/list-detail-${platform}`);
-12
View File
@@ -1,7 +1,6 @@
import 'dart:js_interop'; import 'dart:js_interop';
import 'dart:js_interop_unsafe'; import 'dart:js_interop_unsafe';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/features/attention/domain/attention_models.dart'; import 'package:pipelines_app/features/attention/domain/attention_models.dart';
@@ -26,7 +25,6 @@ import 'package:pipelines_app/features/attention/ui/notification_permission_tile
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final mode = params['mode'] ?? 'transition'; final mode = params['mode'] ?? 'transition';
final cupertino = params['host'] == 'cupertino';
final scale = double.tryParse(params['scale'] ?? '') ?? 1; final scale = double.tryParse(params['scale'] ?? '') ?? 1;
final brightness = params['theme'] == 'light' final brightness = params['theme'] == 'light'
? Brightness.light ? Brightness.light
@@ -40,16 +38,6 @@ void main() {
'tile' => _SingleTile(state: _stateOf(params['state'])), 'tile' => _SingleTile(state: _stateOf(params['state'])),
_ => _NotificationProbe(mode: mode), _ => _NotificationProbe(mode: mode),
}; };
if (cupertino) {
runApp(
CupertinoApp(
theme: CupertinoThemeData(brightness: brightness),
builder: scaled,
home: home,
),
);
return;
}
runApp( runApp(
MaterialApp( MaterialApp(
theme: ThemeData( theme: ThemeData(
+5 -4
View File
@@ -154,10 +154,10 @@ try {
} }
}; };
let viewport = { width: 320, height: 640 }; let viewport = { width: 320, height: 640 };
const navigate = async ({ mode, host = 'material', scale = 1, theme = 'dark', width = 320, height = 640, semantics: enableSemantics = false, state } = {}) => { const navigate = async ({ mode, scale = 1, theme = 'dark', width = 320, height = 640, semantics: enableSemantics = false, state } = {}) => {
viewport = { width, height }; viewport = { width, height };
await send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: theme }] }, session); await send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: theme }] }, session);
const query = new URLSearchParams({ mode, host, scale: String(scale), theme }); const query = new URLSearchParams({ mode, scale: String(scale), theme });
if (state) query.set('state', state); if (state) query.set('state', state);
await send('Page.navigate', { url: `${origin}/?${query}` }, session); await send('Page.navigate', { url: `${origin}/?${query}` }, session);
await delay(2500); await delay(2500);
@@ -286,9 +286,10 @@ try {
granted: 'Notifications are on. Failed and waiting runs will raise a browser notification.', granted: 'Notifications are on. Failed and waiting runs will raise a browser notification.',
denied: 'Notifications are blocked for this site.', denied: 'Notifications are blocked for this site.',
}; };
for (const host of ['material', 'cupertino']) { {
const host = 'material';
for (const [state, copy] of Object.entries(states)) { for (const [state, copy] of Object.entries(states)) {
await navigate({ mode: 'tile', host, scale: 2, semantics: true, state }); await navigate({ mode: 'tile', scale: 2, semantics: true, state });
const labels = (await semantics()).map((row) => row.label); const labels = (await semantics()).map((row) => row.label);
requireLabels(labels, [ requireLabels(labels, [
'Pipelines can notify you when a run is waiting', 'Pipelines can notify you when a run is waiting',
+6 -7
View File
@@ -5,7 +5,7 @@
// //
// node tool/perf/glass_scroll_bench.mjs --build build/probe-app \ // node tool/perf/glass_scroll_bench.mjs --build build/probe-app \
// --out /tmp/perf-glass/before [--gpu] [--size 560x900] [--seconds 6] \ // --out /tmp/perf-glass/before [--gpu] [--size 560x900] [--seconds 6] \
// [--repeat 3] [--platform material|cupertino] [--theme light|dark] \ // [--repeat 3] [--theme light|dark] \
// [--shots] [--only runs-list|run-timeline] [--flags="<extra Chrome flags>"] // [--shots] [--only runs-list|run-timeline] [--flags="<extra Chrome flags>"]
// //
// Per scenario (the Runs list: 3 glass pieces; a run's Timeline tab: 5) it // Per scenario (the Runs list: 3 glass pieces; a run's Timeline tab: 5) it
@@ -34,7 +34,7 @@ const { values: opts } = parseArgs({
options: { options: {
build: { type: 'string' }, out: { type: 'string' }, gpu: { type: 'boolean' }, build: { type: 'string' }, out: { type: 'string' }, gpu: { type: 'boolean' },
size: { type: 'string', default: '560x900' }, seconds: { type: 'string', default: '6' }, size: { type: 'string', default: '560x900' }, seconds: { type: 'string', default: '6' },
repeat: { type: 'string', default: '3' }, platform: { type: 'string', default: 'material' }, repeat: { type: 'string', default: '3' },
theme: { type: 'string', default: 'light' }, only: { type: 'string' }, theme: { type: 'string', default: 'light' }, only: { type: 'string' },
flags: { type: 'string', default: '' }, shots: { type: 'boolean' }, flags: { type: 'string', default: '' }, shots: { type: 'boolean' },
}, },
@@ -127,7 +127,7 @@ const chrome = await launchChrome();
const browser = await openBrowser({ cdp: chrome.cdp }); const browser = await openBrowser({ cdp: chrome.cdp });
const { send } = browser; const { send } = browser;
const evaluate = async (expression) => (await send('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true })).result.value; const evaluate = async (expression) => (await send('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true })).result.value;
const results = { build: opts.build, gpu: Boolean(opts.gpu), size: opts.size, platform: opts.platform, theme: opts.theme, scenarios: {} }; const results = { build: opts.build, gpu: Boolean(opts.gpu), size: opts.size, theme: opts.theme, scenarios: {} };
try { try {
await send('Page.enable'); await send('Page.enable');
await send('Runtime.enable'); await send('Runtime.enable');
@@ -143,7 +143,6 @@ try {
for (let rep = 0; rep < Number(opts.repeat); rep++) { for (let rep = 0; rep < Number(opts.repeat); rep++) {
const url = new URL('/', server.origin); const url = new URL('/', server.origin);
url.searchParams.set('route', s.route); url.searchParams.set('route', s.route);
url.searchParams.set('platform', opts.platform);
url.searchParams.set('theme', opts.theme); url.searchParams.set('theme', opts.theme);
for (const [k, v] of Object.entries(s.extra)) url.searchParams.set(k, v); for (const [k, v] of Object.entries(s.extra)) url.searchParams.set(k, v);
await send('Page.navigate', { url: url.href }); await send('Page.navigate', { url: url.href });
@@ -167,19 +166,19 @@ try {
await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 1, y: height / 2 }); await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 1, y: height / 2 });
await delay(1500); await delay(1500);
const still = (await send('Page.captureScreenshot', { format: 'png' })).data; const still = (await send('Page.captureScreenshot', { format: 'png' })).data;
await writeFile(join(opts.out, `${s.name}-${opts.platform}-${opts.theme}-still.png`), Buffer.from(still, 'base64')); await writeFile(join(opts.out, `${s.name}-${opts.theme}-still.png`), Buffer.from(still, 'base64'));
break; break;
} }
const frames = await evaluate(`window.__bench.drive(${Number(opts.seconds) * 1000}, ${x}, ${y}, 6)`); const frames = await evaluate(`window.__bench.drive(${Number(opts.seconds) * 1000}, ${x}, ${y}, 6)`);
runs.push({ ...summarise(frames), census }); runs.push({ ...summarise(frames), census });
await delay(500); await delay(500);
const shot = rep === 0 ? (await send('Page.captureScreenshot', { format: 'png' })).data : null; const shot = rep === 0 ? (await send('Page.captureScreenshot', { format: 'png' })).data : null;
if (shot) await writeFile(join(opts.out, `${s.name}-${opts.platform}-${opts.theme}.png`), Buffer.from(shot, 'base64')); if (shot) await writeFile(join(opts.out, `${s.name}-${opts.theme}.png`), Buffer.from(shot, 'base64'));
} }
results.scenarios[s.name] = runs; results.scenarios[s.name] = runs;
console.log(s.name, JSON.stringify(runs)); console.log(s.name, JSON.stringify(runs));
} }
if (!opts.shots) await writeFile(join(opts.out, `bench-${opts.gpu ? 'gpu' : 'sw'}-${opts.platform}-${opts.theme}.json`), JSON.stringify(results, null, 2)); if (!opts.shots) await writeFile(join(opts.out, `bench-${opts.gpu ? 'gpu' : 'sw'}-${opts.theme}.json`), JSON.stringify(results, null, 2));
} finally { } finally {
await browser.close().catch(() => {}); await browser.close().catch(() => {});
await chrome.close(); await chrome.close();
+2 -2
View File
@@ -7,7 +7,7 @@
// Captures are written for both hosts, dark at 2x; the file prefix carries the // Captures are written for both hosts, dark at 2x; the file prefix carries the
// viewport so short-window and large-text runs cannot overwrite each other. // viewport so short-window and large-text runs cannot overwrite each other.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
// PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \ // PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \
// OPENCODE_ARTIFACT_DIR=<dir> node tool/pipeline_graph_tab_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/pipeline_graph_tab_probe.mjs
import { createServer } from 'node:http'; import { createServer } from 'node:http';
@@ -22,7 +22,7 @@ const root = resolve(
process.env.PROBE_WEB_ROOT ?? process.env.PROBE_WEB_ROOT ??
join(process.cwd(), 'build/pipeline_graph_tab_probe_web'), join(process.cwd(), 'build/pipeline_graph_tab_probe_web'),
); );
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const scale = process.env.PROBE_SCALE ?? '2'; const scale = process.env.PROBE_SCALE ?? '2';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
+10 -10
View File
@@ -187,7 +187,7 @@ try {
await noBody('Pipelines server unavailable'); await noBody('Pipelines server unavailable');
await capture(connection, captureDir, log, '06-reconnect-detail-refreshed-material'); await capture(connection, captureDir, log, '06-reconnect-detail-refreshed-material');
// Cupertino host: macOS platform, dark appearance. // Material host: macOS platform, dark appearance.
await connection.send('Emulation.setUserAgentOverride', { await connection.send('Emulation.setUserAgentOverride', {
userAgent: userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 ' + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 ' +
@@ -198,20 +198,20 @@ try {
features: [{ name: 'prefers-color-scheme', value: 'dark' }], features: [{ name: 'prefers-color-scheme', value: 'dark' }],
}); });
await navigate(`${fixture.url}/pipelines`); await navigate(`${fixture.url}/pipelines`);
await assertName(connection, 'Release verification', 'cupertino dark row', log); await assertName(connection, 'Release verification', 'material dark row', log);
await noBody('Pipelines — Not implemented'); await noBody('Pipelines — Not implemented');
await capture(connection, captureDir, log, '07-list-cupertino-dark'); await capture(connection, captureDir, log, '07-list-material-dark');
await assertOcr('07-list-cupertino-dark', 'Release verification'); await assertOcr('07-list-material-dark', 'Release verification');
await click(connection, 'Release verification'); await click(connection, 'Release verification');
await assertName(connection, 'Content hash', 'cupertino dark detail', log); await assertName(connection, 'Content hash', 'material dark detail', log);
await capture(connection, captureDir, log, '08-detail-cupertino-dark'); await capture(connection, captureDir, log, '08-detail-material-dark');
await assertOcr('08-detail-cupertino-dark', 'Content hash'); await assertOcr('08-detail-material-dark', 'Content hash');
await click(connection, 'Source'); await click(connection, 'Source');
await capture(connection, captureDir, log, '09-source-cupertino-dark'); await capture(connection, captureDir, log, '09-source-material-dark');
await assertOcr('09-source-cupertino-dark', 'name: Release verification'); await assertOcr('09-source-material-dark', 'name: Release verification');
await assertOcr('09-source-cupertino-dark', 'type: model'); await assertOcr('09-source-material-dark', 'type: model');
const final = await state(); const final = await state();
if (final.connections < 1) throw new Error('No shared socket'); if (final.connections < 1) throw new Error('No shared socket');
+15 -15
View File
@@ -638,19 +638,19 @@ try {
await assertBody('Original prompt'); await assertBody('Original prompt');
}; };
// Cupertino host (macOS browser), 320 CSS px at DPR 2 in dark mode. // Material host (macOS browser), 320 CSS px at DPR 2 in dark mode.
await open(SOURCE_ID, 'Fixture failed run'); await open(SOURCE_ID, 'Fixture failed run');
await assertBody('Rename'); await assertBody('Rename');
await assertBody('Retry'); await assertBody('Retry');
captures.push(await capture(`r2c-retry-cupertino-${theme}-failed`)); captures.push(await capture(`r2c-retry-material-${theme}-failed`));
await assertOcr(captures.at(-1), 'Fixture failed run'); await assertOcr(captures.at(-1), 'Fixture failed run');
checks.push(await actionGap('Cupertino')); checks.push(await actionGap('Material'));
checks.push({ check: `Cupertino ${theme} 320px detail offers Retry`, path: await evaluate('location.pathname') }); checks.push({ check: `Material ${theme} 320px detail offers Retry`, path: await evaluate('location.pathname') });
await clickText('Retry'); await clickText('Retry');
await waitFor(retryPromptOpen, 'the retry prompt'); await waitFor(retryPromptOpen, 'the retry prompt');
await assertBody('Only failed runs can be retried'); await assertBody('Only failed runs can be retried');
captures.push(await capture(`r2c-retry-cupertino-${theme}-prompt`)); captures.push(await capture(`r2c-retry-material-${theme}-prompt`));
await assertOcr(captures.at(-1), 'Retry run 7?'); await assertOcr(captures.at(-1), 'Retry run 7?');
await clickText('Keep'); await clickText('Keep');
@@ -658,8 +658,8 @@ try {
if ((await state()).retries.length !== 0) { if ((await state()).retries.length !== 0) {
throw new Error('Keep sent retry_run'); throw new Error('Keep sent retry_run');
} }
checks.push({ check: 'Cupertino Keep sent nothing', sent: 0 }); checks.push({ check: 'Material Keep sent nothing', sent: 0 });
captures.push(await capture(`r2c-retry-cupertino-${theme}-kept`)); captures.push(await capture(`r2c-retry-material-${theme}-kept`));
// Restart: the browser-only second confirmation, then the server-named run. // Restart: the browser-only second confirmation, then the server-named run.
await clickText('Retry'); await clickText('Retry');
@@ -667,7 +667,7 @@ try {
await clickText('Restart from start'); await clickText('Restart from start');
await waitFor(restartPromptOpen, 'the restart prompt'); await waitFor(restartPromptOpen, 'the restart prompt');
await assertBody('replays the whole pipeline'); await assertBody('replays the whole pipeline');
captures.push(await capture(`r2c-retry-cupertino-${theme}-restart-prompt`)); captures.push(await capture(`r2c-retry-material-${theme}-restart-prompt`));
await clickText('Restart from start', { last: true }); await clickText('Restart from start', { last: true });
try { try {
await waitFor(async () => (await state()).retries.length === 1, 'the first retry request'); await waitFor(async () => (await state()).retries.length === 1, 'the first retry request');
@@ -679,17 +679,17 @@ try {
} }
const restart = assertPayload((await state()).retries[0], { const restart = assertPayload((await state()).retries[0], {
restart: true, restart: true,
check: 'Cupertino restart', check: 'Material restart',
}); });
await waitNewRun(SOURCE_ID + 1, 'Restart of 7'); await waitNewRun(SOURCE_ID + 1, 'Restart of 7');
captures.push(await capture(`r2c-retry-cupertino-${theme}-restart-run`)); captures.push(await capture(`r2c-retry-material-${theme}-restart-run`));
await assertOcr(captures.at(-1), 'Restart of 7'); await assertOcr(captures.at(-1), 'Restart of 7');
checks.push({ check: 'Cupertino restart opened only the server-named run', restart, path: await evaluate('location.pathname') }); checks.push({ check: 'Material restart opened only the server-named run', restart, path: await evaluate('location.pathname') });
await clickText('Back'); await clickText('Back');
await assertBody('Fixture failed run'); await assertBody('Fixture failed run');
await assertBody('Restart of 7'); await assertBody('Restart of 7');
captures.push(await capture(`r2c-retry-cupertino-${theme}-list`)); captures.push(await capture(`r2c-retry-material-${theme}-list`));
await assertOcr(captures.at(-1), 'Restart of 7'); await assertOcr(captures.at(-1), 'Restart of 7');
// Resume after returning to the still-failed source run. // Resume after returning to the still-failed source run.
@@ -705,12 +705,12 @@ try {
await waitFor(async () => (await state()).retries.length === 2, 'the resume request'); await waitFor(async () => (await state()).retries.length === 2, 'the resume request');
const resume = assertPayload((await state()).retries[1], { const resume = assertPayload((await state()).retries[1], {
restart: false, restart: false,
check: 'Cupertino resume', check: 'Material resume',
}); });
await waitNewRun(SOURCE_ID + 2, 'Resume of 7'); await waitNewRun(SOURCE_ID + 2, 'Resume of 7');
captures.push(await capture(`r2c-retry-cupertino-${theme}-resume-run`)); captures.push(await capture(`r2c-retry-material-${theme}-resume-run`));
await assertOcr(captures.at(-1), 'Resume of 7'); await assertOcr(captures.at(-1), 'Resume of 7');
checks.push({ check: 'Cupertino resume omitted retry_mode and opened the reply run', resume, path: await evaluate('location.pathname') }); checks.push({ check: 'Material resume omitted retry_mode and opened the reply run', resume, path: await evaluate('location.pathname') });
// Material host: the same deep link, shared gateway and normal app build. // Material host: the same deep link, shared gateway and normal app build.
await send( await send(
+1 -1
View File
@@ -3,7 +3,7 @@
// Build and probe (from app/): // Build and probe (from app/):
// flutter build web --target tool/run_detail_graph_probe.dart \ // flutter build web --target tool/run_detail_graph_probe.dart \
// --output build/probe-run-detail-graph // --output build/probe-run-detail-graph
// PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR \ // OPENCODE_ARTIFACT_DIR=DIR \
// node tool/run_detail_graph_probe.mjs // node tool/run_detail_graph_probe.mjs
// //
// Server-shaped fixtures only: a fake gateway answers the same get_run envelope // Server-shaped fixtures only: a fake gateway answers the same get_run envelope
+5 -5
View File
@@ -5,9 +5,9 @@
// server-shaped fixture. It checks the Graph tab's recorded evidence and legend, // server-shaped fixture. It checks the Graph tab's recorded evidence and legend,
// that an unvisited node does nothing, that a visited stage click selects the // that an unvisited node does nothing, that a visited stage click selects the
// recorded visit in Timeline, and the exact missing-graph wording. Captures are // recorded visit in Timeline, and the exact missing-graph wording. Captures are
// written for both hosts. // written for the Material host.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
// PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \ // PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \
// OPENCODE_ARTIFACT_DIR=<dir> node tool/run_detail_graph_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/run_detail_graph_probe.mjs
import { createServer } from 'node:http'; import { createServer } from 'node:http';
@@ -22,7 +22,7 @@ const root = resolve(
process.env.PROBE_WEB_ROOT ?? process.env.PROBE_WEB_ROOT ??
join(process.cwd(), 'build/probe-run-detail-graph'), join(process.cwd(), 'build/probe-run-detail-graph'),
); );
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const scale = process.env.PROBE_SCALE ?? '1'; const scale = process.env.PROBE_SCALE ?? '1';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
@@ -196,7 +196,7 @@ try {
}; };
await navigate( await navigate(
`?platform=${variant}&theme=${scheme === 'dark' ? 1 : 0}&scale=${scale}&case=default`, `?theme=${scheme === 'dark' ? 1 : 0}&scale=${scale}&case=default`,
'Release verification', 'Release verification',
); );
check('the real run detail opened over the recorded fixture', true); check('the real run detail opened over the recorded fixture', true);
@@ -269,7 +269,7 @@ try {
evidence.captures.push(await capture('selected-visit')); evidence.captures.push(await capture('selected-visit'));
await navigate( await navigate(
`?platform=${variant}&theme=${scheme === 'dark' ? 1 : 0}&scale=${scale}&case=missing`, `?theme=${scheme === 'dark' ? 1 : 0}&scale=${scale}&case=missing`,
'Release verification', 'Release verification',
); );
await clickLabel('Graph'); await clickLabel('Graph');
+2 -14
View File
@@ -3,12 +3,11 @@
// Build and probe (from app/): // Build and probe (from app/):
// flutter build web --target tool/run_detail_visit_probe.dart \ // flutter build web --target tool/run_detail_visit_probe.dart \
// --output build/probe-run-detail-visit // --output build/probe-run-detail-visit
// PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR \ // OPENCODE_ARTIFACT_DIR=DIR \
// node tool/run_detail_visit_probe.mjs // node tool/run_detail_visit_probe.mjs
// //
// Server-shaped fixtures only: a fake gateway answers the same get_run envelope // Server-shaped fixtures only: a fake gateway answers the same get_run envelope
// the app consumes. No server or operator run is touched. // the app consumes. No server or operator run is touched.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/runs/data/runs_repository.dart'; import 'package:pipelines_app/features/runs/data/runs_repository.dart';
@@ -176,23 +175,20 @@ JsonMap _run() => <String, dynamic>{
void main() { void main() {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
final dark = params['theme'] == 'dark'; final dark = params['theme'] == 'dark';
final scale = double.tryParse(params['scale'] ?? '') ?? 1; final scale = double.tryParse(params['scale'] ?? '') ?? 1;
runApp( runApp(
_ProbeBody(cupertino: cupertino, dark: dark, scale: scale, run: _run()), _ProbeBody(dark: dark, scale: scale, run: _run()),
); );
} }
class _ProbeBody extends StatefulWidget { class _ProbeBody extends StatefulWidget {
const _ProbeBody({ const _ProbeBody({
required this.cupertino,
required this.dark, required this.dark,
required this.scale, required this.scale,
required this.run, required this.run,
}); });
final bool cupertino;
final bool dark; final bool dark;
final double scale; final double scale;
final JsonMap run; final JsonMap run;
@@ -233,14 +229,6 @@ class _ProbeBodyState extends State<_ProbeBody> {
).copyWith(textScaler: TextScaler.linear(widget.scale)), ).copyWith(textScaler: TextScaler.linear(widget.scale)),
child: app!, child: app!,
); );
if (widget.cupertino) {
return CupertinoApp(
title: 'Visit pane fixture',
theme: CupertinoThemeData(brightness: theme),
builder: scaled,
home: CupertinoPageScaffold(child: SafeArea(child: detail)),
);
}
return MaterialApp( return MaterialApp(
title: 'Visit pane fixture', title: 'Visit pane fixture',
theme: ThemeData(brightness: theme, platform: TargetPlatform.android), theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
+3 -3
View File
@@ -14,7 +14,7 @@
// reason. It also samples the rendered page so PROBE_SCHEME=dark cannot pass // reason. It also samples the rendered page so PROBE_SCHEME=dark cannot pass
// while the fixture silently renders light. // while the fixture silently renders light.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
// PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \ // PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \
// OPENCODE_ARTIFACT_DIR=<dir> node tool/run_detail_visit_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/run_detail_visit_probe.mjs
import { createServer } from 'node:http'; import { createServer } from 'node:http';
@@ -29,7 +29,7 @@ const root = resolve(
process.env.PROBE_WEB_ROOT ?? process.env.PROBE_WEB_ROOT ??
join(process.cwd(), 'build/probe-run-detail-visit'), join(process.cwd(), 'build/probe-run-detail-visit'),
); );
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const scale = process.env.PROBE_SCALE ?? '1'; const scale = process.env.PROBE_SCALE ?? '1';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
@@ -238,7 +238,7 @@ try {
const check = (text, value) => evidence.checks.push({ check: text, value }); const check = (text, value) => evidence.checks.push({ check: text, value });
const navigation = await send('Page.navigate', { const navigation = await send('Page.navigate', {
url: `http://127.0.0.1:${port}/?platform=${variant}&theme=${scheme}&scale=${scale}`, url: `http://127.0.0.1:${port}/?theme=${scheme}&scale=${scale}`,
}, session); }, session);
if (navigation.error || navigation.result?.errorText) throw new Error(JSON.stringify(navigation)); if (navigation.error || navigation.result?.errorText) throw new Error(JSON.stringify(navigation));
await delay(3200); await delay(3200);
+2 -2
View File
@@ -6,7 +6,7 @@
// line, a visited-stage click, an unvisited node doing nothing, and (for the // line, a visited-stage click, an unvisited node doing nothing, and (for the
// finished fixture) no live line plus the resolved terminal's recorded outcome. // finished fixture) no live line plus the resolved terminal's recorded outcome.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
// PROBE_CASE=running|finished PROBE_WIDTH=1280 PROBE_HEIGHT=800 \ // PROBE_CASE=running|finished PROBE_WIDTH=1280 PROBE_HEIGHT=800 \
// PROBE_WEB_ROOT=<probe build> OPENCODE_ARTIFACT_DIR=<dir> \ // PROBE_WEB_ROOT=<probe build> OPENCODE_ARTIFACT_DIR=<dir> \
// node tool/run_graph_probe.mjs // node tool/run_graph_probe.mjs
@@ -21,7 +21,7 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
const root = resolve( const root = resolve(
process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/run_graph_probe'), process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/run_graph_probe'),
); );
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'light'; const scheme = process.env.PROBE_SCHEME ?? 'light';
const scale = process.env.PROBE_SCALE ?? '1'; const scale = process.env.PROBE_SCALE ?? '1';
const fixture = process.env.PROBE_CASE ?? 'running'; const fixture = process.env.PROBE_CASE ?? 'running';
+11 -57
View File
@@ -644,9 +644,9 @@ try {
await setView({ width: 420, height: 900 }); await setView({ width: 420, height: 900 });
await openPipelines(); await openPipelines();
captures.push(await capture('p3-run-cupertino-list')); captures.push(await capture('p3-run-material-list'));
await openPipelineDetail(); await openPipelineDetail();
captures.push(await capture('p3-run-cupertino-detail')); captures.push(await capture('p3-run-material-detail'));
// Opening and Cancel send nothing. // Opening and Cancel send nothing.
await clickText('Run'); await clickText('Run');
@@ -655,18 +655,18 @@ try {
await assertBody('Working directory (on the server)'); await assertBody('Working directory (on the server)');
await assertBody('Notifications for this run'); await assertBody('Notifications for this run');
await assertBody('Cancel'); await assertBody('Cancel');
captures.push(await capture('p3-run-cupertino-dialog')); captures.push(await capture('p3-run-material-dialog'));
await clickText('Cancel'); await clickText('Cancel');
await waitFor(dialogClosed, 'the cancelled dialog'); await waitFor(dialogClosed, 'the cancelled dialog');
if ((await state()).launches.length !== 0) throw new Error('Cancel sent run_pipeline'); if ((await state()).launches.length !== 0) throw new Error('Cancel sent run_pipeline');
checks.push({ check: 'Cupertino Cancel sent nothing', sent: 0 }); checks.push({ check: 'Material Cancel sent nothing', sent: 0 });
// Both local validations, exactly as the web. // Both local validations, exactly as the web.
await clickText('Run'); await clickText('Run');
await waitFor(dialogOpen, 'the launch dialog again'); await waitFor(dialogOpen, 'the launch dialog again');
await clickText('Run', { last: true }); await clickText('Run', { last: true });
await assertBody('Enter a prompt for this run.'); await assertBody('Enter a prompt for this run.');
captures.push(await capture('p3-run-cupertino-prompt-validation')); captures.push(await capture('p3-run-material-prompt-validation'));
if ((await state()).launches.length !== 0) throw new Error('Validation sent run_pipeline'); if ((await state()).launches.length !== 0) throw new Error('Validation sent run_pipeline');
await focusField('What should this run do?'); await focusField('What should this run do?');
@@ -674,78 +674,32 @@ try {
await clearAndType('/absolute/path/on/the/server', 'relative/path'); await clearAndType('/absolute/path/on/the/server', 'relative/path');
await clickText('Run', { last: true }); await clickText('Run', { last: true });
await assertBody('Choose an absolute working directory on the server.'); await assertBody('Choose an absolute working directory on the server.');
captures.push(await capture('p3-run-cupertino-workspace-validation')); captures.push(await capture('p3-run-material-workspace-validation'));
if ((await state()).launches.length !== 0) throw new Error('Workspace validation sent run_pipeline'); if ((await state()).launches.length !== 0) throw new Error('Workspace validation sent run_pipeline');
await clearAndType('/absolute/path/on/the/server', '/work/release'); await clearAndType('/absolute/path/on/the/server', '/work/release');
const beforeRunsList = (await state()).listRuns; const beforeRunsList = (await state()).listRuns;
await clickText('Run', { last: true }); await clickText('Run', { last: true });
await waitFor(async () => (await state()).launches.length === 1, 'the Cupertino launch request'); await waitFor(async () => (await state()).launches.length === 1, 'the Material launch request');
const cupertinoLaunch = assertPayload((await state()).launches[0], 'Cupertino launch'); const materialLaunch = assertPayload((await state()).launches[0], 'Material launch');
await waitRun(100); await waitRun(100);
const afterRunsList = (await state()).listRuns; const afterRunsList = (await state()).listRuns;
if (afterRunsList <= beforeRunsList) { if (afterRunsList <= beforeRunsList) {
throw new Error('The accepted launch did not trigger a fresh runs list read'); throw new Error('The accepted launch did not trigger a fresh runs list read');
} }
captures.push(await capture('p3-run-cupertino-run-detail'));
checks.push({
check: 'Cupertino dialog → validation → accepted run detail',
launch: cupertinoLaunch,
listReads: afterRunsList - beforeRunsList,
path: await evaluate('location.pathname'),
});
// Material host: the same normal bundle after a Linux browser identity.
await send(
'Emulation.setUserAgentOverride',
{
userAgent:
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 ' +
'(KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
platform: 'Linux x86_64',
},
session,
);
await openPipelines();
await openPipelineDetail();
captures.push(await capture('p3-run-material-detail'));
await clickText('Run');
await waitFor(dialogOpen, 'the material launch dialog');
await assertBody('Prompt');
captures.push(await capture('p3-run-material-dialog'));
await clickText('Run', { last: true });
await assertBody('Enter a prompt for this run.');
captures.push(await capture('p3-run-material-validation'));
if ((await state()).launches.length !== 1) throw new Error('Material validation sent run_pipeline');
await focusField('What should this run do?');
await typeText('Review the release.');
await clearAndType('/absolute/path/on/the/server', 'relative/path');
await clickText('Run', { last: true });
await assertBody('Choose an absolute working directory on the server.');
await clearAndType('/absolute/path/on/the/server', '/work/release');
const beforeMaterialList = (await state()).listRuns;
await clickText('Run', { last: true });
await waitFor(async () => (await state()).launches.length === 2, 'the Material launch request');
const materialLaunch = assertPayload((await state()).launches[1], 'Material launch');
await waitRun(101);
const afterMaterialList = (await state()).listRuns;
if (afterMaterialList <= beforeMaterialList) {
throw new Error('The Material acceptance did not trigger a fresh runs list read');
}
captures.push(await capture('p3-run-material-run-detail')); captures.push(await capture('p3-run-material-run-detail'));
checks.push({ checks.push({
check: 'Material dialog → validation → accepted run detail', check: 'Material dialog → validation → accepted run detail',
launch: materialLaunch, launch: materialLaunch,
listReads: afterMaterialList - beforeMaterialList, listReads: afterRunsList - beforeRunsList,
path: await evaluate('location.pathname'), path: await evaluate('location.pathname'),
}); });
const finalState = await state(); const finalState = await state();
if (finalState.launches.length !== 2) { if (finalState.launches.length !== 1) {
throw new Error(`Expected two launches, saw ${JSON.stringify(finalState.launches)}`); throw new Error(`Expected two launches, saw ${JSON.stringify(finalState.launches)}`);
} }
if (finalState.runs.length !== 2) { if (finalState.runs.length !== 1) {
throw new Error(`Expected two server-created runs, saw ${JSON.stringify(finalState.runs)}`); throw new Error(`Expected two server-created runs, saw ${JSON.stringify(finalState.runs)}`);
} }
console.log(JSON.stringify({ ok: true, fixture: fixtureUrl, checks, captures }, null, 2)); console.log(JSON.stringify({ ok: true, fixture: fixtureUrl, checks, captures }, null, 2));
+5 -5
View File
@@ -404,29 +404,29 @@ try {
await assertBody('Server URL'); await assertBody('Server URL');
await assertBody('Fixture settings build'); await assertBody('Fixture settings build');
if ((await path()) !== '/settings') throw new Error('Settings did not update route'); if ((await path()) !== '/settings') throw new Error('Settings did not update route');
captures.push(await capture('settings-cupertino-registered-phone')); captures.push(await capture('settings-material-registered-phone'));
await clickText('Runs'); await clickText('Runs');
await clickText('Fixture cancel run', { contains: true }); await clickText('Fixture cancel run', { contains: true });
await assertBody('Original prompt'); await assertBody('Original prompt');
await clickText('Cancel run'); await clickText('Cancel run');
await assertBody('Cancel run 4?'); await assertBody('Cancel run 4?');
captures.push(await capture('cancel-cupertino-confirm')); captures.push(await capture('cancel-material-confirm'));
await clickText('Keep'); await clickText('Keep');
await assertBody('Original prompt'); await assertBody('Original prompt');
const kept = await (await fetch(`${fixture.url}/fixture/state`)).json(); const kept = await (await fetch(`${fixture.url}/fixture/state`)).json();
if (kept.cancelRequests.length) throw new Error('Keep sent a cancellation'); if (kept.cancelRequests.length) throw new Error('Keep sent a cancellation');
await clickText('Back', { contains: true }); await clickText('Back', { contains: true });
await clickText('Fixture human run', { contains: true }); await clickText('Fixture human run', { contains: true });
captures.push(await capture('decision-cupertino-card')); captures.push(await capture('decision-material-card'));
await assertBody('Waiting for your decision'); await assertBody('Waiting for your decision');
await clickText('Decide'); await clickText('Decide');
await assertBody('Please review this recorded checkpoint.'); await assertBody('Please review this recorded checkpoint.');
captures.push(await capture('decision-cupertino-confirm')); captures.push(await capture('decision-material-confirm'));
await clickText('Cancel'); await clickText('Cancel');
// Material host: the same deep link and route must render standard Material // Material host: the same deep link and route must render standard Material
// controls (the Cupertino host was selected by the macOS browser above). // controls (the Material host was selected by the macOS browser above).
await send( await send(
'Emulation.setUserAgentOverride', 'Emulation.setUserAgentOverride',
{ {
+7 -7
View File
@@ -239,7 +239,7 @@ try {
const captures = []; const captures = [];
// Material phone: invalid -> valid -> refusal -> exact record. // Material phone: invalid -> valid -> refusal -> exact record.
await load('host=material&scale=1', 390, 844); await load('scale=1', 390, 844);
await assertText('Future runs only; does not publish or change the workflow.'); await assertText('Future runs only; does not publish or change the workflow.');
await assertText('Weekdays (none means every day)'); await assertText('Weekdays (none means every day)');
await assertText('Enabled schedules start future runs automatically'); await assertText('Enabled schedules start future runs automatically');
@@ -330,7 +330,7 @@ try {
}); });
// Narrow phone at 2x text: labels and helpers wrap, nothing overflows. // Narrow phone at 2x text: labels and helpers wrap, nothing overflows.
await load('host=material&scale=2', 320, 844); await load('scale=2', 320, 844);
await click('Save schedule'); await click('Save schedule');
await delay(600); await delay(600);
await capture('s1-form-material-320-2x-top'); await capture('s1-form-material-320-2x-top');
@@ -340,14 +340,14 @@ try {
await assertText('Save schedule'); await assertText('Save schedule');
checks.push({ check: '320px at 2x text kept every label and the actions', width: 320, scale: 2 }); checks.push({ check: '320px at 2x text kept every label and the actions', width: 320, scale: 2 });
// Actual Cupertino dark host, not a Material fallback. // Actual Material dark host, not a Material fallback.
await load('host=cupertino&brightness=dark&scale=1', 390, 844); await load('brightness=dark&scale=1', 390, 844);
await assertText('Add schedule'); await assertText('Add schedule');
await capture('s1-form-cupertino-dark-390-top'); await capture('s1-form-material-dark-390-top');
for (let i = 0; i < 3; i++) await wheel(600); for (let i = 0; i < 3; i++) await wheel(600);
await capture('s1-form-cupertino-dark-390-bottom'); await capture('s1-form-material-dark-390-bottom');
await assertText('Notifications'); await assertText('Notifications');
checks.push({ check: 'Cupertino dark rendered the native form', host: 'cupertino', brightness: 'dark' }); checks.push({ check: 'Material dark rendered the native form', host: 'material', brightness: 'dark' });
if (pageErrors.length) throw new Error(`Page exceptions: ${JSON.stringify(pageErrors)}`); if (pageErrors.length) throw new Error(`Page exceptions: ${JSON.stringify(pageErrors)}`);
const manifest = { const manifest = {
+4 -24
View File
@@ -2,7 +2,6 @@ import 'dart:convert';
import 'dart:js_interop'; import 'dart:js_interop';
import 'dart:js_interop_unsafe'; import 'dart:js_interop_unsafe';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/schedules/domain/editor/schedule_draft.dart'; import 'package:pipelines_app/features/schedules/domain/editor/schedule_draft.dart';
@@ -12,7 +11,7 @@ import 'package:pipelines_app/features/schedules/ui/editor/schedule_editor_form.
/// ///
/// flutter build web -t tool/schedule_editor_probe_app.dart /// flutter build web -t tool/schedule_editor_probe_app.dart
/// ///
/// Query: `host=cupertino`, `brightness=dark`, `scale=2`. The injected callback /// Query: `brightness=dark`, `scale=2`. The injected callback
/// refuses the first valid submit and accepts the retry; it never opens a /// refuses the first valid submit and accepts the retry; it never opens a
/// socket or touches a real schedule. Its counters/record are published at /// socket or touches a real schedule. Its counters/record are published at
/// `globalThis.scheduleEditorProbe` for the Chrome probe. /// `globalThis.scheduleEditorProbe` for the Chrome probe.
@@ -24,7 +23,6 @@ class _ProbeApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final parameters = Uri.base.queryParameters; final parameters = Uri.base.queryParameters;
final cupertino = parameters['host'] == 'cupertino';
final dark = parameters['brightness'] == 'dark'; final dark = parameters['brightness'] == 'dark';
final scale = double.tryParse(parameters['scale'] ?? '') ?? 1.0; final scale = double.tryParse(parameters['scale'] ?? '') ?? 1.0;
Widget media(BuildContext context, Widget? app) => MediaQuery( Widget media(BuildContext context, Widget? app) => MediaQuery(
@@ -33,21 +31,7 @@ class _ProbeApp extends StatelessWidget {
).copyWith(textScaler: TextScaler.linear(scale)), ).copyWith(textScaler: TextScaler.linear(scale)),
child: app!, child: app!,
); );
final home = _ProbeHome(cupertino: cupertino); const home = _ProbeHome();
if (cupertino) {
return CupertinoApp(
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
builder: media,
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Schedule editor probe'),
),
child: SafeArea(child: home),
),
);
}
return MaterialApp( return MaterialApp(
theme: ThemeData( theme: ThemeData(
brightness: dark ? Brightness.dark : Brightness.light, brightness: dark ? Brightness.dark : Brightness.light,
@@ -70,9 +54,7 @@ class _Refusal implements Exception {
} }
class _ProbeHome extends StatefulWidget { class _ProbeHome extends StatefulWidget {
const _ProbeHome({required this.cupertino}); const _ProbeHome();
final bool cupertino;
@override @override
State<_ProbeHome> createState() => _ProbeHomeState(); State<_ProbeHome> createState() => _ProbeHomeState();
@@ -152,9 +134,7 @@ class _ProbeHomeState extends State<_ProbeHome> {
const SizedBox(height: 24), const SizedBox(height: 24),
Text( Text(
'Submitted record', 'Submitted record',
style: widget.cupertino style: Theme.of(context).textTheme.titleMedium,
? CupertinoTheme.of(context).textTheme.navTitleTextStyle
: Theme.of(context).textTheme.titleMedium,
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
SelectableText( SelectableText(
+12 -13
View File
@@ -255,9 +255,9 @@ try {
// One host runs list -> new -> invalid -> valid save -> conflict -> retry, // One host runs list -> new -> invalid -> valid save -> conflict -> retry,
// then pause and delete against the same fixture. // then pause and delete against the same fixture.
const runFlow = async (name, { host, brightness = 'platform', scale = 1, width: w, height: h }) => { const runFlow = async (name, { brightness = 'platform', scale = 1, width: w, height: h }) => {
await load( await load(
`host=${host}&scale=${scale}${brightness === 'dark' ? '&brightness=dark' : ''}`, `scale=${scale}${brightness === 'dark' ? '&brightness=dark' : ''}`,
w, w,
h, h,
); );
@@ -267,7 +267,7 @@ try {
await assertText('Pinned v3 · Every 24h · mon, wed · Europe/London'); await assertText('Pinned v3 · Every 24h · mon, wed · Europe/London');
await assertText('Pinned v3 · 10:00, 18:30 · Server timezone'); await assertText('Pinned v3 · 10:00, 18:30 · Server timezone');
await capture(`${name}-list`); await capture(`${name}-list`);
checks.push({ check: `${host} listed the pipeline schedules`, lists: (await state()).lists }); checks.push({ check: 'Material listed the pipeline schedules', lists: (await state()).lists });
await click('Add schedule'); await click('Add schedule');
await assertText('Future runs only; does not publish or change the workflow.'); await assertText('Future runs only; does not publish or change the workflow.');
@@ -284,7 +284,7 @@ try {
if ((await state()).saves !== 0) throw new Error('Invalid form sent a save'); if ((await state()).saves !== 0) throw new Error('Invalid form sent a save');
await wheel(-2200); await wheel(-2200);
await capture(`${name}-invalid`); await capture(`${name}-invalid`);
checks.push({ check: `${host} invalid fields sent nothing`, saves: (await state()).saves }); checks.push({ check: 'Material invalid fields sent nothing', saves: (await state()).saves });
await typeField('Name', 'Probe schedule'); await typeField('Name', 'Probe schedule');
await typeField('Prompt', 'Summarise the release notes.'); await typeField('Prompt', 'Summarise the release notes.');
@@ -305,7 +305,7 @@ try {
} }
await capture(`${name}-created`); await capture(`${name}-created`);
checks.push({ checks.push({
check: `${host} create sent the pinned, workspace-seeded record with one key and refreshed`, check: 'Material create sent the pinned, workspace-seeded record with one key and refreshed',
saves: created.saves, saves: created.saves,
requestKey: created.lastRequestKey, requestKey: created.lastRequestKey,
record: created.lastSaved, record: created.lastSaved,
@@ -326,7 +326,7 @@ try {
if ((await state()).saves !== 2) throw new Error('Conflict retried without the operator'); if ((await state()).saves !== 2) throw new Error('Conflict retried without the operator');
await capture(`${name}-conflict`); await capture(`${name}-conflict`);
checks.push({ checks.push({
check: `${host} conflict kept the draft and showed the server words`, check: 'Material conflict kept the draft and showed the server words',
saves: (await state()).saves, saves: (await state()).saves,
lastSaved: (await state()).lastSaved, lastSaved: (await state()).lastSaved,
}); });
@@ -335,7 +335,7 @@ try {
await waitFor(async () => (await state()).saves === 3, 'the accepted edit'); await waitFor(async () => (await state()).saves === 3, 'the accepted edit');
await assertText('Edited schedule'); await assertText('Edited schedule');
await assertText('Schedules (3)'); await assertText('Schedules (3)');
checks.push({ check: `${host} accepted edit refreshed the list`, saves: (await state()).saves }); checks.push({ check: 'Material accepted edit refreshed the list', saves: (await state()).saves });
// Pause sends only the enabled flip and the loaded revision. // Pause sends only the enabled flip and the loaded revision.
const beforePause = (await state()).rows.find((row) => row.name === 'Edited schedule'); const beforePause = (await state()).rows.find((row) => row.name === 'Edited schedule');
@@ -346,7 +346,7 @@ try {
throw new Error(`Pause payload drifted: ${JSON.stringify(pause)} vs ${JSON.stringify(beforePause)}`); throw new Error(`Pause payload drifted: ${JSON.stringify(pause)} vs ${JSON.stringify(beforePause)}`);
} }
await assertText('Enable'); await assertText('Enable');
checks.push({ check: `${host} pause sent only enabled with the loaded revision`, pause }); checks.push({ check: 'Material pause sent only enabled with the loaded revision', pause });
// Delete confirms once, then sends the exact id + expected revision. // Delete confirms once, then sends the exact id + expected revision.
await click('Delete'); await click('Delete');
@@ -365,19 +365,18 @@ try {
} }
await assertText('Schedules (2)'); await assertText('Schedules (2)');
await assertNoText('Edited schedule'); await assertNoText('Edited schedule');
checks.push({ check: `${host} delete confirmed and sent id + revision`, deleted }); checks.push({ check: 'Material delete confirmed and sent id + revision', deleted });
}; };
await runFlow('s1w-material-390', { host: 'material', width: 390, height: 844 }); await runFlow('s1w-material-390', { width: 390, height: 844 });
await runFlow('s1w-cupertino-dark-390', { await runFlow('s1w-material-dark-390', {
host: 'cupertino',
brightness: 'dark', brightness: 'dark',
width: 390, width: 390,
height: 844, height: 844,
}); });
// Narrow phone at 2x text on the material host. // Narrow phone at 2x text on the material host.
await load('host=material&scale=2', 320, 844); await load('scale=2', 320, 844);
await assertText('Schedules (2)'); await assertText('Schedules (2)');
await capture('s1w-material-320-2x-list'); await capture('s1w-material-320-2x-list');
await click('Add schedule'); await click('Add schedule');
+1 -18
View File
@@ -1,7 +1,6 @@
import 'dart:js_interop'; import 'dart:js_interop';
import 'dart:js_interop_unsafe'; import 'dart:js_interop_unsafe';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/schedules/ui/pipeline/schedule_pipeline_section.dart'; import 'package:pipelines_app/features/schedules/ui/pipeline/schedule_pipeline_section.dart';
@@ -11,7 +10,7 @@ import 'package:pipelines_app/features/settings/settings_store.dart';
/// ///
/// flutter build web -t tool/schedule_pipeline_probe_app.dart /// flutter build web -t tool/schedule_pipeline_probe_app.dart
/// ///
/// Query: `host=cupertino`, `brightness=dark`, `scale=2`. The fake gateway keeps /// Query: `brightness=dark`, `scale=2`. The fake gateway keeps
/// its schedules in memory, accepts one create, refuses the first edit with a /// its schedules in memory, accepts one create, refuses the first edit with a
/// stale revision, then accepts the retry. It never opens a socket or contacts a /// stale revision, then accepts the retry. It never opens a socket or contacts a
/// real server. State is published at `globalThis.schedulePipelineProbe`. /// real server. State is published at `globalThis.schedulePipelineProbe`.
@@ -30,7 +29,6 @@ class _ProbeApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final parameters = Uri.base.queryParameters; final parameters = Uri.base.queryParameters;
final cupertino = parameters['host'] == 'cupertino';
final dark = parameters['brightness'] == 'dark'; final dark = parameters['brightness'] == 'dark';
final scale = double.tryParse(parameters['scale'] ?? '') ?? 1.0; final scale = double.tryParse(parameters['scale'] ?? '') ?? 1.0;
Widget media(BuildContext context, Widget? app) => MediaQuery( Widget media(BuildContext context, Widget? app) => MediaQuery(
@@ -49,21 +47,6 @@ class _ProbeApp extends StatelessWidget {
final body = SafeArea( final body = SafeArea(
child: ListView(children: [section, const SizedBox(height: 24)]), child: ListView(children: [section, const SizedBox(height: 24)]),
); );
if (cupertino) {
return CupertinoApp(
debugShowCheckedModeBanner: false,
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
builder: media,
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Alpha review'),
),
child: body,
),
);
}
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
theme: ThemeData( theme: ThemeData(
+2 -2
View File
@@ -156,8 +156,8 @@ try {
expect: ['4 schedules', 'Research batteries', 'Pipeline 4 · v2', 'Timezone: Europe/London', 'Next due:'], expect: ['4 schedules', 'Research batteries', 'Pipeline 4 · v2', 'Timezone: Europe/London', 'Next due:'],
}, },
{ {
name: 's1b-schedules-cupertino-390', name: 's1b-schedules-material-390',
theme: 'cupertino', theme: 'material',
scale: 1, scale: 1,
width: 390, width: 390,
height: 844, height: 844,
+1 -13
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/schedules/screen.dart'; import 'package:pipelines_app/features/schedules/screen.dart';
@@ -7,10 +6,9 @@ import 'package:pipelines_app/features/schedules/screen.dart';
/// ///
/// Run with: /// Run with:
/// flutter build web -t tool/schedules_list_probe_app.dart /// flutter build web -t tool/schedules_list_probe_app.dart
/// and open `/?theme=cupertino&scale=2`. /// and open `/?brightness=dark&scale=2`.
void main() { void main() {
final parameters = Uri.base.queryParameters; final parameters = Uri.base.queryParameters;
final cupertino = parameters['theme'] == 'cupertino';
final dark = parameters['brightness'] == 'dark'; final dark = parameters['brightness'] == 'dark';
final scale = double.tryParse(parameters['scale'] ?? '') ?? 1.0; final scale = double.tryParse(parameters['scale'] ?? '') ?? 1.0;
final screen = SchedulesScreen(gateway: _FixtureGateway(), onOpen: (_) {}); final screen = SchedulesScreen(gateway: _FixtureGateway(), onOpen: (_) {});
@@ -18,16 +16,6 @@ void main() {
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(scale)), data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(scale)),
child: app!, child: app!,
); );
if (cupertino) {
runApp(
CupertinoApp(
debugShowCheckedModeBanner: false,
builder: media,
home: CupertinoPageScaffold(child: SafeArea(child: screen)),
),
);
return;
}
runApp( runApp(
MaterialApp( MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
+6 -6
View File
@@ -223,18 +223,18 @@ try {
result.evidence.materialDesktop = await typeQuery('plan'); result.evidence.materialDesktop = await typeQuery('plan');
await capture('x1-search-material-desktop', 1280, 800); await capture('x1-search-material-desktop', 1280, 800);
await load(`${base}?cupertino=1`, 390, 844); await load(`${base}?material=1`, 390, 844);
result.evidence.cupertinoPhone = await typeQuery('plan'); result.evidence.materialPhone = await typeQuery('plan');
await capture('x1-search-cupertino-phone', 390, 844); await capture('x1-search-material-phone', 390, 844);
await load(base, 390, 844); await load(base, 390, 844);
result.evidence.materialTruncatedEmpty = await typeTruncatedEmpty('needle'); result.evidence.materialTruncatedEmpty = await typeTruncatedEmpty('needle');
await capture('x1-search-truncated-empty', 390, 844); await capture('x1-search-truncated-empty', 390, 844);
await load(`${base}?cupertino=1`, 390, 844); await load(`${base}?material=1`, 390, 844);
result.evidence.cupertinoTruncatedEmpty = result.evidence.materialTruncatedEmpty =
await typeTruncatedEmpty('needle'); await typeTruncatedEmpty('needle');
await capture('x1-search-truncated-empty-cupertino', 390, 844); await capture('x1-search-truncated-empty-material', 390, 844);
console.log(JSON.stringify(result, null, 2)); console.log(JSON.stringify(result, null, 2));
} finally { } finally {
+29 -29
View File
@@ -187,8 +187,8 @@ try {
"[...document.querySelectorAll('flt-semantics')].map(x => x.getAttribute('aria-label') || (x.innerText || '').trim()).filter(Boolean)", "[...document.querySelectorAll('flt-semantics')].map(x => x.getAttribute('aria-label') || (x.innerText || '').trim()).filter(Boolean)",
); );
// Everything the semantics tree announces: labels, leaf text, and the value // Everything the semantics tree announces: labels, leaf text, and the value
// of read-only text controls (the Cupertino Summary sections render their // of read-only text controls (the Material Summary sections render their
// JSON in a read-only CupertinoTextField, which is an <input>/<textarea>). // JSON in a read-only MaterialTextField, which is an <input>/<textarea>).
const text = () => const text = () =>
evaluate(`(() => { evaluate(`(() => {
const chunks = []; const chunks = [];
@@ -286,8 +286,8 @@ try {
}; };
// The Summary's Input/Output tiles: Material's ExpansionTile and the // The Summary's Input/Output tiles: Material's ExpansionTile and the
// Cupertino expansion tile both announce their state as the first line of // Material expansion tile both announce their state as the first line of
// aria-description ("Expanded" / "Collapsed"); an expanded Cupertino tile // aria-description ("Expanded" / "Collapsed"); an expanded Material tile
// merges with its read-only text child into one <textarea> node. // merges with its read-only text child into one <textarea> node.
const tileState = (title) => const tileState = (title) =>
evaluate(`(() => { evaluate(`(() => {
@@ -343,7 +343,7 @@ try {
await delay(900); await delay(900);
}; };
// Search is a transient page above the shell: the action opens /search and // Search is a transient page above the shell: the action opens /search and
// the Cupertino host mounts the field after its page transition. // the Material host mounts the field after its page transition.
const openSearch = async () => { const openSearch = async () => {
await tapExact('Search'); await tapExact('Search');
await waitFor(async () => (await path()) === '/search', 'the /search route'); await waitFor(async () => (await path()) === '/search', 'the /search route');
@@ -575,54 +575,54 @@ try {
await capture('search-selection-material-phone-dark-field-summary'); await capture('search-selection-material-phone-dark-field-summary');
await emulateScheme('light'); await emulateScheme('light');
// ---- Cupertino host, phone ----------------------------------------------- // ---- Material host, phone -----------------------------------------------
await navigate(`${origin}/runs?platform=cupertino`, 390, 844); await navigate(`${origin}/runs`, 390, 844);
await assertText('Release train run', 'the Runs list'); await assertText('Release train run', 'the Runs list');
await searchFor('release', 'run #7 · step 5 · output'); await searchFor('release', 'run #7 · step 5 · output');
await assertReleaseResults('cupertino phone'); await assertReleaseResults('material phone');
await assertText('Kind: All kinds', 'the Cupertino kind control'); await assertText('Kind: All kinds', 'the Material kind control');
await capture('search-selection-cupertino-phone-results'); await capture('search-selection-material-phone-results');
await clickPrefix('release-report.txt'); await clickPrefix('release-report.txt');
await assertArtifactVisit('cupertino phone'); await assertArtifactVisit('material phone');
await capture('search-selection-cupertino-phone-artifact-visit'); await capture('search-selection-material-phone-artifact-visit');
await searchFor('retired', 'run #7 · step 5 · evidence'); await searchFor('retired', 'run #7 · step 5 · evidence');
await clickPrefix('run #7 · step 5 · evidence'); await clickPrefix('run #7 · step 5 · evidence');
await assertPlainSummary('cupertino phone', 'a retired field hit'); await assertPlainSummary('material phone', 'a retired field hit');
await capture('search-selection-cupertino-phone-retired-summary'); await capture('search-selection-material-phone-retired-summary');
await searchFor('release', 'release-report.txt'); await searchFor('release', 'release-report.txt');
await clickPrefix('release-report.txt'); await clickPrefix('release-report.txt');
await assertArtifactVisit('cupertino phone (reopened)'); await assertArtifactVisit('material phone (reopened)');
await searchFor('missing', 'missing.log'); await searchFor('missing', 'missing.log');
await clickPrefix('missing.log'); await clickPrefix('missing.log');
await assertPlainSummary('cupertino phone', 'an unknown-visit artifact hit'); await assertPlainSummary('material phone', 'an unknown-visit artifact hit');
await capture('search-selection-cupertino-phone-unknown-visit-summary'); await capture('search-selection-material-phone-unknown-visit-summary');
await searchFor('release', 'run #7 · step 5 · output'); await searchFor('release', 'run #7 · step 5 · output');
await clickPrefix('run #7 · step 5 · output'); await clickPrefix('run #7 · step 5 · output');
await assertFieldSummary('cupertino phone'); await assertFieldSummary('material phone');
await capture('search-selection-cupertino-phone-field-summary'); await capture('search-selection-material-phone-field-summary');
await searchFor('retired', 'run #7 · step 5 · evidence'); await searchFor('retired', 'run #7 · step 5 · evidence');
await clickPrefix('run #7 · step 5 · evidence'); await clickPrefix('run #7 · step 5 · evidence');
await recordRetiredAfterField('cupertino phone'); await recordRetiredAfterField('material phone');
await capture('search-selection-cupertino-phone-retired-after-field-summary'); await capture('search-selection-material-phone-retired-after-field-summary');
// ---- Cupertino host, desktop --------------------------------------------- // ---- Material host, desktop ---------------------------------------------
await navigate(`${origin}/runs?platform=cupertino`, 1280, 800); await navigate(`${origin}/runs`, 1280, 800);
await assertText('Release train run', 'the Runs list'); await assertText('Release train run', 'the Runs list');
await searchFor('release', 'run #7 · step 5 · output'); await searchFor('release', 'run #7 · step 5 · output');
await assertReleaseResults('cupertino desktop'); await assertReleaseResults('material desktop');
await capture('search-selection-cupertino-desktop-results'); await capture('search-selection-material-desktop-results');
await clickPrefix('release-report.txt'); await clickPrefix('release-report.txt');
await assertArtifactVisit('cupertino desktop'); await assertArtifactVisit('material desktop');
await capture('search-selection-cupertino-desktop-artifact-visit'); await capture('search-selection-material-desktop-artifact-visit');
await searchFor('release', 'run #7 · step 5 · output'); await searchFor('release', 'run #7 · step 5 · output');
await clickPrefix('run #7 · step 5 · output'); await clickPrefix('run #7 · step 5 · output');
await assertFieldSummary('cupertino desktop'); await assertFieldSummary('material desktop');
await capture('search-selection-cupertino-desktop-field-summary'); await capture('search-selection-material-desktop-field-summary');
evidence.pageErrors = pageErrors; evidence.pageErrors = pageErrors;
console.log(JSON.stringify(evidence, null, 2)); console.log(JSON.stringify(evidence, null, 2));
+11 -11
View File
@@ -333,7 +333,7 @@ try {
await assertBody('run #1 · Fixture live run'); await assertBody('run #1 · Fixture live run');
await capture('x1-wire-material-search-desktop'); await capture('x1-wire-material-search-desktop');
// Cupertino host: the native navigation-bar action and system Back. // Material host: the native navigation-bar action and system Back.
await send( await send(
'Emulation.setUserAgentOverride', 'Emulation.setUserAgentOverride',
{ {
@@ -346,13 +346,13 @@ try {
); );
await open(`${fixture.url}/runs`, { width: 390, height: 844, mobile: true }); await open(`${fixture.url}/runs`, { width: 390, height: 844, mobile: true });
await assertBody('Fixture live run'); await assertBody('Fixture live run');
const cupertinoListBefore = (await fixtureState()).listRuns; const materialListBefore = (await fixtureState()).listRuns;
await openSearch(); await openSearch();
result.evidence.cupertinoFocus = await fieldFocused(); result.evidence.materialFocus = await fieldFocused();
await typeQuery('fixture'); await typeQuery('fixture');
await assertBody('run #1 · Fixture live run'); await assertBody('run #1 · Fixture live run');
await capture('x1-wire-cupertino-search-phone'); await capture('x1-wire-material-search-phone');
// Browser Back is the shell's own history: the loaded list must still be // Browser Back is the shell's own history: the loaded list must still be
// there rather than being re-read or replaced. // there rather than being re-read or replaced.
@@ -364,23 +364,23 @@ try {
'the search page to close', 'the search page to close',
); );
await assertBody('Fixture live run'); await assertBody('Fixture live run');
const cupertinoListAfter = (await fixtureState()).listRuns; const materialListAfter = (await fixtureState()).listRuns;
if (cupertinoListAfter !== cupertinoListBefore) { if (materialListAfter !== materialListBefore) {
throw new Error( throw new Error(
`Back re-read the retained list: ${cupertinoListBefore} -> ${cupertinoListAfter}`, `Back re-read the retained list: ${materialListBefore} -> ${materialListAfter}`,
); );
} }
result.evidence.cupertinoBack = { result.evidence.materialBack = {
path: await path(), path: await path(),
listRuns: cupertinoListAfter, listRuns: materialListAfter,
}; };
await capture('x1-wire-cupertino-back-restored-phone'); await capture('x1-wire-material-back-restored-phone');
await setSize(1280, 800, false); await setSize(1280, 800, false);
await openSearch(); await openSearch();
await typeQuery('fixture'); await typeQuery('fixture');
await assertBody('run #1 · Fixture live run'); await assertBody('run #1 · Fixture live run');
await capture('x1-wire-cupertino-search-desktop'); await capture('x1-wire-material-search-desktop');
const finalState = await fixtureState(); const finalState = await fixtureState();
if (finalState.subscribed < 2) { if (finalState.subscribed < 2) {
+3 -2
View File
@@ -19,8 +19,9 @@ try {
c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl); c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
await c.send('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 1, mobile: true }); await c.send('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 1, mobile: true });
for (const host of ['material', 'cupertino']) { {
await c.send('Page.navigate', { url: `${fixture.url}?host=${host}` }); const host = 'material';
await c.send('Page.navigate', { url: fixture.url });
assert.ok(await waitFor(() => c.evaluate("Boolean(document.querySelector('flt-semantics-placeholder'))"), 12000)); assert.ok(await waitFor(() => c.evaluate("Boolean(document.querySelector('flt-semantics-placeholder'))"), 12000));
await enableSemantics(c); await enableSemantics(c);
await click(c, 'Add server'); await click(c, 'Add server');
+2 -2
View File
@@ -1,5 +1,5 @@
// Profile editing/persistence and cross-origin browser switching, loopback only. // Profile editing/persistence and cross-origin browser switching, loopback only.
// PROBE_PLATFORM=material node tool/server_profiles_probe.mjs <build> <evidence> // node tool/server_profiles_probe.mjs <build> <evidence>
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { mkdir, mkdtemp, writeFile } from 'node:fs/promises'; import { mkdir, mkdtemp, writeFile } from 'node:fs/promises';
import { once } from 'node:events'; import { once } from 'node:events';
@@ -23,7 +23,7 @@ let c;
try { try {
c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl); c = await connect((await waitForPage(await waitForPort(join(profile, 'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
if (process.env.PROBE_PLATFORM === 'material') await c.send('Emulation.setUserAgentOverride', { await c.send('Emulation.setUserAgentOverride', {
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36', platform: 'Win32', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36', platform: 'Win32',
}); });
await c.send('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 1, mobile: true }); await c.send('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 1, mobile: true });
-3
View File
@@ -12,7 +12,6 @@ import 'package:pipelines_app/features/settings/settings.dart';
/// endpoint=ws://127.0.0.1:PORT/connect seed the URL field / connect target /// endpoint=ws://127.0.0.1:PORT/connect seed the URL field / connect target
/// workspace=/srv/pipelines seed the saved workspace /// workspace=/srv/pipelines seed the saved workspace
/// connect=1 explicitly connect after first frame /// connect=1 explicitly connect after first frame
/// platform=ios render the Cupertino controls
/// theme=dark dark Material theme /// theme=dark dark Material theme
/// scale=1.5 large-text check /// scale=1.5 large-text check
void main() { void main() {
@@ -22,7 +21,6 @@ void main() {
final store = MemorySettingsStore( final store = MemorySettingsStore(
workspace: params['workspace']?.trim() ?? '', workspace: params['workspace']?.trim() ?? '',
); );
final isIOS = params['platform'] == 'ios';
final isDark = params['theme'] == 'dark'; final isDark = params['theme'] == 'dark';
final scale = double.tryParse(params['scale'] ?? '') ?? 1; final scale = double.tryParse(params['scale'] ?? '') ?? 1;
@@ -30,7 +28,6 @@ void main() {
MaterialApp( MaterialApp(
title: 'Pipelines Settings probe', title: 'Pipelines Settings probe',
theme: ThemeData( theme: ThemeData(
platform: isIOS ? TargetPlatform.iOS : TargetPlatform.android,
brightness: isDark ? Brightness.dark : Brightness.light, brightness: isDark ? Brightness.dark : Brightness.light,
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
seedColor: Colors.blue, seedColor: Colors.blue,
-4
View File
@@ -55,7 +55,6 @@ Future<void> main(List<String> arguments) async {
'validation', 'validation',
'workspace', 'workspace',
'dark', 'dark',
'ios',
'narrow', 'narrow',
]; ];
for (final scenario in scenarios) { for (final scenario in scenarios) {
@@ -93,9 +92,6 @@ Future<void> _runScenario(
case 'dark': case 'dark':
target = '$base?connect=1&theme=dark'; target = '$base?connect=1&theme=dark';
break; break;
case 'ios':
target = '$base?connect=1&platform=ios';
break;
case 'narrow': case 'narrow':
width = 390; width = 390;
height = 844; height = 844;
+2 -2
View File
@@ -7,7 +7,7 @@
// and unknown-stage states, closes it with Back on both hosts, and writes // and unknown-stage states, closes it with Back on both hosts, and writes
// captures. // captures.
// //
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \ // PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
// PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \ // PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \
// OPENCODE_ARTIFACT_DIR=<dir> node tool/stage_definition_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/stage_definition_probe.mjs
import { createServer } from 'node:http'; import { createServer } from 'node:http';
@@ -22,7 +22,7 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
const root = resolve( const root = resolve(
process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/stage_definition_probe_web'), process.env.PROBE_WEB_ROOT ?? join(process.cwd(), 'build/stage_definition_probe_web'),
); );
const variant = process.env.PROBE_VARIANT ?? 'material'; const variant = 'material';
const scheme = process.env.PROBE_SCHEME ?? 'dark'; const scheme = process.env.PROBE_SCHEME ?? 'dark';
const scale = process.env.PROBE_SCALE ?? '1'; const scale = process.env.PROBE_SCALE ?? '1';
const width = Number(process.env.PROBE_WIDTH ?? 1280); const width = Number(process.env.PROBE_WIDTH ?? 1280);
+5 -17
View File
@@ -1,11 +1,9 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/features/settings/storage/storage_screen.dart'; import 'package:pipelines_app/features/settings/storage/storage_screen.dart';
import 'storage_probe_fixture.dart'; import 'storage_probe_fixture.dart';
void main() { void main() {
final query = Uri.base.queryParameters; final query = Uri.base.queryParameters;
final cupertino = query['platform'] == 'cupertino';
final dark = query['theme'] == 'dark'; final dark = query['theme'] == 'dark';
final scale = double.tryParse(query['scale'] ?? '') ?? 1; final scale = double.tryParse(query['scale'] ?? '') ?? 1;
final screen = StorageScreen( final screen = StorageScreen(
@@ -16,20 +14,10 @@ void main() {
child: child!, child: child!,
); );
runApp( runApp(
cupertino MaterialApp(
? CupertinoApp( theme: ThemeData(brightness: dark ? Brightness.dark : Brightness.light),
theme: CupertinoThemeData( builder: scaled,
brightness: dark ? Brightness.dark : Brightness.light, home: screen,
), ),
builder: scaled,
home: screen,
)
: MaterialApp(
theme: ThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
builder: scaled,
home: screen,
),
); );
} }
+3 -34
View File
@@ -1,7 +1,6 @@
import 'dart:js_interop'; import 'dart:js_interop';
import 'dart:js_interop_unsafe'; import 'dart:js_interop_unsafe';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
@@ -69,7 +68,6 @@ class _ProbeApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final params = Uri.base.queryParameters; final params = Uri.base.queryParameters;
final cupertino = params['host'] == 'cupertino';
final scale = double.tryParse(params['scale'] ?? '') ?? 1; final scale = double.tryParse(params['scale'] ?? '') ?? 1;
Widget scaled(BuildContext context, Widget? app) => MediaQuery( Widget scaled(BuildContext context, Widget? app) => MediaQuery(
data: MediaQuery.of( data: MediaQuery.of(
@@ -77,24 +75,16 @@ class _ProbeApp extends StatelessWidget {
).copyWith(textScaler: TextScaler.linear(scale)), ).copyWith(textScaler: TextScaler.linear(scale)),
child: app!, child: app!,
); );
if (cupertino) {
return CupertinoApp(
builder: scaled,
home: const _ProbeHome(cupertino: true),
);
}
return MaterialApp( return MaterialApp(
theme: ThemeData(platform: TargetPlatform.android), theme: ThemeData(platform: TargetPlatform.android),
builder: scaled, builder: scaled,
home: const _ProbeHome(cupertino: false), home: const _ProbeHome(),
); );
} }
} }
class _ProbeHome extends StatefulWidget { class _ProbeHome extends StatefulWidget {
const _ProbeHome({required this.cupertino}); const _ProbeHome();
final bool cupertino;
@override @override
State<_ProbeHome> createState() => _ProbeHomeState(); State<_ProbeHome> createState() => _ProbeHomeState();
@@ -130,7 +120,7 @@ class _ProbeHomeState extends State<_ProbeHome> {
context: context, context: context,
template: _template, template: _template,
repository: TemplateRepository(_gateway), repository: TemplateRepository(_gateway),
cupertino: widget.cupertino, cupertino: false,
onCreated: (detail) { onCreated: (detail) {
_gateway.created.add(detail); _gateway.created.add(detail);
_publish(); _publish();
@@ -140,27 +130,6 @@ class _ProbeHomeState extends State<_ProbeHome> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (widget.cupertino) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Template create probe'),
),
// One bounded, scrollable column keeps the opener reachable at 2x text,
// where a long button label is wider than a phone viewport.
child: Center(
child: SingleChildScrollView(
padding: const EdgeInsets.all(24),
child: CupertinoButton.filled(
onPressed: _open,
child: const Text(
'Create pipeline from this template',
textAlign: TextAlign.center,
),
),
),
),
);
}
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Template create probe')), appBar: AppBar(title: const Text('Template create probe')),
body: Center( body: Center(
+7 -7
View File
@@ -14,7 +14,7 @@ import { tmpdir } from 'node:os';
// OPENCODE_ARTIFACT_DIR=<dir> node tool/template_create_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/template_create_probe.mjs
// //
// Optional PROBE_WIDTH/PROBE_HEIGHT (viewport), PROBE_SCALE (text scale), // Optional PROBE_WIDTH/PROBE_HEIGHT (viewport), PROBE_SCALE (text scale),
// PROBE_HOST (material|cupertino) and PROBE_CAPTURE_PREFIX. The bundle's // and PROBE_CAPTURE_PREFIX. The bundle's
// fixture gateway is in-process, so this never contacts a real Pipelines // fixture gateway is in-process, so this never contacts a real Pipelines
// server and never submits to one. Requires Google Chrome. // server and never submits to one. Requires Google Chrome.
@@ -25,7 +25,7 @@ await mkdir(artifactDir, { recursive: true });
const width = Number(process.env.PROBE_WIDTH ?? 390); const width = Number(process.env.PROBE_WIDTH ?? 390);
const height = Number(process.env.PROBE_HEIGHT ?? 844); const height = Number(process.env.PROBE_HEIGHT ?? 844);
const textScale = process.env.PROBE_SCALE ?? '1'; const textScale = process.env.PROBE_SCALE ?? '1';
const host = process.env.PROBE_HOST ?? 'material'; const host = 'material';
const capturePrefix = process.env.PROBE_CAPTURE_PREFIX ?? 't1-create'; const capturePrefix = process.env.PROBE_CAPTURE_PREFIX ?? 't1-create';
const MIME = { const MIME = {
@@ -181,7 +181,7 @@ try {
// The prompt is open as soon as its native alert-dialog surface exists. The // The prompt is open as soon as its native alert-dialog surface exists. The
// Create action's button role/aria-disabled is host- and scale-dependent on // Create action's button role/aria-disabled is host- and scale-dependent on
// the web semantics layer, so the disabled state is asserted module-side for // the web semantics layer, so the disabled state is asserted module-side for
// Material and by widget tests for Cupertino. // Material and by widget tests for Material.
const promptOpen = () => const promptOpen = () =>
evaluate("Boolean(document.querySelector('[role=alertdialog]'))"); evaluate("Boolean(document.querySelector('[role=alertdialog]'))");
@@ -229,7 +229,7 @@ try {
const checks = []; const checks = [];
const captures = []; const captures = [];
await send('Page.navigate', { url: `${origin}/?scale=${textScale}&host=${host}` }, session); await send('Page.navigate', { url: `${origin}/?scale=${textScale}` }, session);
await waitFor( await waitFor(
() => evaluate("Boolean(document.querySelector('flt-semantics-placeholder'))"), () => evaluate("Boolean(document.querySelector('flt-semantics-placeholder'))"),
'semantics placeholder', 'semantics placeholder',
@@ -243,9 +243,9 @@ try {
await assertBody('Create from Release workflow'); await assertBody('Create from Release workflow');
await assertBody('New pipeline name (required)'); await assertBody('New pipeline name (required)');
await assertBody("Creates a new draft pipeline on the server from this template's source; it is not run."); await assertBody("Creates a new draft pipeline on the server from this template's source; it is not run.");
// CupertinoDialogAction does not expose aria-disabled on the web semantics // MaterialDialogAction does not expose aria-disabled on the web semantics
// layer; its disabled state is covered by the widget tests. // layer; its disabled state is covered by the widget tests.
if (host !== 'cupertino' && (await createDisabled()) !== true) { if (host !== 'material' && (await createDisabled()) !== true) {
throw new Error('Create was not disabled with a blank name'); throw new Error('Create was not disabled with a blank name');
} }
const blank = await field(); const blank = await field();
@@ -259,7 +259,7 @@ try {
checks.push({ check: 'blank name keeps Create disabled', field: blank }); checks.push({ check: 'blank name keeps Create disabled', field: blank });
await typeName('Probe release'); await typeName('Probe release');
if (host !== 'cupertino' && (await createDisabled()) !== false) { if (host !== 'material' && (await createDisabled()) !== false) {
throw new Error('Create stayed disabled after a non-blank name'); throw new Error('Create stayed disabled after a non-blank name');
} }
await clickLabel('Create'); await clickLabel('Create');
+1 -10
View File
@@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:js_interop'; import 'dart:js_interop';
import 'dart:js_interop_unsafe'; import 'dart:js_interop_unsafe';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/core/api_gateway.dart';
@@ -13,7 +12,7 @@ import 'package:pipelines_app/features/templates/screen.dart';
/// ///
/// The fixture gateway is in-process and records every request; nothing here /// The fixture gateway is in-process and records every request; nothing here
/// opens a socket or contacts a real server. Query parameters: /// opens a socket or contacts a real server. Query parameters:
/// `host=material|cupertino`, `scale=<text scale>` and /// `scale=<text scale>` and
/// `scenario=default|empty|refresh-refusal`. The state published at /// `scenario=default|empty|refresh-refusal`. The state published at
/// `globalThis.templatesGalleryProbe` is read by the driver. /// `globalThis.templatesGalleryProbe` is read by the driver.
const _source = ' name: "release"\n\tstages:\n - key: "añadir" 😀 \n'; const _source = ' name: "release"\n\tstages:\n - key: "añadir" 😀 \n';
@@ -130,7 +129,6 @@ class _ProbeApp extends StatefulWidget {
class _ProbeAppState extends State<_ProbeApp> { class _ProbeAppState extends State<_ProbeApp> {
late final _params = Uri.base.queryParameters; late final _params = Uri.base.queryParameters;
late final _cupertino = _params['host'] == 'cupertino';
late final _scale = double.tryParse(_params['scale'] ?? '') ?? 1; late final _scale = double.tryParse(_params['scale'] ?? '') ?? 1;
late final _gateway = _ProbeGateway( late final _gateway = _ProbeGateway(
_publish, _publish,
@@ -166,13 +164,6 @@ class _ProbeAppState extends State<_ProbeApp> {
child: app!, child: app!,
); );
final screen = TemplatesScreen(gateway: _gateway, onCreated: _created); final screen = TemplatesScreen(gateway: _gateway, onCreated: _created);
if (_cupertino) {
return CupertinoApp(
theme: CupertinoThemeData(brightness: Brightness.dark),
builder: scaled,
home: screen,
);
}
return MaterialApp( return MaterialApp(
theme: ThemeData(brightness: Brightness.dark), theme: ThemeData(brightness: Brightness.dark),
builder: scaled, builder: scaled,
+5 -5
View File
@@ -13,9 +13,9 @@ import { tmpdir } from 'node:os';
// -o build/templates_gallery_probe_web // -o build/templates_gallery_probe_web
// OPENCODE_ARTIFACT_DIR=<dir> node tool/templates_gallery_probe.mjs // OPENCODE_ARTIFACT_DIR=<dir> node tool/templates_gallery_probe.mjs
// //
// PROBE_HOST (material|cupertino), PROBE_SCALE, PROBE_WIDTH/PROBE_HEIGHT, // PROBE_SCALE, PROBE_WIDTH/PROBE_HEIGHT, PROBE_SCENARIO
// PROBE_SCENARIO (default|empty|refresh-refusal) and PROBE_CAPTURE_PREFIX // (default|empty|refresh-refusal) and PROBE_CAPTURE_PREFIX select the evidence.
// select the host and evidence. The fixture gateway is in-process: no socket // The fixture gateway is in-process: no socket
// is opened and no real Pipelines server is contacted. // is opened and no real Pipelines server is contacted.
const root = resolve(process.env.PROBE_WEB_ROOT ?? 'build/templates_gallery_probe_web'); const root = resolve(process.env.PROBE_WEB_ROOT ?? 'build/templates_gallery_probe_web');
@@ -25,7 +25,7 @@ await mkdir(artifactDir, { recursive: true });
const width = Number(process.env.PROBE_WIDTH ?? 390); const width = Number(process.env.PROBE_WIDTH ?? 390);
const height = Number(process.env.PROBE_HEIGHT ?? 844); const height = Number(process.env.PROBE_HEIGHT ?? 844);
const textScale = process.env.PROBE_SCALE ?? '1'; const textScale = process.env.PROBE_SCALE ?? '1';
const host = process.env.PROBE_HOST ?? 'material'; const host = 'material';
const scenario = process.env.PROBE_SCENARIO ?? 'default'; const scenario = process.env.PROBE_SCENARIO ?? 'default';
const capturePrefix = process.env.PROBE_CAPTURE_PREFIX ?? 't1-gallery'; const capturePrefix = process.env.PROBE_CAPTURE_PREFIX ?? 't1-gallery';
const deviceScaleFactor = Number(process.env.PROBE_DPR ?? 1); const deviceScaleFactor = Number(process.env.PROBE_DPR ?? 1);
@@ -216,7 +216,7 @@ try {
const captures = []; const captures = [];
await send( await send(
'Page.navigate', 'Page.navigate',
{ url: `${origin}/?scale=${textScale}&host=${host}&scenario=${scenario}` }, { url: `${origin}/?scale=${textScale}&scenario=${scenario}` },
session, session,
); );
await waitFor( await waitFor(
+5 -5
View File
@@ -5,8 +5,8 @@
// OPENCODE_ARTIFACT_DIR=<shared public dir> \ // OPENCODE_ARTIFACT_DIR=<shared public dir> \
// node tool/templates_wiring_probe.mjs build/templates_wiring_web // node tool/templates_wiring_probe.mjs build/templates_wiring_web
// //
// PROBE_HOST (material|cupertino) selects the host. The fixture server is an // The fixture server is an isolated loopback implementation of the Pipelines
// isolated loopback implementation of the Pipelines websocket protocol used by // websocket protocol used by
// this flow; no production server, database or operator data is involved. // this flow; no production server, database or operator data is involved.
import { createServer } from 'node:http'; import { createServer } from 'node:http';
import { readFile, mkdir, mkdtemp, rm, stat, writeFile } from 'node:fs/promises'; import { readFile, mkdir, mkdtemp, rm, stat, writeFile } from 'node:fs/promises';
@@ -21,7 +21,7 @@ const root = resolve(process.argv[2] ?? 'build/templates_wiring_web');
const artifactDir = process.env.OPENCODE_ARTIFACT_DIR; const artifactDir = process.env.OPENCODE_ARTIFACT_DIR;
if (!artifactDir) throw new Error('Set OPENCODE_ARTIFACT_DIR for the probe captures'); if (!artifactDir) throw new Error('Set OPENCODE_ARTIFACT_DIR for the probe captures');
await mkdir(artifactDir, { recursive: true }); await mkdir(artifactDir, { recursive: true });
const host = process.env.PROBE_HOST === 'cupertino' ? 'cupertino' : 'material'; const host = 'material';
const width = Number(process.env.PROBE_WIDTH ?? 390); const width = Number(process.env.PROBE_WIDTH ?? 390);
const height = Number(process.env.PROBE_HEIGHT ?? 844); const height = Number(process.env.PROBE_HEIGHT ?? 844);
const deviceScaleFactor = Number(process.env.PROBE_DPR ?? 1); const deviceScaleFactor = Number(process.env.PROBE_DPR ?? 1);
@@ -599,7 +599,7 @@ try {
const checks = []; const checks = [];
const captures = []; const captures = [];
await send('Page.navigate', { url: `${fixture.origin}/?host=${host}` }, session); await send('Page.navigate', { url: `${fixture.origin}/` }, session);
await waitFor( await waitFor(
() => evaluate("Boolean(document.querySelector('flt-semantics-placeholder'))"), () => evaluate("Boolean(document.querySelector('flt-semantics-placeholder'))"),
'semantics placeholder', 'semantics placeholder',
@@ -661,7 +661,7 @@ try {
await assertBody('Definition source'); await assertBody('Definition source');
// Detail Back returns to the gallery; the page Back restores Settings. // Detail Back returns to the gallery; the page Back restores Settings.
await clickLabel(host === 'cupertino' ? 'Back Templates' : 'Back'); await clickLabel(host === 'material' ? 'Back Templates' : 'Back');
await assertBody('Release workflow'); await assertBody('Release workflow');
await clickLabel('Back to Settings'); await clickLabel('Back to Settings');
await assertPath('/settings'); await assertPath('/settings');
+2 -9
View File
@@ -6,21 +6,14 @@ import 'package:pipelines_app/application/server_endpoint.dart';
/// Browser acceptance entrypoint for the registered Templates destination. /// Browser acceptance entrypoint for the registered Templates destination.
/// ///
/// It is the real application composition (the same router, shell, Settings and /// It is the real application composition (the same router, shell, Settings and
/// Pipelines destinations); only the host style is selectable so both Material /// Pipelines destinations). Every request is answered by the isolated loopback fixture in
/// and Cupertino can be exercised on the web. `?host=material|cupertino` picks
/// the host. Every request is answered by the isolated loopback fixture in
/// `tool/templates_wiring_probe.mjs`; no production server is contacted. /// `tool/templates_wiring_probe.mjs`; no production server is contacted.
void main() { void main() {
useAppUrlStrategy(); useAppUrlStrategy();
final host = Uri.base.queryParameters['host'];
runApp( runApp(
PipelinesApp( PipelinesApp(
server: ServerEndpoint.resolve(base: Uri.base, web: true), server: ServerEndpoint.resolve(base: Uri.base, web: true),
cupertino: switch (host) { cupertino: false,
'cupertino' => true,
'material' => false,
_ => null,
},
), ),
); );
} }
+19 -60
View File
@@ -484,11 +484,11 @@ try {
} }
}; };
// Cupertino host (macOS browser): Cancel sends nothing, then Save applies the // Material host (macOS browser): Cancel sends nothing, then Save applies the
// exact server reply to the detail and the list row. // exact server reply to the detail and the list row.
await open('Fixture live run'); await open('Fixture live run');
await assertBody('Original prompt'); await assertBody('Original prompt');
captures.push(await capture('r2-title-cupertino-detail')); captures.push(await capture('r2-title-material-detail'));
await assertOcr(captures[0], 'Fixture live run'); await assertOcr(captures[0], 'Fixture live run');
await clickText('Rename'); await clickText('Rename');
@@ -499,7 +499,7 @@ try {
} }
await send('Input.insertText', { text: 'Discarded title' }, session); await send('Input.insertText', { text: 'Discarded title' }, session);
await delay(300); await delay(300);
captures.push(await capture('r2-title-cupertino-dialog')); captures.push(await capture('r2-title-material-dialog'));
await clickText('Cancel'); await clickText('Cancel');
if ((await state()).renames.length !== 0) { if ((await state()).renames.length !== 0) {
throw new Error('Cancel sent set_run_title'); throw new Error('Cancel sent set_run_title');
@@ -507,69 +507,28 @@ try {
await assertBody('Fixture live run'); await assertBody('Fixture live run');
await waitFor(async () => !(await dialogOpen()), 'the closed rename prompt'); await waitFor(async () => !(await dialogOpen()), 'the closed rename prompt');
checks.push({ check: 'Cancel sent nothing and kept the stored title', sent: 0 }); checks.push({ check: 'Cancel sent nothing and kept the stored title', sent: 0 });
captures.push(await capture('r2-title-cupertino-cancelled')); captures.push(await capture('r2-title-material-cancelled'));
const cupertinoState = await rename('Cupertino renamed run', { const materialState = await rename('Material renamed run', {
initial: 'Fixture live run', initial: 'Fixture live run',
}); });
captures.push(await capture('r2-title-cupertino-renamed'));
await assertOcr(captures.at(-1), 'Cupertino renamed run');
checks.push({
check: 'Cupertino Save sent the exact payload',
rename: cupertinoState.renames.at(-1),
field: cupertinoState.field,
});
await clickText('Back');
await assertBody('Cupertino renamed run');
captures.push(await capture('r2-title-cupertino-list'));
await assertOcr(captures.at(-1), 'Cupertino renamed run');
checks.push({ check: 'The list row shows the server title', path: await evaluate('location.pathname') });
// Material host: the same deep link and the same shared gateway.
await send(
'Emulation.setUserAgentOverride',
{
userAgent:
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 ' +
'(KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
platform: 'Linux x86_64',
},
session,
);
await open('Cupertino renamed run');
await assertBody('Original prompt');
await clickText('Rename');
await waitFor(dialogOpen, 'the material rename prompt');
const materialField = await focusRenameField();
if (materialField?.value !== 'Cupertino renamed run') {
throw new Error(`Material rename field seeded with ${JSON.stringify(materialField)}`);
}
await send('Input.insertText', { text: 'Material renamed run' }, session);
await delay(300);
captures.push(await capture('r2-title-material-dialog'));
await clickText('Save');
await waitFor(
async () => {
const text = await semanticText();
return text.includes('Material renamed run') && !text.includes('Save');
},
'the material server title',
);
const materialState = await state();
checks.push({
check: 'Material Save sent the exact payload',
rename: materialState.renames.at(-1),
field: materialField,
});
captures.push(await capture('r2-title-material-renamed')); captures.push(await capture('r2-title-material-renamed'));
await assertOcr(captures.at(-1), 'Material renamed run'); await assertOcr(captures.at(-1), 'Material renamed run');
checks.push({
check: 'Material Save sent the exact payload',
rename: materialState.renames.at(-1),
field: materialState.field,
});
if (materialState.renames.length !== 2) { await clickText('Back');
throw new Error(`Expected two renames, saw ${JSON.stringify(materialState.renames)}`); await assertBody('Material renamed run');
} captures.push(await capture('r2-title-material-list'));
if (!materialState.renames[0].title.endsWith('Cupertino renamed run')) { await assertOcr(captures.at(-1), 'Material renamed run');
throw new Error(`First rename drifted: ${JSON.stringify(materialState.renames[0])}`); checks.push({ check: 'The list row shows the server title', path: await evaluate('location.pathname') });
const finalState = await state();
if (finalState.renames.length !== 1) {
throw new Error(`Expected one rename, saw ${JSON.stringify(finalState.renames)}`);
} }
console.log(JSON.stringify({ ok: true, fixture: fixtureUrl, checks, captures }, null, 2)); console.log(JSON.stringify({ ok: true, fixture: fixtureUrl, checks, captures }, null, 2));
} finally { } finally {
+4 -5
View File
@@ -8,8 +8,7 @@ import { startFixture } from './runs_probe_server.mjs';
import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs'; import { launchChrome, waitForPort, waitForPage, connect, sleep } from './pipelines_probe_cdp_lib.mjs';
import { axNodes, enableSemantics, waitFor, capture, click, clickAt } from './pipelines_probe_cdp_input.mjs'; import { axNodes, enableSemantics, waitFor, capture, click, clickAt } from './pipelines_probe_cdp_input.mjs';
const platform = process.env.PROBE_PLATFORM ?? 'material'; const output = resolve(process.argv[3] ?? 'build/ui-followups-material');
const output = resolve(process.argv[3] ?? `build/ui-followups-${platform}`);
await mkdir(output,{recursive:true}); await mkdir(output,{recursive:true});
const stage = 'verify_release'; const stage = 'verify_release';
const runDetail = { id:1,title:'Recorded release',status:'failed',graph:{stages:[{key:stage,type:'model'}]},steps:[ const runDetail = { id:1,title:'Recorded release',status:'failed',graph:{stages:[{key:stage,type:'model'}]},steps:[
@@ -21,7 +20,7 @@ const runDetail = { id:1,title:'Recorded release',status:'failed',graph:{stages:
const fixture=await startFixture({root:resolve(process.argv[2]),runDetail,chatMessages:[]}); const fixture=await startFixture({root:resolve(process.argv[2]),runDetail,chatMessages:[]});
const profile=await mkdtemp(join(tmpdir(),'ui-followups-')); const profile=await mkdtemp(join(tmpdir(),'ui-followups-'));
const chrome=launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',profile,'about:blank'); const chrome=launchChrome('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',profile,'about:blank');
const log={platform,checks:[],captures:[]}; const log={checks:[],captures:[]};
let c; let c;
const names=async()=>(await axNodes(c)).flatMap(n=>[n.name?.value??'',n.value?.value??'']); const names=async()=>(await axNodes(c)).flatMap(n=>[n.name?.value??'',n.value?.value??'']);
async function point(node) { async function point(node) {
@@ -46,8 +45,8 @@ async function promptSwitch() {
try { try {
c=await connect((await waitForPage(await waitForPort(join(profile,'DevToolsActivePort')))).webSocketDebuggerUrl); c=await connect((await waitForPage(await waitForPort(join(profile,'DevToolsActivePort')))).webSocketDebuggerUrl);
await c.send('Page.enable'); await c.send('Page.enable');
if(platform==='material') await c.send('Emulation.setUserAgentOverride',{ await c.send('Emulation.setUserAgentOverride',{
userAgent:'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36',platform:'Win32', userAgent:'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36', platform:'Win32',
}); });
await c.send('Emulation.setDeviceMetricsOverride',{width:1280,height:1000,deviceScaleFactor:1,mobile:false}); await c.send('Emulation.setDeviceMetricsOverride',{width:1280,height:1000,deviceScaleFactor:1,mobile:false});
await navigate('/chat'); await navigate('/chat');