Files
pipelines/app/lib/features/runs/ui/run_detail_actions.dart
T
alan 0af62595c4 merge(app): land retry wiring in the native run detail
Conflicts: app/lib/features/runs/ui/run_detail_actions.dart.
Keep main's recorded-artifacts action and the retry branch's spaced,
render-gated Wrap: Rename, Retry, Cancel, then Recorded artifacts.
2026-10-21 22:52:00 +01:00

70 lines
2.3 KiB
Dart

import 'package:flutter/widgets.dart';
import '../../../core/api_gateway.dart';
import '../../artifacts/ui/artifact_gallery_action.dart';
import '../actions/cancel_eligibility.dart';
import '../actions/cancel_run_action.dart';
import '../actions/retry_action.dart';
import '../actions/retry_eligibility.dart';
import '../actions/title_action.dart';
import 'run_decision_notice.dart';
/// Native actions on the loaded run, all using the app's one gateway and
/// applying only accepted server detail through the same controller callback.
class RunDetailActions extends StatelessWidget {
const RunDetailActions({
super.key,
required this.run,
required this.gateway,
required this.onRunChanged,
this.onRunOpened,
});
final JsonMap run;
final ApiGateway gateway;
final ValueChanged<JsonMap> onRunChanged;
/// Opens the new run named by an accepted retry reply; see [RetryRunAction].
final ValueChanged<num>? onRunOpened;
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Standard native spacing keeps adjacent outlines and fills distinct.
// Only actions that render are included: a hidden zero-size child still
// consumes Wrap spacing and would double the visible gap.
Wrap(
spacing: 8,
runSpacing: 4,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
if (runTitleId(run) != null)
RunTitleAction(
run: run,
gateway: gateway,
onRunChanged: onRunChanged,
),
if (retryRunId(run) != null && canRetryRun(run))
RetryRunAction(
run: run,
gateway: gateway,
onRunChanged: onRunChanged,
onRunOpened: onRunOpened,
),
if (cancelRunId(run) != null && canCancelRun(run))
CancelRunAction(
run: run,
gateway: gateway,
onRunChanged: onRunChanged,
),
if (showRunArtifactsAction(run))
RunArtifactsButton(run: run, gateway: gateway),
],
),
RunDecisionNotice(run: run, gateway: gateway, onRunChanged: onRunChanged),
],
);
}