Files
pipelines/app/lib/features/runs/ui/run_failure_banner.dart
T
alan 545291e04a App: run failure reasons, Run again, labelled tabs, actionable errors, nav fixes
- 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>
2026-12-02 20:16:22 +00:00

66 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import '../../../core/api_gateway.dart';
import '../domain/run_outcome_line.dart';
/// The run Summary's prominent "Why it failed" note: a failed run's recorded
/// failure reason (else its diagnostic), selectable, at the top of the
/// Summary so the reason is read before the facts. Nothing for other runs.
class RunFailureBanner extends StatelessWidget {
const RunFailureBanner({super.key, required this.run});
final JsonMap run;
@override
Widget build(BuildContext context) {
final outcome = runOutcomeLine(run);
if (outcome == null || !outcome.failed) return const SizedBox.shrink();
final theme = Theme.of(context);
final scheme = theme.colorScheme;
return Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
child: DecoratedBox(
key: const Key('run-failure-banner'),
decoration: ShapeDecoration(
color: scheme.errorContainer,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Padding(
padding: const EdgeInsets.all(12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.error_outline, color: scheme.onErrorContainer),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Why it failed',
style: theme.textTheme.titleSmall?.copyWith(
color: scheme.onErrorContainer,
),
),
const SizedBox(height: 4),
SelectableText(
outcome.full,
maxLines: 6,
minLines: 1,
style: theme.textTheme.bodyMedium?.copyWith(
color: scheme.onErrorContainer,
),
),
],
),
),
],
),
),
),
);
}
}