b60ad6d98f
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.
69 lines
2.3 KiB
Dart
69 lines
2.3 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
|
import 'package:pipelines_app/features/settings/settings.dart';
|
|
|
|
/// A fixture entry point for browser captures of the Settings screen. It does
|
|
/// not change `main.dart` or the shell, and it never uses the production
|
|
/// preferences store: all persisted values live in a [MemorySettingsStore].
|
|
///
|
|
/// Query parameters:
|
|
/// endpoint=ws://127.0.0.1:PORT/connect seed the URL field / connect target
|
|
/// workspace=/srv/pipelines seed the saved workspace
|
|
/// connect=1 explicitly connect after first frame
|
|
/// theme=dark dark Material theme
|
|
/// scale=1.5 large-text check
|
|
void main() {
|
|
final params = Uri.base.queryParameters;
|
|
final endpoint = params['endpoint']?.trim();
|
|
final client = PipelinesClient();
|
|
final store = MemorySettingsStore(
|
|
workspace: params['workspace']?.trim() ?? '',
|
|
);
|
|
final isDark = params['theme'] == 'dark';
|
|
final scale = double.tryParse(params['scale'] ?? '') ?? 1;
|
|
|
|
runApp(
|
|
MaterialApp(
|
|
title: 'Pipelines Settings probe',
|
|
theme: ThemeData(
|
|
brightness: isDark ? Brightness.dark : Brightness.light,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: Colors.blue,
|
|
brightness: isDark ? Brightness.dark : Brightness.light,
|
|
),
|
|
),
|
|
builder: (context, child) => MediaQuery(
|
|
data: MediaQuery.of(
|
|
context,
|
|
).copyWith(textScaler: TextScaler.linear(scale)),
|
|
child: child ?? const SizedBox.shrink(),
|
|
),
|
|
home: SettingsScreen(
|
|
client: client,
|
|
initialEndpoint: (endpoint == null || endpoint.isEmpty)
|
|
? null
|
|
: Uri.tryParse(endpoint),
|
|
store: store,
|
|
),
|
|
),
|
|
);
|
|
|
|
if (params['connect'] == '1') {
|
|
final target = (endpoint == null || endpoint.isEmpty)
|
|
? defaultServerUrl()
|
|
: endpoint;
|
|
if (target.isNotEmpty) {
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
unawaited(
|
|
client.connect(Uri.parse(target)).catchError((Object _) {
|
|
// The screen renders the client's truthful state; an invalid
|
|
// fixture endpoint must not take the probe down.
|
|
}),
|
|
);
|
|
});
|
|
}
|
|
}
|
|
}
|