Files
pipelines/app/lib/features/runs/actions/title_wording.dart
T
alan f2643a0ff4 feat(app): add native rename-run action
Native Material/Cupertino prompt seeded from the run's stored title. Only
Save sends set_run_title {run_id, title} with the text untrimmed; typing and
Cancel send nothing, refusals stay verbatim with the draft kept, and only the
accepted run_detail is delivered once.
2026-10-21 15:14:44 +01:00

25 lines
977 B
Dart

import 'package:flutter/widgets.dart';
/// The browser client's rename wording, kept verbatim.
const runTitleActionLabel = 'Rename';
const runTitleDialogTitle = 'Rename';
const runTitleFieldLabel = 'Run title';
const runTitleSaveLabel = 'Save';
const runTitleCancelLabel = 'Cancel';
/// Stable test/semantics keys shared by the action and its prompt.
const runTitleActionKey = ValueKey<String>('rename-run-action');
const runTitleFieldKey = ValueKey<String>('rename-run-field');
const runTitleSaveKey = ValueKey<String>('rename-run-save');
const runTitleCancelKey = ValueKey<String>('rename-run-cancel');
const runTitleErrorKey = ValueKey<String>('rename-run-error');
/// The server's refusal, verbatim. Only a blank error gets a generic sentence
/// so the prompt never claims a rename that did not happen.
String describeTitleError(Object error) {
final message = '$error';
return message.trim().isEmpty
? 'The server did not rename the run.'
: message;
}