8476cfd740
Register the landed PipelinesScreen at /pipelines through AppSession, with an honest first-connection gate, a native reconnect banner that retains the open list and detail, and an in-place refresh on reconnect. Move the shared connection chrome out of RunsDestination so both destinations use one implementation and one wording. Add destination, registration and reconnect coverage plus an isolated loopback Chrome probe that drives the real runPipelinesApp() composition.
62 lines
1.8 KiB
Dart
62 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../features/pipelines/screen.dart';
|
|
import '../ui/adaptive/host.dart';
|
|
import 'app_session.dart';
|
|
import 'connection_status.dart';
|
|
import 'server_endpoint.dart';
|
|
|
|
/// The Pipelines destination: the read-only browser plus honest status.
|
|
///
|
|
/// Before the shared socket accepts its first connection nothing is requested,
|
|
/// so an offline launch cannot look like an empty pipeline list. After that the
|
|
/// browser stays mounted through drops; a reconnect advances [syncToken] so the
|
|
/// list and the open detail refresh in place instead of losing the selection.
|
|
class PipelinesDestination extends StatelessWidget {
|
|
const PipelinesDestination({
|
|
super.key,
|
|
required this.session,
|
|
required this.server,
|
|
});
|
|
|
|
final AppSession session;
|
|
final ServerEndpoint server;
|
|
|
|
@override
|
|
Widget build(BuildContext context) => AnimatedBuilder(
|
|
animation: session,
|
|
builder: (context, _) {
|
|
final cupertino = usesCupertinoHost(context);
|
|
if ((server.requiresConfiguration || server.error != null) &&
|
|
session.endpoint == null) {
|
|
return ConnectionGate(
|
|
session: session,
|
|
server: server,
|
|
cupertino: cupertino,
|
|
);
|
|
}
|
|
if (!session.everConnected) {
|
|
if (session.connected) return _pipelinesScreen();
|
|
return ConnectionGate(
|
|
session: session,
|
|
server: server,
|
|
cupertino: cupertino,
|
|
);
|
|
}
|
|
return Column(
|
|
children: [
|
|
if (!session.connected)
|
|
ConnectionBanner(session: session, cupertino: cupertino),
|
|
Expanded(child: _pipelinesScreen()),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
|
|
Widget _pipelinesScreen() => PipelinesScreen(
|
|
gateway: session.gateway,
|
|
embedded: true,
|
|
syncToken: session.connectionEpoch,
|
|
);
|
|
}
|