5425001d82
One picker offers a new chat (the saved Open in chat harness and model) or any open chat. An existing chat gets the reference appended to its draft and focused, never sent. Artifacts gain the action in their viewer and gallery; the run and pipeline item becomes Send to chat.
77 lines
2.3 KiB
Dart
77 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../core/api_gateway.dart';
|
|
import '../../../ui/status/run_status_icon.dart';
|
|
import '../domain/run_models.dart';
|
|
import 'run_detail_tabs.dart';
|
|
|
|
/// The runs detail with standard Material controls.
|
|
///
|
|
/// The top bar carries the run's identity (title, number, pipeline and
|
|
/// version), Back and the more menu; this header keeps only what the bar does
|
|
/// not: the status in its colour beside the run actions, and the notices.
|
|
/// The shared tab body supplies Summary, Timeline, Artifacts and Changes.
|
|
Widget buildMaterialRunDetail({
|
|
required BuildContext context,
|
|
required JsonMap run,
|
|
required Widget headerActions,
|
|
required bool detailLoading,
|
|
required String? error,
|
|
required bool copying,
|
|
required String? copyStatus,
|
|
required VoidCallback onCopy,
|
|
required ApiGateway gateway,
|
|
required ValueChanged<JsonMap> onRunChanged,
|
|
required String configuredEndpoint,
|
|
String? initialStageKey,
|
|
int? initialVisit,
|
|
void Function(String draft)? onSendToChat,
|
|
}) {
|
|
return RunDetailTabs(
|
|
run: run,
|
|
copying: copying,
|
|
copyStatus: copyStatus,
|
|
onCopy: onCopy,
|
|
gateway: gateway,
|
|
onRunChanged: onRunChanged,
|
|
configuredEndpoint: configuredEndpoint,
|
|
initialStageKey: initialStageKey,
|
|
initialVisit: initialVisit,
|
|
onSendToChat: onSendToChat,
|
|
// A glass strip under the top bar: as wide as its content.
|
|
header: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.fromLTRB(12, 4, 12, 4),
|
|
child: Wrap(
|
|
spacing: 12,
|
|
runSpacing: 4,
|
|
crossAxisAlignment: WrapCrossAlignment.center,
|
|
children: [
|
|
RunStatusKicker(
|
|
state: runStateOf(run['status']),
|
|
label: runStatusLabel(run),
|
|
),
|
|
headerActions,
|
|
],
|
|
),
|
|
),
|
|
if (detailLoading) const _Notice('Refreshing run details…'),
|
|
if (error != null) _Notice(error),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
class _Notice extends StatelessWidget {
|
|
const _Notice(this.text);
|
|
final String text;
|
|
|
|
@override
|
|
Widget build(BuildContext context) => Padding(
|
|
padding: const EdgeInsets.fromLTRB(12, 0, 12, 8),
|
|
child: Semantics(liveRegion: true, child: Text(text)),
|
|
);
|
|
}
|