Files
pipelines/app/lib/features/runs/actions/retry_wording.dart
T
alan 53a8f668ca feat(app): start a pipeline from the detail view
Native Run action opens the web's prompt/workspace/notify dialog, sends the exact run_pipeline body against the pinned resolved version with one request key per confirmed attempt, keeps refusals in the dialog, reconciles a lost reply by key, and opens only the server-named run through the existing run route with one fresh Runs list read.

Adds a shared failure-reason helper so operators never see Dart runtime prefixes, and records the slice boundary in notes/P3-run.md.
2026-10-22 02:07:49 +01:00

36 lines
1.4 KiB
Dart

import 'package:flutter/widgets.dart';
import '../../../core/error_reason.dart';
/// The browser client's retry wording, kept verbatim.
const retryActionLabel = 'Retry';
const retryDialogMessage =
'Only failed runs can be retried. The server starts a new run from the '
'same input.';
const retryConfirmLabel = 'Retry';
const restartDialogMessage =
'This replays the whole pipeline from the start instead of resuming the '
'failed stage.';
const restartConfirmLabel = 'Restart from start';
const retryKeepLabel = 'Keep';
/// Stable test/semantics keys shared by the action and its prompt.
const retryActionKey = ValueKey<String>('retry-run-action');
const retryKeepKey = ValueKey<String>('retry-run-keep');
const retryConfirmKey = ValueKey<String>('retry-run-confirm');
const retryRestartKey = ValueKey<String>('retry-run-restart');
const retryErrorKey = ValueKey<String>('retry-run-error');
/// The retry dialog's title: `Retry run {id}?`.
String retryDialogTitle(num runId) => 'Retry run $runId?';
/// The restart dialog's title: `Restart run {id}?`.
String restartDialogTitle(num runId) => 'Restart run $runId?';
/// The server's refusal, verbatim. Only a blank error gets a generic sentence
/// so the prompt never claims a retry that did not happen.
String describeRetryError(Object error) => describeErrorReason(
error,
fallback: 'The server did not retry the run.',
);