Remove Cupertino fixture alternatives
Keep capture and probe tooling on the app's single Material surface by removing obsolete platform switches, hosts, and documentation. Preserve the existing Material routes and fixture behavior while retaining compatibility APIs outside this lane.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Material-only fixture cleanup
|
||||
|
||||
Removed alternate Cupertino hosts and query switches from the search, saved-server,
|
||||
and artifact-list browser fixtures. Their existing Material routes, callbacks,
|
||||
text scaling, selection state, and retry behavior remain unchanged. Updated the
|
||||
capture-kit documentation to describe the single Material fixture surface.
|
||||
|
||||
Focused verification: `artifact_visit_list_test.dart` and
|
||||
`artifact_visit_list_semantics_test.dart` passed (14 tests); `tool/analyze.sh`
|
||||
reported clean. No browser capture was run because the fixture chrome host was
|
||||
only simplified, not visually redesigned.
|
||||
|
||||
## Review follow-up
|
||||
|
||||
Removed the remaining `platform=cupertino` branch from the full-app capture
|
||||
fixture and its web/native route helper signatures. The fixture now always
|
||||
constructs the Material app; the shared `PipelinesApp.cupertino` compatibility
|
||||
parameter remains untouched for other callers.
|
||||
|
||||
Focused verification: the two artifact visit-list tests passed (14 tests), and
|
||||
`tool/analyze.sh` reported clean. The first attempted test command used stale
|
||||
paths and failed to load them; the corrected paths were then run successfully.
|
||||
|
||||
## Review follow-up
|
||||
|
||||
Removed the capture CLI's obsolete `--platform` option and URL forwarding,
|
||||
including the script/example `platform` field. Capture routes now expose only
|
||||
the Material fixture while retaining theme, search, sizing, and fixture params.
|
||||
|
||||
Focused verification: `artifact_visit_list_test.dart` and
|
||||
`artifact_visit_list_semantics_test.dart` passed (14 tests); `tool/analyze.sh`
|
||||
reported clean. `node tool/capture/capture.mjs --help` no longer lists a
|
||||
platform option, and no platform/Cupertino capture option remains under
|
||||
`tool/capture`.
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pipelines_app/features/artifacts/domain/artifact_groups.dart';
|
||||
import 'package:pipelines_app/features/artifacts/domain/artifact_record.dart';
|
||||
@@ -9,7 +8,6 @@ import 'package:pipelines_app/features/artifacts/ui/artifact_visit_list.dart';
|
||||
/// line only echoes the widget's callback.
|
||||
///
|
||||
/// Query parameters:
|
||||
/// platform=ios render the Cupertino host instead of Material
|
||||
/// scale=1.5 large-text check
|
||||
/// state=empty no recorded groups
|
||||
/// state=disabled rows rendered without a selection callback
|
||||
@@ -17,7 +15,7 @@ import 'package:pipelines_app/features/artifacts/ui/artifact_visit_list.dart';
|
||||
void main() {
|
||||
final params = Uri.base.queryParameters;
|
||||
runApp(
|
||||
_ProbeApp(cupertino: params['platform'] == 'ios', state: params['state']),
|
||||
_ProbeApp(state: params['state']),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,9 +113,8 @@ List<ArtifactGroup> _groupsFor(String? state) => switch (state) {
|
||||
};
|
||||
|
||||
class _ProbeApp extends StatefulWidget {
|
||||
const _ProbeApp({required this.cupertino, this.state});
|
||||
const _ProbeApp({this.state});
|
||||
|
||||
final bool cupertino;
|
||||
final String? state;
|
||||
|
||||
@override
|
||||
@@ -173,18 +170,6 @@ class _ProbeAppState extends State<_ProbeApp> {
|
||||
).copyWith(textScaler: TextScaler.linear(scale)),
|
||||
child: child ?? const SizedBox.shrink(),
|
||||
);
|
||||
if (widget.cupertino) {
|
||||
return CupertinoApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
builder: scaled,
|
||||
home: CupertinoPageScaffold(
|
||||
// Sections paint the grouped background; the page must match it or a
|
||||
// white seam shows below the last section in light mode.
|
||||
backgroundColor: CupertinoColors.systemGroupedBackground,
|
||||
child: body,
|
||||
),
|
||||
);
|
||||
}
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
builder: scaled,
|
||||
|
||||
@@ -29,8 +29,8 @@ change, from `app/`:
|
||||
```
|
||||
|
||||
URL parameters (the kit sets them from `open=` and the options):
|
||||
`route=<app route>`, `q=<search>`, `platform=material|cupertino`,
|
||||
`theme=light|dark`; `--params` (or a step's or script's `params`) adds fixture
|
||||
`route=<app route>`, `q=<search>`, `theme=light|dark`; `--params` (or a step's
|
||||
or script's `params`) adds fixture
|
||||
options such as `chats=2&rich=1`. Use `route=/settings` to open Settings and then
|
||||
click `Server health`; the fixture channel returns `server_stats` automatically.
|
||||
Without `theme`, the app follows the browser's colour
|
||||
@@ -39,7 +39,7 @@ scheme. `--theme` also sets that colour scheme through Chrome emulation.
|
||||
## Steps
|
||||
|
||||
You can pass steps on the command line as `verb=value`. With `--script`, they
|
||||
go in a JSON array or in `{ "size", "platform", "theme", "q", "steps": [...] }`.
|
||||
go in a JSON array or in `{ "size", "theme", "q", "steps": [...] }`.
|
||||
In JSON, a step can also set `wait` (ms), `timeout`, `name`, `ms` and `frames`.
|
||||
|
||||
| step | effect |
|
||||
@@ -84,8 +84,8 @@ Its bytes are served from the build, so copy the fixture in after building:
|
||||
## Recipes (run from `app/` after building `build/probe-app`)
|
||||
|
||||
Capture a page at phone and fold widths. Use 560 for phone: headless Chrome
|
||||
misrenders Flutter below about 500 px. The app has one Material UI; do not
|
||||
capture `platform=cupertino`.
|
||||
misrenders Flutter below about 500 px. The app has one Material UI. The fixture
|
||||
is Material-only on every platform.
|
||||
|
||||
```sh
|
||||
for size in 560x1000 880x1000; do
|
||||
|
||||
@@ -16,7 +16,7 @@ import { contactSheet, pickFrames } from './sheet.mjs';
|
||||
import { describe, flutterPage, parseTarget } from './page.mjs';
|
||||
|
||||
const USAGE = `usage: capture.mjs (--build <dir> | --url <url>) --out <dir> [options] [steps...]
|
||||
options: --script <steps.json> --size WxH (880x1000) --platform material|cupertino
|
||||
options: --script <steps.json> --size WxH (880x1000)
|
||||
--theme light|dark --q <search> --wait <ms after actions, 1000>
|
||||
--film-ms <ms, 900> --cdp http://127.0.0.1:<port> --probe true|false
|
||||
--params <query, e.g. chats=2&rich=1, added to every open>
|
||||
@@ -47,7 +47,7 @@ let steps = cliSteps;
|
||||
if (opts.script) {
|
||||
const script = JSON.parse(await readFile(opts.script, 'utf8'));
|
||||
const list = Array.isArray(script) ? script : script.steps;
|
||||
if (!Array.isArray(script)) for (const k of ['size', 'platform', 'theme', 'q', 'params']) if (script[k] && !opts[k]) opts[k] = script[k];
|
||||
if (!Array.isArray(script)) for (const k of ['size', 'theme', 'q', 'params']) if (script[k] && !opts[k]) opts[k] = script[k];
|
||||
steps = [...list, ...cliSteps];
|
||||
}
|
||||
// The default size applies only when neither the command line nor the script sets one.
|
||||
@@ -74,7 +74,7 @@ const save = async (path, data) => { await writeFile(path, data); report.files.p
|
||||
|
||||
function routeUrl(step, base) {
|
||||
const route = step.open;
|
||||
const params = { platform: step.platform ?? opts.platform, theme: step.theme ?? opts.theme, q: step.q ?? opts.q };
|
||||
const params = { theme: step.theme ?? opts.theme, q: step.q ?? opts.q };
|
||||
let url;
|
||||
if (/^https?:/.test(route)) url = new URL(route);
|
||||
else if (probe) { url = new URL('/', base); url.searchParams.set('route', route); }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"size": "560x1000",
|
||||
"platform": "material",
|
||||
"theme": "dark",
|
||||
"params": "chats=4&colors=1&header=1&rich=1",
|
||||
"steps": [
|
||||
|
||||
@@ -35,7 +35,7 @@ Map<String, String> fixtureParams() {
|
||||
void installHostProbes(Map<String, String> params) {}
|
||||
|
||||
/// The route goes through [fixtureRouteProvider] instead.
|
||||
void openFixtureRoute(String route, {required bool cupertino}) {}
|
||||
void openFixtureRoute(String route) {}
|
||||
|
||||
/// An explicit loopback endpoint; nothing connects to it but artifact fetches.
|
||||
ServerEndpoint fixtureServer(Map<String, String> params) =>
|
||||
|
||||
@@ -17,13 +17,11 @@ void installHostProbes(Map<String, String> params) {
|
||||
}
|
||||
|
||||
/// Moves the browser to [route] before the app reads its location.
|
||||
void openFixtureRoute(String route, {required bool cupertino}) {
|
||||
final platform = cupertino ? 'platform=cupertino' : '';
|
||||
final joiner = route.contains('?') ? '&' : '?';
|
||||
void openFixtureRoute(String route) {
|
||||
web.window.history.replaceState(
|
||||
null,
|
||||
'',
|
||||
platform.isEmpty ? route : '$route$joiner$platform',
|
||||
route,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +1,34 @@
|
||||
// Web-only fixture entrypoint for rendered search evidence. It is not part of
|
||||
// the application's `main.dart`; build it explicitly with:
|
||||
// flutter build web -t tool/search_fixture/main.dart
|
||||
// `?cupertino=1` renders the same screen inside a CupertinoApp.
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/search/search_screen.dart';
|
||||
|
||||
void main() {
|
||||
final cupertino = Uri.base.queryParameters['cupertino'] == '1';
|
||||
runApp(
|
||||
cupertino
|
||||
? const CupertinoApp(
|
||||
title: 'Search fixture',
|
||||
home: _FixtureHost(cupertino: true),
|
||||
)
|
||||
: const MaterialApp(
|
||||
title: 'Search fixture',
|
||||
home: _FixtureHost(cupertino: false),
|
||||
),
|
||||
);
|
||||
runApp(const MaterialApp(title: 'Search fixture', home: _FixtureHost()));
|
||||
}
|
||||
|
||||
class _FixtureHost extends StatelessWidget {
|
||||
const _FixtureHost({required this.cupertino});
|
||||
|
||||
final bool cupertino;
|
||||
const _FixtureHost();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SearchScreen(
|
||||
gateway: const _FixtureGateway(),
|
||||
cupertino: cupertino,
|
||||
onOpen: (hit) {
|
||||
final route = cupertino
|
||||
? CupertinoPageRoute<void>(
|
||||
builder: (_) => _Opened(hit: hit, cupertino: true),
|
||||
)
|
||||
: MaterialPageRoute<void>(
|
||||
builder: (_) => _Opened(hit: hit, cupertino: false),
|
||||
);
|
||||
Navigator.of(context).push(route);
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(builder: (_) => _Opened(hit: hit)),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class _Opened extends StatelessWidget {
|
||||
const _Opened({required this.hit, required this.cupertino});
|
||||
const _Opened({required this.hit});
|
||||
|
||||
final JsonMap hit;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -63,12 +41,6 @@ class _Opened extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
);
|
||||
if (cupertino) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Opened')),
|
||||
child: body,
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Opened')),
|
||||
body: body,
|
||||
|
||||
@@ -779,8 +779,6 @@ class _FixtureSink implements WebSocketSink {
|
||||
/// `?html=1` adds an HTML artifact to run 7 (`release-dashboard.html`);
|
||||
/// `?turn=1` adds run 7's debug turn files (input/memory/history/output.md);
|
||||
/// `?q=release` types that query into Search once its field is shown;
|
||||
/// `?platform=cupertino` renders the Cupertino host (`material`, the
|
||||
/// default, renders Material as browsers do);
|
||||
/// `?perf=1` prints frame timings (tool/perf/frame_log.dart);
|
||||
/// `?hits=N`, `?chats=N` and `?graph=1` add bench data
|
||||
/// (tool/perf/perf_fixture.dart);
|
||||
@@ -827,10 +825,9 @@ Future<void> main() async {
|
||||
_htmlArtifact = params['html'] == '1';
|
||||
_warnings = params['warnings'] == '1';
|
||||
_turnFiles = params['turn'] == '1';
|
||||
final cupertino = params['platform'] == 'cupertino';
|
||||
final route = params['route'];
|
||||
final opensRoute = route != null && route.startsWith('/');
|
||||
if (opensRoute) openFixtureRoute(route, cupertino: cupertino);
|
||||
if (opensRoute) openFixtureRoute(route);
|
||||
final query = params['q'];
|
||||
if (query != null && query.isNotEmpty) _typeSearchWhenShown(query);
|
||||
useAppUrlStrategy();
|
||||
@@ -896,7 +893,6 @@ Future<void> main() async {
|
||||
sourceName: 'Home Linux',
|
||||
),
|
||||
client: PipelinesClient(channelFactory: (_) => _FixtureChannel()),
|
||||
cupertino: cupertino,
|
||||
routeInformationProvider: fixtureRouteProvider(opensRoute ? route : null),
|
||||
windows: probeWindows(params),
|
||||
);
|
||||
@@ -914,9 +910,8 @@ Future<void> main() async {
|
||||
}
|
||||
|
||||
/// Pins the platform brightness below it. The app's own `MediaQuery.fromView`
|
||||
/// takes platform fields from this ambient query, so `ThemeMode.system` (and
|
||||
/// the Cupertino theme's null brightness) resolve to [brightness] while size,
|
||||
/// padding and text scale still follow the real view.
|
||||
/// takes platform fields from this ambient query, so `ThemeMode.system` resolves
|
||||
/// to [brightness] while size, padding and text scale still follow the real view.
|
||||
class _PinnedBrightness extends StatelessWidget {
|
||||
const _PinnedBrightness({required this.brightness, required this.child});
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:js_interop';
|
||||
import 'dart:js_interop_unsafe';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pipelines_app/core/servers/server_catalog.dart';
|
||||
import 'package:pipelines_app/core/servers/server_catalog_store.dart';
|
||||
@@ -11,7 +10,6 @@ import 'package:pipelines_app/features/settings/server_connections.dart';
|
||||
// Isolated, in-memory browser fixture: first write fails, retry succeeds.
|
||||
// No sockets, real storage, or production requests.
|
||||
void main() {
|
||||
final cupertino = Uri.base.queryParameters['host'] == 'cupertino';
|
||||
final connections = ServerConnections(
|
||||
store: _Store(),
|
||||
onSelected: (_) async {},
|
||||
@@ -21,11 +19,7 @@ void main() {
|
||||
child: SavedServersSection(connections: connections),
|
||||
),
|
||||
);
|
||||
runApp(
|
||||
cupertino
|
||||
? CupertinoApp(home: CupertinoPageScaffold(child: body))
|
||||
: MaterialApp(home: Scaffold(body: body)),
|
||||
);
|
||||
runApp(MaterialApp(home: Scaffold(body: body)));
|
||||
}
|
||||
|
||||
class _Store extends MemoryServerCatalogStore {
|
||||
|
||||
Reference in New Issue
Block a user