From 69ae0519bd0b3df65b834f537f360a9faa2411e0 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:10:51 +0000 Subject: [PATCH] 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. --- app/notes/material-fixtures-cleanup.md | 34 ++++++++++++++++ app/tool/artifact_list_probe.dart | 19 +-------- app/tool/capture/README.md | 10 ++--- app/tool/capture/capture.mjs | 6 +-- .../examples/settings-animation-library.json | 1 - .../fixture_host/fixture_host_native.dart | 2 +- app/tool/fixture_host/fixture_host_web.dart | 6 +-- app/tool/search_fixture/main.dart | 40 +++---------------- app/tool/search_selection_probe_entry.dart | 11 ++--- app/tool/server_editor_save_probe.dart | 8 +--- 10 files changed, 57 insertions(+), 80 deletions(-) create mode 100644 app/notes/material-fixtures-cleanup.md diff --git a/app/notes/material-fixtures-cleanup.md b/app/notes/material-fixtures-cleanup.md new file mode 100644 index 00000000..315127fd --- /dev/null +++ b/app/notes/material-fixtures-cleanup.md @@ -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`. diff --git a/app/tool/artifact_list_probe.dart b/app/tool/artifact_list_probe.dart index aecd9775..207293fb 100644 --- a/app/tool/artifact_list_probe.dart +++ b/app/tool/artifact_list_probe.dart @@ -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 _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, diff --git a/app/tool/capture/README.md b/app/tool/capture/README.md index 8d1fe49e..a701b2e8 100644 --- a/app/tool/capture/README.md +++ b/app/tool/capture/README.md @@ -29,8 +29,8 @@ change, from `app/`: ``` URL parameters (the kit sets them from `open=` and the options): -`route=`, `q=`, `platform=material|cupertino`, -`theme=light|dark`; `--params` (or a step's or script's `params`) adds fixture +`route=`, `q=`, `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 diff --git a/app/tool/capture/capture.mjs b/app/tool/capture/capture.mjs index 2955dccc..4624e305 100644 --- a/app/tool/capture/capture.mjs +++ b/app/tool/capture/capture.mjs @@ -16,7 +16,7 @@ import { contactSheet, pickFrames } from './sheet.mjs'; import { describe, flutterPage, parseTarget } from './page.mjs'; const USAGE = `usage: capture.mjs (--build | --url ) --out [options] [steps...] -options: --script --size WxH (880x1000) --platform material|cupertino +options: --script --size WxH (880x1000) --theme light|dark --q --wait --film-ms --cdp http://127.0.0.1: --probe true|false --params @@ -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); } diff --git a/app/tool/capture/examples/settings-animation-library.json b/app/tool/capture/examples/settings-animation-library.json index 854ed8dd..ef5611df 100644 --- a/app/tool/capture/examples/settings-animation-library.json +++ b/app/tool/capture/examples/settings-animation-library.json @@ -1,6 +1,5 @@ { "size": "560x1000", - "platform": "material", "theme": "dark", "params": "chats=4&colors=1&header=1&rich=1", "steps": [ diff --git a/app/tool/fixture_host/fixture_host_native.dart b/app/tool/fixture_host/fixture_host_native.dart index 40ea7a27..5fa945ea 100644 --- a/app/tool/fixture_host/fixture_host_native.dart +++ b/app/tool/fixture_host/fixture_host_native.dart @@ -35,7 +35,7 @@ Map fixtureParams() { void installHostProbes(Map 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 params) => diff --git a/app/tool/fixture_host/fixture_host_web.dart b/app/tool/fixture_host/fixture_host_web.dart index 7388264f..0d5ba3aa 100644 --- a/app/tool/fixture_host/fixture_host_web.dart +++ b/app/tool/fixture_host/fixture_host_web.dart @@ -17,13 +17,11 @@ void installHostProbes(Map 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, ); } diff --git a/app/tool/search_fixture/main.dart b/app/tool/search_fixture/main.dart index 9a1b344f..cf6dc946 100644 --- a/app/tool/search_fixture/main.dart +++ b/app/tool/search_fixture/main.dart @@ -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( - builder: (_) => _Opened(hit: hit, cupertino: true), - ) - : MaterialPageRoute( - builder: (_) => _Opened(hit: hit, cupertino: false), - ); - Navigator.of(context).push(route); + Navigator.of(context).push( + MaterialPageRoute(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, diff --git a/app/tool/search_selection_probe_entry.dart b/app/tool/search_selection_probe_entry.dart index 304ceb76..cd48cbe4 100644 --- a/app/tool/search_selection_probe_entry.dart +++ b/app/tool/search_selection_probe_entry.dart @@ -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 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 main() async { sourceName: 'Home Linux', ), client: PipelinesClient(channelFactory: (_) => _FixtureChannel()), - cupertino: cupertino, routeInformationProvider: fixtureRouteProvider(opensRoute ? route : null), windows: probeWindows(params), ); @@ -914,9 +910,8 @@ Future 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}); diff --git a/app/tool/server_editor_save_probe.dart b/app/tool/server_editor_save_probe.dart index ec53934c..92896454 100644 --- a/app/tool/server_editor_save_probe.dart +++ b/app/tool/server_editor_save_probe.dart @@ -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 {