f2c33d2a1e
The run detail now offers the web's "Schedule this run" action when the
run names a positive pipeline and pinned version. It opens the existing
create editor seeded from the run and sends nothing until Save.
The seed preserves every field the browser's scheduleDraft({ run })
copies: title (following the title_source rule), all input keys with
prompt kept editable, pinned version, workspace, notify mode, write
paths, tool access, model, stage models and output format. build() emits
the same conditional payload as serializeSchedule.
One request key is minted per editor opening so a refused save retries
without duplicating the schedule. Advanced options are seed-only for
now: the editor has no controls for them yet.
73 lines
2.4 KiB
Dart
73 lines
2.4 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
import '../../../core/api_gateway.dart';
|
|
import '../../artifacts/ui/artifact_gallery_action.dart';
|
|
import '../../schedules/ui/run/schedule_run_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 (canScheduleRun(run))
|
|
ScheduleRunAction(run: run, gateway: gateway),
|
|
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),
|
|
],
|
|
);
|
|
}
|