545291e04a
- 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>
32 lines
1.0 KiB
Dart
32 lines
1.0 KiB
Dart
import '../../../core/api_gateway.dart';
|
|
|
|
/// Whether the operator may retry [run], matching `canRetry` in
|
|
/// `web/src/actions.js` exactly: a loaded run that is not executing and whose
|
|
/// status is `failed`. A stale `failed` status while the run still executes is
|
|
/// not retryable.
|
|
bool canRetryRun(JsonMap? run) {
|
|
if (run == null) return false;
|
|
return run['executing'] != true && run['status'] == 'failed';
|
|
}
|
|
|
|
/// Whether [run] can be started again with its inputs: a finished run that
|
|
/// succeeded, was canceled or was interrupted, and names its pipeline. A
|
|
/// failed run has Retry instead.
|
|
bool canRunAgain(JsonMap? run) {
|
|
if (run == null || run['executing'] == true) return false;
|
|
final pipeline = run['pipeline_id'];
|
|
return const {
|
|
'succeeded',
|
|
'canceled',
|
|
'interrupted',
|
|
}.contains(run['status']) &&
|
|
pipeline is num &&
|
|
pipeline > 0;
|
|
}
|
|
|
|
/// The run id used by the retry request, or null for a malformed run.
|
|
num? retryRunId(JsonMap run) {
|
|
final id = run['id'];
|
|
return id is num ? id : null;
|
|
}
|