feat(app): the native app signs in at the web login and carries the session on its socket and downloads

This commit is contained in:
2026-10-23 19:51:43 +01:00
parent d6fbea1665
commit 2fc0a4394b
13 changed files with 335 additions and 1 deletions
@@ -13,6 +13,7 @@ import 'settings_layout.dart';
import 'settings_notifications_section.dart';
import 'settings_schedules_section.dart';
import 'settings_sections.dart';
import 'settings_sign_in_section.dart';
import 'settings_store.dart';
import 'settings_templates_section.dart';
@@ -35,10 +36,14 @@ class SettingsScreen extends StatefulWidget {
this.onOpenTemplates,
this.onOpenSchedules,
this.notifications,
this.showSignIn = false,
});
final transport.PipelinesClient client;
/// Whether to offer the web sign-in (the native app; a browser has its own).
final bool showSignIn;
/// A fixture/preview seed for the URL field. Persisted settings still load;
/// this value takes precedence for the draft and is never written by itself.
final Uri? initialEndpoint;
@@ -140,6 +145,20 @@ class _SettingsScreenState extends State<SettingsScreen> {
serverUrlField: _serverUrlField,
),
),
// A phone signs in at the web login; a browser has its own.
if (widget.showSignIn) ...<Widget>[
const SizedBox(height: settingsSectionGap),
_SettingsSection(
title: 'Sign in',
child: SettingsSignInSection(
endpoint: _controller.serverUrl,
onChanged: () {
final endpoint = widget.client.endpoint;
if (endpoint != null) widget.client.connect(endpoint);
},
),
),
],
const SizedBox(height: settingsSectionGap),
_SettingsSection(
title: 'Workspace',