Merge branch 'main' into run/lists-polish-r1

This commit is contained in:
2026-10-31 00:55:36 +00:00
7 changed files with 26 additions and 32 deletions
@@ -8,8 +8,7 @@ import 'package:flutter/material.dart';
/// style. Keeping the styles here stops each card file from inventing its own
/// size and colour; everything still comes from the active Material/Cupertino
/// theme, so light, dark and text scaling follow the host.
TextStyle? chatCardTitleStyle(BuildContext context, bool cupertino) =>
cupertino
TextStyle? chatCardTitleStyle(BuildContext context, bool cupertino) => cupertino
? CupertinoTheme.of(context).textTheme.navTitleTextStyle
: Theme.of(context).textTheme.titleMedium;
@@ -21,9 +20,9 @@ TextStyle? chatCardBodyStyle(BuildContext context, bool cupertino) => cupertino
/// (the same subordinate style the rest of the app uses for secondary copy)
/// keeps labels from reading as extra headings; Material keeps `titleSmall`.
TextStyle? chatCardLabelStyle(BuildContext context, bool cupertino) => cupertino
? CupertinoTheme.of(
context,
).textTheme.tabLabelTextStyle.copyWith(color: chatCardSecondaryColor(context, true))
? CupertinoTheme.of(context).textTheme.tabLabelTextStyle.copyWith(
color: chatCardSecondaryColor(context, true),
)
: Theme.of(context).textTheme.titleSmall;
/// Body text that supports a control, such as a field description.
@@ -63,10 +63,7 @@ Widget _field({
children: [
Text(label, style: chatCardLabelStyle(context, cupertino)),
if (description.isNotEmpty && description != title)
Text(
description,
style: chatCardSecondaryStyle(context, cupertino),
),
Text(description, style: chatCardSecondaryStyle(context, cupertino)),
if ('${field['type'] ?? ''}' == 'external')
_external(context, field, cupertino)
else if ('${field['type'] ?? ''}' == 'boolean')
@@ -44,8 +44,7 @@ Object? chatFormFieldValue(JsonMap field, String raw) {
case 'integer':
final parsed = num.tryParse(raw);
if (parsed == null) return double.nan;
final integral =
parsed.isFinite && parsed == parsed.roundToDouble();
final integral = parsed.isFinite && parsed == parsed.roundToDouble();
return type == 'integer' && integral ? parsed.toInt() : parsed;
default:
return raw;
@@ -33,12 +33,7 @@ List<Widget> chatQuestionRecordedAnswers({
for (final entry in answers.entries) {
if (shown.contains(entry.key)) continue;
widgets.add(
_recorded(
context,
entry.key,
_answerText(null, entry.value),
cupertino,
),
_recorded(context, entry.key, _answerText(null, entry.value), cupertino),
);
}
if (widgets.isEmpty) {
@@ -65,7 +65,9 @@ int chatNewMessageCount(List<String> messageIds, String? newestAtRelease) {
/// native client adds while the operator is reading above the end.
String chatJumpToLatestLabel(int newMessages) {
if (newMessages <= 0) return 'Jump to latest';
final suffix = newMessages == 1 ? '1 new message' : '$newMessages new messages';
final suffix = newMessages == 1
? '1 new message'
: '$newMessages new messages';
return 'Jump to latest · $suffix';
}
@@ -44,8 +44,7 @@ class ChatThreadCards {
String answerFor(String requestId) => _answers[requestId] ?? '';
String? permissionErrorFor(String requestId) =>
_permissionErrors[requestId];
String? permissionErrorFor(String requestId) => _permissionErrors[requestId];
String? formErrorFor(String formId) => _formErrors[formId];
@@ -105,8 +104,7 @@ class ChatThreadCards {
_forms[id] = {
...form,
'resolved': true,
if (answers.isNotEmpty)
'answers': Map<String, dynamic>.from(answers),
if (answers.isNotEmpty) 'answers': Map<String, dynamic>.from(answers),
};
_pruneSettledForms();
notify();
@@ -165,11 +165,13 @@ void main() {
await pumpApp(tester, provider: provider, client: client);
await waitForRequest(tester, channel, 'list_runs');
final initialRuns = pipelineRequest(channel, 'list_runs')!;
channel.incoming.add(jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}));
channel.incoming.add(
jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}),
);
await tester.pump();
final before = countType(channel, 'list_runs');
showDialog<void>(
@@ -198,11 +200,13 @@ void main() {
await pumpApp(tester, provider: provider, client: client);
await waitForRequest(tester, channel, 'list_runs');
final initialRuns = pipelineRequest(channel, 'list_runs')!;
channel.incoming.add(jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}));
channel.incoming.add(
jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}),
);
await tester.pump();
final before = countType(channel, 'list_runs');
showDialog<void>(