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.
135 lines
3.6 KiB
Dart
135 lines
3.6 KiB
Dart
// Standalone browser fixture for the floating glass tab bar in the shell.
|
|
//
|
|
// Build and capture (from app/):
|
|
// flutter build web --target tool/floating_tabs_probe_entry.dart \
|
|
// -o build/probe-floating-tabs
|
|
// python3 -I -m http.server 0 --bind 127.0.0.1 \
|
|
// --directory build/probe-floating-tabs
|
|
// Chrome --headless=new --window-size=W,H --screenshot=OUT \
|
|
// 'http://127.0.0.1:PORT/?theme=dark'
|
|
//
|
|
// Query: theme=dark, tab=runs|chat|...
|
|
// 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.
|
|
import 'package:flutter/material.dart';
|
|
import 'package:pipelines_app/shell/adaptive_shell.dart';
|
|
import 'package:pipelines_app/shell/destination.dart';
|
|
import 'package:pipelines_app/shell/shell_bar.dart';
|
|
|
|
void main() {
|
|
final params = Uri.base.queryParameters;
|
|
final dark = params['theme'] == 'dark';
|
|
final tab = AppDestination.values.firstWhere(
|
|
(value) => value.name == params['tab'],
|
|
orElse: () => AppDestination.pipelines,
|
|
);
|
|
final end = params['end'] == '1';
|
|
runApp(_Probe(dark: dark, tab: tab, end: end));
|
|
}
|
|
|
|
class _Probe extends StatelessWidget {
|
|
const _Probe({
|
|
required this.dark,
|
|
required this.tab,
|
|
required this.end,
|
|
});
|
|
|
|
final bool dark;
|
|
final AppDestination tab;
|
|
|
|
/// Starts every list scrolled to its end, to show the last row at rest.
|
|
final bool end;
|
|
|
|
Widget _list(String noun, {required int count}) =>
|
|
_ProbeList(noun: noun, count: count, end: end);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final shell = AdaptiveShell(
|
|
destination: tab,
|
|
attentionCount: 3,
|
|
destinationBodies: {
|
|
AppDestination.pipelines: (_) => _list('Pipeline', count: 40),
|
|
AppDestination.runs: (_) => ShellBadge(
|
|
kind: ShellBadgeKind.running,
|
|
count: 2,
|
|
child: _list('Run', count: 40),
|
|
),
|
|
AppDestination.chat: (_) => ShellBadge(
|
|
kind: ShellBadgeKind.unread,
|
|
count: 1,
|
|
child: _list('Chat', count: 12),
|
|
),
|
|
},
|
|
);
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
brightness: dark ? Brightness.dark : Brightness.light,
|
|
colorSchemeSeed: Colors.indigo,
|
|
),
|
|
home: shell,
|
|
);
|
|
}
|
|
}
|
|
|
|
class _ProbeList extends StatefulWidget {
|
|
const _ProbeList({
|
|
required this.noun,
|
|
required this.count,
|
|
required this.end,
|
|
});
|
|
|
|
final String noun;
|
|
final int count;
|
|
final bool end;
|
|
|
|
@override
|
|
State<_ProbeList> createState() => _ProbeListState();
|
|
}
|
|
|
|
class _ProbeListState extends State<_ProbeList> {
|
|
final _scroll = ScrollController();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
if (widget.end) {
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
if (_scroll.hasClients) {
|
|
_scroll.jumpTo(_scroll.position.maxScrollExtent);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_scroll.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// No explicit padding: the list pads itself by the media insets, which
|
|
// include the floating bar's height.
|
|
return ListView.builder(
|
|
controller: _scroll,
|
|
itemCount: widget.count,
|
|
itemBuilder: (context, index) {
|
|
final title = '${widget.noun} ${index + 1}';
|
|
final subtitle = index.isEven
|
|
? 'Succeeded · 2m 05s'
|
|
: 'Running · started 1m ago';
|
|
return ListTile(
|
|
leading: Icon(
|
|
index.isEven ? Icons.check_circle_outline : Icons.timelapse,
|
|
),
|
|
title: Text(title),
|
|
subtitle: Text(subtitle),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|