feat(app): run Input and Output read as named fields, not JSON; the separate Original prompt block is gone

This commit is contained in:
2026-10-23 16:15:18 +01:00
parent 44d0b8d99a
commit 080ab350e4
6 changed files with 114 additions and 140 deletions
@@ -151,7 +151,8 @@ void main() {
// The web run detail has no usage block, so no metrics tile is drawn.
expect(find.text('Metrics'), findsNothing);
expect(find.text('Unavailable'), findsNothing);
expect(find.text('Original prompt'), findsOneWidget);
// The prompt is part of Input, shown as data, not a block of its own.
expect(find.text('Original prompt'), findsNothing);
if (platform == RunDetailTestPlatform.material) {
final hash = tester.widget<SelectableText>(
@@ -207,7 +208,7 @@ void main() {
await tester.pumpAndSettle();
await tester.tap(find.text('Input'));
await tester.pumpAndSettle();
expect(find.textContaining('"prompt": "ship it"'), findsOneWidget);
expect(find.text('ship it'), findsOneWidget);
});
}
}
@@ -146,7 +146,7 @@ void main() {
);
expect(tester.takeException(), isNull);
expect(find.text('Nightly build'), findsOneWidget);
expect(find.textContaining('Original prompt'), findsOneWidget);
expect(find.textContaining('Original prompt'), findsNothing);
// Both hosts lead with the web's status kicker above the title.
expect(find.byKey(const Key('run-status-kicker')), findsOneWidget);
expect(
@@ -187,10 +187,13 @@ void main() {
}
await openSummarySection('Input');
expect(find.textContaining('"alpha": 1'), findsOneWidget);
// Each field reads under its own name as data, never as JSON.
expect(find.text('nested'), findsOneWidget);
expect(find.text('alpha=1, items=1, 2'), findsOneWidget);
expect(find.textContaining('"alpha"'), findsNothing);
await openSummarySection('Output');
expect(find.textContaining('"ok": true'), findsOneWidget);
expect(find.text('ok=true'), findsOneWidget);
await tapTab('Timeline');
final timelineScroll = find.descendant(
@@ -261,30 +264,5 @@ void main() {
await tester.tap(find.text('Back to list'));
expect(backs, 1);
});
testWidgets('${platform.name} copies the exact prompt and reports denial', (
tester,
) async {
final copied = <String>[];
var denied = false;
mockClipboard(tester, copied, denied: () => denied);
final copy = platform == AppPlatform.material
? find.byTooltip('Copy prompt')
: find.text('Copy prompt');
await controller.select(1);
await pumpDetail(tester, platform, controller, gateway);
await tester.tap(copy);
await tester.pumpAndSettle();
expect(copied.single, prompt);
expect(find.text('Prompt copied to clipboard.'), findsOneWidget);
if (platform == AppPlatform.material) {
await tester.pump(const Duration(seconds: 5));
await tester.pumpAndSettle();
}
denied = true;
await tester.tap(copy);
await tester.pumpAndSettle();
expect(find.text('Could not copy prompt to clipboard.'), findsOneWidget);
});
}
}
@@ -146,8 +146,8 @@ void main() {
find.byKey(const Key('run-detail-tab-body-summary')),
findsOneWidget,
);
expect(find.textContaining('"prompt": "ship it"'), findsOneWidget);
expect(find.textContaining('"result": "ok"'), findsNothing);
expect(find.text('ship it'), findsOneWidget);
expect(find.text('ok'), findsNothing);
});
testWidgets(
@@ -163,8 +163,8 @@ void main() {
find.byKey(const Key('run-detail-tab-body-summary')),
findsOneWidget,
);
expect(find.textContaining('"result": "ok"'), findsOneWidget);
expect(find.textContaining('"prompt": "ship it"'), findsNothing);
expect(find.text('ok'), findsOneWidget);
expect(find.text('ship it'), findsNothing);
},
);
}
@@ -180,8 +180,8 @@ void main() {
find.byKey(const Key('run-detail-tab-body-summary')),
findsOneWidget,
);
expect(find.textContaining('"prompt": "ship it"'), findsNothing);
expect(find.textContaining('"result": "ok"'), findsNothing);
expect(find.text('ship it'), findsNothing);
expect(find.text('ok'), findsNothing);
});
for (final platform in RunDetailTestPlatform.values) {
@@ -207,8 +207,8 @@ void main() {
find.byKey(const Key('run-detail-tab-body-summary')),
findsOneWidget,
);
expect(find.textContaining('"prompt": "ship it"'), findsNothing);
expect(find.textContaining('"result": "ok"'), findsNothing);
expect(find.text('ship it'), findsNothing);
expect(find.text('ok'), findsNothing);
},
);
}
@@ -113,7 +113,7 @@ void main() {
await tester.pump();
expect(find.text('Alpha run'), findsOneWidget);
expect(find.text('initial prompt'), findsOneWidget);
expect(find.text('Input'), findsOneWidget);
expect(find.text('Loading run details…'), findsNothing);
});