Remove Cupertino branches from probe fixtures

Keep the chat and graph fixtures aligned with the app's Material-only UI by removing alternate Cupertino hosts, imports, and query-controlled rendering paths. Preserve the existing Material scenarios and document the focused probe coverage.
This commit is contained in:
2026-11-11 20:08:06 +00:00
parent 3f05421e8b
commit 13a5e1dee0
16 changed files with 44 additions and 285 deletions
+7
View File
@@ -0,0 +1,7 @@
# Material chat and graph probes
- Removed Cupertino imports, host branches, and local style flags from the assigned chat and graph/stage-definition Dart probes.
- Preserved Material scaffolds, dark/light themes, text scaling, fixture data, callbacks, and browser interaction states.
- Focused watchdog tests: 39 passed across graph widgets and chat thread/composer coverage.
- `tool/analyze.sh`: clean, 0 errors, 0 warnings.
- Node syntax checks passed for the corresponding probe drivers. No browser capture was run; this cleanup does not alter intended Material rendering.
+4 -12
View File
@@ -1,10 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_turn_activity_view.dart';
const _style = String.fromEnvironment('PROBE_STYLE', defaultValue: 'material');
/// Visual check for the streaming activity line: the pending dots beside
/// "Responding Ns" at a few text sizes, in light and dark.
void main() {
@@ -23,14 +20,9 @@ void main() {
);
final body = ListView(children: [line(1), line(1.5), line(2)]);
runApp(
_style == 'cupertino'
? CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(child: SafeArea(child: body)),
)
: MaterialApp(
theme: ThemeData(brightness: Brightness.dark),
home: Scaffold(body: SafeArea(child: body)),
),
MaterialApp(
theme: ThemeData(brightness: Brightness.dark),
home: Scaffold(body: SafeArea(child: body)),
),
);
}
-15
View File
@@ -1,6 +1,5 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -130,11 +129,6 @@ class _ApprovalsGateway implements ApiGateway {
};
}
const _style = String.fromEnvironment(
'CHAT_APPROVALS_PROBE_STYLE',
defaultValue: 'material',
);
void main() {
final gateway = _ApprovalsGateway();
final thread = ChatThreadView(
@@ -143,15 +137,6 @@ void main() {
title: 'Probe conversation',
onBack: () {},
);
if (_style == 'cupertino') {
runApp(
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(child: SafeArea(child: thread)),
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
+2 -21
View File
@@ -1,6 +1,5 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -203,12 +202,7 @@ Widget _framed(Widget child) => _probeWidth == 0
child: SizedBox(width: _probeWidth.toDouble(), child: child),
);
const _probeStyle = String.fromEnvironment(
'CHAT_COMPOSER_PROBE_STYLE',
defaultValue: 'material',
);
/// Browser overrides: `?platform=cupertino|material`, `?theme=dark|light`,
/// Browser overrides: `?theme=dark|light`,
/// `?long=1`, `?paras=1` (a chunked multi-paragraph reply), `?tasks=<n>`, `?mode=0` (no permission mode recorded) and
/// `?model=0` (a backend without models). `?perf=<n>` and `?stream=<n>` are
/// the long-transcript performance fixture (see chat_perf_fixture.dart).
@@ -222,8 +216,7 @@ int get _probeTasks => int.tryParse(_query['tasks'] ?? '') ?? 0;
void main() {
final gateway = _ProbeGateway();
final cupertino = (_query['platform'] ?? _probeStyle) == 'cupertino';
final dark = _query['theme'] == null ? cupertino : _query['theme'] == 'dark';
final dark = _query['theme'] == 'dark';
final thread = ChatThreadView(
gateway: gateway,
sessionId: 'probe-composer',
@@ -262,17 +255,6 @@ void main() {
() => _press('chat-composer-primary'),
);
}
if (cupertino) {
runApp(
CupertinoApp(
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
home: CupertinoPageScaffold(child: _framed(SafeArea(child: thread))),
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
@@ -290,7 +272,6 @@ void _press(String key) {
void visit(Element element) {
final widget = element.widget;
if (widget.key == Key(key)) {
if (widget is CupertinoButton) widget.onPressed?.call();
if (widget is ButtonStyleButton) widget.onPressed?.call();
if (widget is IconButton) widget.onPressed?.call();
return;
+1 -16
View File
@@ -1,13 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_markdown_view.dart';
const _style = String.fromEnvironment(
'CHAT_MARKDOWN_PROBE_STYLE',
defaultValue: 'material',
);
const _sample = '''
# Heading one
## Heading two
@@ -36,21 +30,12 @@ Bare https://example.com/auto link.
<b>literal html</b> and ~~strikethrough~~ stay text.
''';
/// One assistant markdown sample for the Material and Cupertino dark captures.
/// One assistant markdown sample for a Material dark capture.
void main() {
final content = ListView(
padding: const EdgeInsets.all(16),
children: const [ChatMarkdownView(text: _sample)],
);
if (_style == 'cupertino') {
runApp(
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(child: SafeArea(child: content)),
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
+1 -19
View File
@@ -1,6 +1,5 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -10,7 +9,7 @@ import 'package:pipelines_app/features/chat/screen.dart';
/// the real thread render one server-shaped conversation whose assistant text
/// is formatted markdown and whose user text must stay byte-exact.
///
/// Material and Cupertino hosts are the same fixture built with
/// The Material host is the same fixture built with
/// `CHAT_MARKDOWN_WIRE_PROBE_STYLE`.
class _FixtureGateway implements ApiGateway {
final _frames = StreamController<JsonMap>.broadcast();
@@ -86,28 +85,11 @@ const String _answer =
'\n'
'Literal <b>markup</b> and [unsafe](javascript:alert) stay visible.';
const _style = String.fromEnvironment(
'CHAT_MARKDOWN_WIRE_PROBE_STYLE',
defaultValue: 'material',
);
void main() {
final screen = ChatScreen(
gateway: _FixtureGateway(),
onSessionSelected: null,
);
if (_style == 'cupertino') {
runApp(
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Chat')),
child: SafeArea(child: screen),
),
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
-15
View File
@@ -1,16 +1,10 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/features/chat/domain/chat_transcript.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_message_view.dart';
const _style = String.fromEnvironment(
'CHAT_MESSAGE_PROBE_STYLE',
defaultValue: 'material',
);
/// Visible fixture for one user row, one folded assistant turn and one live
/// turn whose newest reasoning step grows every half second. The unknown part
/// and the tool body start collapsed so the browser probe has to open them.
@@ -61,15 +55,6 @@ void main() {
},
]);
final content = _LiveTranscript(rows: rows);
if (_style == 'cupertino') {
runApp(
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(child: SafeArea(child: content)),
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
-19
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -124,11 +123,6 @@ class _FixtureGateway implements ApiGateway {
}
}
const _probeStyle = String.fromEnvironment(
'CHAT_PROBE_STYLE',
defaultValue: 'material',
);
void main() {
final dark = Uri.base.queryParameters['dark'] == '1';
final unseen = Uri.base.queryParameters['unseen'] == '1';
@@ -145,19 +139,6 @@ void main() {
]);
}
final home = ChatSessionsScreen(gateway: gateway, onOpen: (_) {});
// `?platform=cupertino` overrides the compile-time style.
final style = Uri.base.queryParameters['platform'] ?? _probeStyle;
if (style == 'cupertino') {
runApp(
CupertinoApp(
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
home: home,
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
-18
View File
@@ -1,6 +1,5 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -218,28 +217,11 @@ class _FixtureGateway implements ApiGateway {
};
}
const _style = String.fromEnvironment(
'CHAT_WIRE_PROBE_STYLE',
defaultValue: 'material',
);
void main() {
final screen = ChatScreen(
gateway: _FixtureGateway(),
onSessionSelected: null,
);
if (_style == 'cupertino') {
runApp(
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Chat')),
child: SafeArea(child: screen),
),
),
);
return;
}
runApp(
MaterialApp(
theme: ThemeData(
+3 -17
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -36,35 +35,22 @@ JsonMap _definition() => <String, dynamic>{
/// Isolated browser fixture for `DefinitionGraphView` only.
///
/// Not wired into the app or shell. `style=cupertino` selects the native
/// Cupertino host, `scale=2` applies a real 2x text scale to the graph viewport,
/// Not wired into the app or shell. `scale=2` applies a real 2x text scale to the graph viewport,
/// and a click reports the exact stage key in the status line.
void main() {
final parameters = Uri.base.queryParameters;
final cupertino = parameters['style'] == 'cupertino';
final scale = double.tryParse(parameters['scale'] ?? '') ?? 1;
runApp(_ProbeApp(cupertino: cupertino, scale: scale));
runApp(_ProbeApp(scale: scale));
}
class _ProbeApp extends StatelessWidget {
const _ProbeApp({required this.cupertino, required this.scale});
const _ProbeApp({required this.scale});
final bool cupertino;
final double scale;
@override
Widget build(BuildContext context) {
final page = _ProbePage(scale: scale);
if (cupertino) {
return CupertinoApp(
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Definition graph'),
),
child: SafeArea(child: page),
),
);
}
return MaterialApp(
theme: ThemeData(platform: TargetPlatform.android),
darkTheme: ThemeData(
+13 -21
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/features/graph/domain/graph_definition.dart';
@@ -22,9 +21,7 @@ const _nodes = [
/// A fixture-only page: one measured node per definition identity, with the
/// selected key reported so a browser click can prove the exact callback.
class _Probe extends StatefulWidget {
const _Probe({required this.cupertino});
final bool cupertino;
const _Probe();
@override
State<_Probe> createState() => _ProbeState();
@@ -64,27 +61,22 @@ class _ProbeState extends State<_Probe> {
),
],
);
return widget.cupertino
? CupertinoPageScaffold(child: SafeArea(child: page))
: Scaffold(body: SafeArea(child: page));
return Scaffold(body: SafeArea(child: page));
}
}
void main() {
final cupertino = Uri.base.queryParameters['style'] == 'cupertino';
runApp(
cupertino
? CupertinoApp(home: const _Probe(cupertino: true))
: MaterialApp(
theme: ThemeData(platform: TargetPlatform.android),
// Stock dark theme so the forced `prefers-color-scheme` capture is
// a real dark render rather than a duplicate light one.
darkTheme: ThemeData(
platform: TargetPlatform.android,
brightness: Brightness.dark,
),
themeMode: ThemeMode.system,
home: const _Probe(cupertino: false),
),
MaterialApp(
theme: ThemeData(platform: TargetPlatform.android),
// Stock dark theme so the forced `prefers-color-scheme` capture is
// a real dark render rather than a duplicate light one.
darkTheme: ThemeData(
platform: TargetPlatform.android,
brightness: Brightness.dark,
),
themeMode: ThemeMode.system,
home: const _Probe(),
),
);
}
+1 -19
View File
@@ -6,7 +6,6 @@
// PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR node tool/graph_zoom_probe.mjs
//
// Server-shaped fixtures only; no server, run or operator session is touched.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -72,37 +71,20 @@ void main() {
runApp(
_ProbeApp(
runMode: parameters['view'] == 'run',
cupertino: parameters['style'] == 'cupertino',
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
),
);
}
class _ProbeApp extends StatelessWidget {
const _ProbeApp({
required this.runMode,
required this.cupertino,
required this.scale,
});
const _ProbeApp({required this.runMode, required this.scale});
final bool runMode;
final bool cupertino;
final double scale;
@override
Widget build(BuildContext context) {
final page = _ProbePage(runMode: runMode, scale: scale);
if (cupertino) {
return CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Graph viewport'),
),
child: SafeArea(child: page),
),
);
}
return MaterialApp(
theme: ThemeData(platform: TargetPlatform.android),
darkTheme: ThemeData(
+2 -24
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/features/pipelines/screen.dart';
@@ -7,15 +6,13 @@ import 'pipelines_probe_fixture.dart';
/// Browser fixture for the pipeline detail's real Graph tab.
///
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and
/// `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and
/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and
/// definition pane are the same widgets the app registers; only the replies
/// come from the in-memory fixture.
void main() {
final parameters = Uri.base.queryParameters;
runApp(
_PipelineGraphTabProbe(
cupertino: parameters['style'] == 'cupertino',
dark: parameters['dark'] == '1',
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
),
@@ -23,13 +20,8 @@ void main() {
}
class _PipelineGraphTabProbe extends StatelessWidget {
const _PipelineGraphTabProbe({
required this.cupertino,
required this.dark,
required this.scale,
});
const _PipelineGraphTabProbe({required this.dark, required this.scale});
final bool cupertino;
final bool dark;
final double scale;
@@ -45,20 +37,6 @@ class _PipelineGraphTabProbe extends StatelessWidget {
gateway: PipelinesProbeGateway(),
embedded: true,
);
if (cupertino) {
return CupertinoApp(
title: 'Pipeline graph fixture',
debugShowCheckedModeBanner: false,
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
builder: scaled,
// The application shell owns the navigation bar; the probe keeps the
// same embedded screen inside a host-native page instead of adding a
// second bar that would overlay the detail header.
home: CupertinoPageScaffold(child: SafeArea(child: screen)),
);
}
return MaterialApp(
title: 'Pipeline graph fixture',
debugShowCheckedModeBanner: false,
+1 -14
View File
@@ -9,7 +9,6 @@
// Server-shaped fixtures only: a fake gateway answers the same get_run envelope
// the app consumes. The run's own pinned graph and recorded steps drive the
// Graph tab; no server or operator run is touched.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
@@ -83,22 +82,18 @@ JsonMap _run({required bool graph}) => <String, dynamic>{
void main() {
final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
final dark = params['theme'] == 'dark';
final scale = double.tryParse(params['scale'] ?? '') ?? 1;
final run = _run(graph: params['case'] != 'missing');
runApp(_ProbeBody(cupertino: cupertino, dark: dark, scale: scale, run: run));
runApp(_ProbeBody(dark: dark, scale: scale, run: run));
}
class _ProbeBody extends StatefulWidget {
const _ProbeBody({
required this.cupertino,
required this.dark,
required this.scale,
required this.run,
});
final bool cupertino;
final bool dark;
final double scale;
final JsonMap run;
@@ -139,14 +134,6 @@ class _ProbeBodyState extends State<_ProbeBody> {
).copyWith(textScaler: TextScaler.linear(widget.scale)),
child: app!,
);
if (widget.cupertino) {
return CupertinoApp(
title: 'Run graph fixture',
theme: CupertinoThemeData(brightness: theme),
builder: scaled,
home: CupertinoPageScaffold(child: SafeArea(child: detail)),
);
}
return MaterialApp(
title: 'Run graph fixture',
theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
+2 -20
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -86,15 +85,14 @@ JsonMap _finishedRun() => <String, dynamic>{
/// Isolated browser fixture for `RunGraphView` only.
///
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and
/// `scale=2` a real 2x text scale. `case=finished` records a resolved success
/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale.
/// `case=finished` records a resolved success
/// terminal instead of the running path; `case=missing` omits the graph. A
/// click reports the exact visited stage key; unvisited nodes report nothing.
void main() {
final parameters = Uri.base.queryParameters;
runApp(
_ProbeApp(
cupertino: parameters['style'] == 'cupertino',
dark: parameters['dark'] == '1',
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
fixture: parameters['case'] ?? 'running',
@@ -104,13 +102,10 @@ void main() {
class _ProbeApp extends StatelessWidget {
const _ProbeApp({
required this.cupertino,
required this.dark,
required this.scale,
required this.fixture,
});
final bool cupertino;
final bool dark;
final double scale;
final String fixture;
@@ -122,19 +117,6 @@ class _ProbeApp extends StatelessWidget {
graph: fixture == 'missing' ? null : _graph(),
run: fixture == 'finished' ? _finishedRun() : _runningRun(),
);
if (cupertino) {
return CupertinoApp(
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Run graph'),
),
child: SafeArea(child: page),
),
);
}
return MaterialApp(
theme: ThemeData(
platform: TargetPlatform.android,
+7 -35
View File
@@ -1,9 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart';
import 'package:pipelines_app/ui/adaptive/host.dart';
/// A definition with an authored stage (including an unknown future field), a
/// declared route to a terminal, and no declaration for `ghost`.
@@ -44,14 +42,13 @@ JsonMap _graph() => <String, dynamic>{
/// Isolated browser fixture for the read-only stage definition pane.
///
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme,
/// `scale=2` a real 2x text scale. Every button opens the exact helper the
/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale.
/// Every button opens the exact helper the
/// pipeline graph hook will call; nothing contacts a server or reads a run.
void main() {
final parameters = Uri.base.queryParameters;
runApp(
_ProbeApp(
cupertino: parameters['style'] == 'cupertino',
dark: parameters['dark'] == '1',
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
),
@@ -59,13 +56,8 @@ void main() {
}
class _ProbeApp extends StatelessWidget {
const _ProbeApp({
required this.cupertino,
required this.dark,
required this.scale,
});
const _ProbeApp({required this.dark, required this.scale});
final bool cupertino;
final bool dark;
final double scale;
@@ -77,20 +69,6 @@ class _ProbeApp extends StatelessWidget {
).copyWith(textScaler: TextScaler.linear(scale)),
child: child ?? const SizedBox.shrink(),
);
if (cupertino) {
return CupertinoApp(
theme: CupertinoThemeData(
brightness: dark ? Brightness.dark : Brightness.light,
),
builder: scaled,
home: const CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Stage definition fixture'),
),
child: SafeArea(child: _Launcher()),
),
);
}
return MaterialApp(
theme: ThemeData(
platform: TargetPlatform.android,
@@ -124,7 +102,6 @@ class _Launcher extends StatelessWidget {
@override
Widget build(BuildContext context) {
final cupertino = usesCupertinoHost(context);
return ListView(
padding: const EdgeInsets.all(16),
children: [
@@ -132,15 +109,10 @@ class _Launcher extends StatelessWidget {
for (final key in <String>['plan', '#failure', 'ghost'])
Padding(
padding: const EdgeInsets.only(top: 8),
child: cupertino
? CupertinoButton.filled(
onPressed: () => _open(context, key),
child: Text('$key definition'),
)
: FilledButton(
onPressed: () => _open(context, key),
child: Text('$key definition'),
),
child: FilledButton(
onPressed: () => _open(context, key),
child: Text('$key definition'),
),
),
],
);