545291e04a
- Run rows show a failed run's reason (else its diagnostic's first line, full text in a tooltip) or a short result preview; the Summary leads with "Why it failed". - Run again for succeeded/canceled/interrupted runs opens the New run form pre-filled (prompt, workspace, report format) at the latest version with the original offered. - Run detail and stage tabs show their names; touch shows captions on the Runs header and artifact viewer actions (desktop keeps tooltips). - ErrorNotice maps not connected / server too old / permission / timeout to what to do, raw detail behind Details (Schedules, create chat, Runs, Pipelines banners). - Settings has no Back arrow; Schedules keeps the rail on wide windows; phone Settings leads with Connection and Notifications and has a Jump to topic menu. - Walkthrough: Open Connection (skipped when connected), labelled Copy. - Pluralised counts; no duplicate status/rail names for screen readers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86 lines
2.7 KiB
Dart
86 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'walkthrough_steps.dart';
|
|
|
|
/// The harness page's command: an agent picker and the one command it selects,
|
|
/// with a single copy button for that command.
|
|
class WalkthroughHarnessCommand extends StatefulWidget {
|
|
const WalkthroughHarnessCommand({super.key});
|
|
|
|
@override
|
|
State<WalkthroughHarnessCommand> createState() =>
|
|
_WalkthroughHarnessCommandState();
|
|
}
|
|
|
|
class _WalkthroughHarnessCommandState extends State<WalkthroughHarnessCommand> {
|
|
String _agent = harnessAgents.first;
|
|
bool _copied = false;
|
|
|
|
Future<void> _copy(String command) async {
|
|
try {
|
|
await Clipboard.setData(ClipboardData(text: command));
|
|
} catch (_) {
|
|
// The command stays selectable, so a failed copy never claims success.
|
|
return;
|
|
}
|
|
if (!mounted) return;
|
|
setState(() => _copied = true);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final scheme = Theme.of(context).colorScheme;
|
|
final command = harnessSetupCommand(_agent);
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Text('Agent', style: Theme.of(context).textTheme.labelLarge),
|
|
const SizedBox(height: 8),
|
|
Wrap(
|
|
spacing: 8,
|
|
runSpacing: 8,
|
|
children: <Widget>[
|
|
for (final agent in harnessAgents)
|
|
ChoiceChip(
|
|
key: ValueKey<String>('walkthrough.agent.$agent'),
|
|
label: Text(agent),
|
|
selected: agent == _agent,
|
|
onSelected: (_) => setState(() {
|
|
_agent = agent;
|
|
_copied = false;
|
|
}),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
color: scheme.surfaceContainerHighest,
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(12),
|
|
child: SelectableText(
|
|
command,
|
|
key: const ValueKey<String>('walkthrough.command'),
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 8),
|
|
// A labelled action, not a bare icon: the step says what to do.
|
|
Align(
|
|
alignment: AlignmentDirectional.centerStart,
|
|
child: FilledButton.tonalIcon(
|
|
key: const ValueKey<String>('walkthrough.copy'),
|
|
onPressed: () => _copy(command),
|
|
icon: Icon(_copied ? Icons.check : Icons.copy_outlined),
|
|
label: Text(_copied ? 'Command copied' : 'Copy command'),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|