Files
pipelines/app/lib/features/runs/ui/run_detail_material.dart
T
alan 072db8f749 Runs: failure banner actions, immediate run menu; pipeline rows get Run
- "Why it failed" banner offers Retry (the retry prompt), Run again… (New
  run form pre-filled; now allowed for failed runs from the banner) and
  Open in chat (the run's existing send-to-chat flow).
- The run ⋮ menu shows while the detail loads: items listed from the run's
  list row, disabled until get_run answers (the loading placeholder had no
  actions, so the menu waited for the full detail).
- Pipelines list rows: Run… in the row menu (not for archived pipelines)
  and a trailing Run button when the list sits beside its detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 00:32:57 +00:00

79 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import '../../../core/api_gateway.dart';
import '../../../ui/status/run_status_icon.dart';
import '../domain/run_models.dart';
import 'run_detail_tabs.dart';
/// The runs detail with standard Material controls.
///
/// The top bar carries the run's identity (title, number, pipeline and
/// version), Back and the more menu; this header keeps only what the bar does
/// not: the status in its colour beside the run actions, and the notices.
/// The shared tab body supplies Summary, Timeline, Artifacts and Changes.
Widget buildMaterialRunDetail({
required BuildContext context,
required JsonMap run,
required Widget headerActions,
required bool detailLoading,
required String? error,
required bool copying,
required String? copyStatus,
required VoidCallback onCopy,
required ApiGateway gateway,
required ValueChanged<JsonMap> onRunChanged,
required String configuredEndpoint,
String? initialStageKey,
int? initialVisit,
void Function(String draft)? onSendToChat,
Widget? failureActions,
}) {
return RunDetailTabs(
run: run,
failureActions: failureActions,
copying: copying,
copyStatus: copyStatus,
onCopy: onCopy,
gateway: gateway,
onRunChanged: onRunChanged,
configuredEndpoint: configuredEndpoint,
initialStageKey: initialStageKey,
initialVisit: initialVisit,
onSendToChat: onSendToChat,
// A glass strip under the top bar: as wide as its content.
header: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(12, 4, 12, 4),
child: Wrap(
spacing: 12,
runSpacing: 4,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
RunStatusKicker(
state: runStateOf(run['status']),
label: runStatusLabel(run),
),
headerActions,
],
),
),
if (detailLoading) const _Notice('Refreshing run details…'),
if (error != null) _Notice(error),
],
),
);
}
class _Notice extends StatelessWidget {
const _Notice(this.text);
final String text;
@override
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.fromLTRB(12, 0, 12, 8),
child: Semantics(liveRegion: true, child: Text(text)),
);
}