Merge commit '40623991e8709e5c1ab3e875b51d4de55f0c20a5' into pipelines/run-20261112-0201-chat-seen-only-after-real-interaction-7302
This commit is contained in:
@@ -5,6 +5,7 @@ import '../chat/workspace/chat_float_shortcut.dart';
|
||||
import '../terminal/terminal_shortcuts.dart';
|
||||
import '../../shell/windows/window_shortcuts.dart';
|
||||
import '../../shell/shell_chat_shortcut.dart';
|
||||
import '../../shell/shell_runs_pipelines_shortcut.dart';
|
||||
import '../../shell/shell_search_shortcut_labels.dart';
|
||||
|
||||
/// A shortcut entry shown in the in-app help. Keeping these entries together
|
||||
@@ -61,6 +62,12 @@ class KeyboardShortcutRegistry {
|
||||
? 'Shows the open chat and focuses its message input. The browser may reserve Ctrl+K.'
|
||||
: 'Shows the open chat and focuses its message input. In the terminal Ctrl+K stays kill-line; Alt+K still opens Chat.',
|
||||
),
|
||||
const KeyboardShortcutEntry(
|
||||
action: 'Switch between Runs and Pipelines',
|
||||
keys: shellRunsPipelinesShortcutLabel,
|
||||
caveat:
|
||||
'Goes to Runs from other destinations and to Pipelines from Runs. In a text field or the terminal Ctrl+A keeps its own meaning.',
|
||||
),
|
||||
KeyboardShortcutEntry(
|
||||
action: 'Toggle Center Stage',
|
||||
keys:
|
||||
|
||||
@@ -16,11 +16,24 @@ const deviceDeliveryNote =
|
||||
'quiet "Pipelines is connected" notification while it runs.';
|
||||
const deviceDeliveryBatteryLabel = 'Allow background delivery';
|
||||
const deviceDeliveryNotificationsLabel = 'Allow notifications';
|
||||
const deviceDeliveryWarningTitle = 'Delivery can pause while idle';
|
||||
const deviceDeliveryWarningText =
|
||||
'Android may pause Pipelines in the background, so notifications can '
|
||||
'arrive late. Allow background delivery above.';
|
||||
const deviceDeliverySamsungNote =
|
||||
'Samsung phones: also add Pipelines under Settings › Battery › '
|
||||
'Background usage limits › Never sleeping apps.';
|
||||
const deviceDeliveryLogTitle = 'Connection log';
|
||||
const deviceDeliveryLogEmpty = 'No connection events yet';
|
||||
|
||||
abstract final class DeviceDeliveryKeys {
|
||||
static const toggle = ValueKey<String>('settings.deviceDelivery.toggle');
|
||||
static const status = ValueKey<String>('settings.deviceDelivery.status');
|
||||
static const battery = ValueKey<String>('settings.deviceDelivery.battery');
|
||||
static const batteryWarning = ValueKey<String>(
|
||||
'settings.deviceDelivery.batteryWarning',
|
||||
);
|
||||
static const log = ValueKey<String>('settings.deviceDelivery.log');
|
||||
static const permission = ValueKey<String>(
|
||||
'settings.deviceDelivery.permission',
|
||||
);
|
||||
@@ -66,7 +79,7 @@ class _SettingsDeviceDeliverySectionState
|
||||
void initState() {
|
||||
super.initState();
|
||||
_lifecycle;
|
||||
unawaited(_controller.load());
|
||||
unawaited(_controller.open());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -136,7 +149,45 @@ class _SettingsDeviceDeliverySectionState
|
||||
enabled: !status.batteryExempt && !_controller.busy,
|
||||
onTap: () => unawaited(_controller.allowBackgroundDelivery()),
|
||||
),
|
||||
if (status != null && enabled && !status.batteryExempt)
|
||||
SettingsRow(
|
||||
key: DeviceDeliveryKeys.batteryWarning,
|
||||
leading: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
color: settingsErrorColor(context),
|
||||
),
|
||||
title: const Text(deviceDeliveryWarningTitle),
|
||||
subtitle: Text(
|
||||
'$deviceDeliveryWarningText\n$deviceDeliverySamsungNote',
|
||||
),
|
||||
),
|
||||
if (status != null)
|
||||
ExpansionTile(
|
||||
key: DeviceDeliveryKeys.log,
|
||||
title: const Text(deviceDeliveryLogTitle),
|
||||
children: _logRows(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _logRows() {
|
||||
final events = _controller.events;
|
||||
if (events.isEmpty) {
|
||||
return const <Widget>[ListTile(title: Text(deviceDeliveryLogEmpty))];
|
||||
}
|
||||
return [
|
||||
for (final event in events)
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text(event.title),
|
||||
subtitle: Text(
|
||||
[
|
||||
event.timeLabel,
|
||||
if (event.detail != null) event.detail!,
|
||||
].join('\n'),
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,5 @@ abstract final class SettingsKeys {
|
||||
static const keyboardShortcuts = ValueKey<String>(
|
||||
'settings.keyboardShortcuts',
|
||||
);
|
||||
static const walkthrough = ValueKey<String>('settings.walkthrough');
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import 'server_connections.dart';
|
||||
import 'saved_servers_section.dart';
|
||||
import 'managed_connection_section.dart';
|
||||
import 'settings_keyboard_shortcuts_section.dart';
|
||||
import 'settings_walkthrough_section.dart';
|
||||
|
||||
part 'settings_topic_pages.dart';
|
||||
|
||||
|
||||
@@ -85,7 +85,10 @@ extension _SettingsTopicPages on _SettingsScreenState {
|
||||
SettingsGroup(
|
||||
title: 'Help',
|
||||
leadingRows: true,
|
||||
children: const [SettingsKeyboardShortcutsSection()],
|
||||
children: const [
|
||||
SettingsKeyboardShortcutsSection(),
|
||||
SettingsWalkthroughSection(),
|
||||
],
|
||||
),
|
||||
if (widget.onOpenSchedules case final open?)
|
||||
SettingsGroup(
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../walkthrough/first_run_walkthrough.dart';
|
||||
import 'settings_keys.dart';
|
||||
import 'settings_row.dart';
|
||||
|
||||
/// Reopens the first-run walkthrough. It only shows the walkthrough; it never
|
||||
/// changes the device's seen record.
|
||||
class SettingsWalkthroughSection extends StatelessWidget {
|
||||
const SettingsWalkthroughSection({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SettingsRow(
|
||||
key: SettingsKeys.walkthrough,
|
||||
leading: const Icon(Icons.school_outlined),
|
||||
title: const Text('Show the walkthrough'),
|
||||
subtitle: const Text(
|
||||
'Four short steps: connect, set up an agent, run, chat.',
|
||||
),
|
||||
chevron: true,
|
||||
onTap: () => showFirstRunWalkthrough(context),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user