Label machine provenance and choose server before chat harness
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import '../core/servers/server_context.dart';
|
||||
import '../ui/adaptive/platform.dart';
|
||||
import 'dart:async';
|
||||
|
||||
@@ -222,7 +223,11 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
// The comparison includes the query: `?visit=N` is part of the route, while
|
||||
// a dropped or unknown query is canonicalised away.
|
||||
final location = routeLocation(_provider.value.uri);
|
||||
final initial = AppRoute.parse(location);
|
||||
final initial =
|
||||
widget.servers?.newChatServerId == widget.serverId &&
|
||||
widget.serverId != null
|
||||
? AppRoute.chat
|
||||
: AppRoute.parse(location);
|
||||
final nativeDefault =
|
||||
widget.routeInformationProvider == null &&
|
||||
!kIsWeb &&
|
||||
@@ -461,8 +466,13 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) =>
|
||||
MyApp.router(cupertino: _cupertino, routerConfig: _config);
|
||||
Widget build(BuildContext context) => widget.servers == null
|
||||
? MyApp.router(cupertino: _cupertino, routerConfig: _config)
|
||||
: ServerContext(
|
||||
connections: widget.servers!,
|
||||
serverId: widget.serverId,
|
||||
child: MyApp.router(cupertino: _cupertino, routerConfig: _config),
|
||||
);
|
||||
|
||||
/// Open a result through the exact identity the hit records. An unresolvable
|
||||
/// hit navigates nowhere: the screen already presents it read-only rather than
|
||||
|
||||
@@ -78,6 +78,10 @@ class _PipelinesRootState extends State<PipelinesRoot> {
|
||||
if (widget.web) {
|
||||
if (widget.server.uri != null) {
|
||||
_servers.alignBrowserOrigin(widget.server.uri!);
|
||||
final id = _servers.catalog.active?.id;
|
||||
if (id != null && Uri.base.queryParameters['newChat'] == '1') {
|
||||
_servers.restoreNewChatIntent(id);
|
||||
}
|
||||
}
|
||||
setState(() {
|
||||
_booting = false;
|
||||
@@ -110,8 +114,8 @@ class _PipelinesRootState extends State<PipelinesRoot> {
|
||||
}
|
||||
final page = endpoint.replace(
|
||||
scheme: endpoint.scheme == 'wss' ? 'https' : 'http',
|
||||
path: '/',
|
||||
query: null,
|
||||
path: _servers.newChatServerId == server.id ? '/chat' : '/',
|
||||
query: _servers.newChatServerId == server.id ? 'newChat=1' : null,
|
||||
fragment: null,
|
||||
);
|
||||
if (!await launchUrl(page, webOnlyWindowName: '_self')) {
|
||||
|
||||
Reference in New Issue
Block a user