Separate chunked reply paragraphs with an empty-line gap

Consecutive text parts of an agent turn (including folded messages) and
markdown blocks within a part are now separated by ~0.9x the scaled body
font size; a heading stays 8px from what it introduces. Adds a ?paras=1
chunked reply to the composer probe and gap tests at 1x/2x.
This commit is contained in:
2026-10-31 17:05:10 +00:00
parent 9c4fd47a99
commit 9de87d5a2b
5 changed files with 241 additions and 5 deletions
+50 -1
View File
@@ -58,6 +58,10 @@ class _ProbeGateway implements ApiGateway {
},
],
},
// `?paras=1`: a long reply that arrived in chunks — several
// text parts and a second folded message, each with markdown
// paragraphs.
if (_query['paras'] == '1') ..._chunkedReply,
{
'id': 'probe-user',
'role': 'user',
@@ -124,6 +128,51 @@ class _ProbeGateway implements ApiGateway {
String nextOperation() => 'probe-op-${++_sequence}';
}
const _chunkedReply = <JsonMap>[
{
'id': 'probe-chunked-user',
'role': 'user',
'parts': [
{'type': 'text', 'text': 'Walk me through the deploy plan.'},
],
},
{
'id': 'probe-chunked-1',
'role': 'assistant',
'parts': [
{
'type': 'text',
'text':
'First I checked the build. Every target compiles and the '
'focused tests pass on this branch.\n\n'
'The integration suite is slower, so I ran it in the background '
'while reading the release notes.',
},
{
'type': 'text',
'text':
'Next, the migration. It only adds a column, so it is safe to '
'apply before the new server starts.',
},
],
},
{
'id': 'probe-chunked-2',
'role': 'assistant',
'parts': [
{
'type': 'text',
'text':
'Finally, the rollout order:\n\n'
'1. Apply the migration.\n'
'2. Restart the server.\n'
'3. Publish the client.\n\n'
'Each step can be rolled back on its own.',
},
],
},
];
const _probeLong = bool.fromEnvironment('CHAT_COMPOSER_PROBE_LONG');
const _probeModel = String.fromEnvironment(
'CHAT_COMPOSER_PROBE_MODEL',
@@ -146,7 +195,7 @@ const _probeStyle = String.fromEnvironment(
);
/// Browser overrides: `?platform=cupertino|material`, `?theme=dark|light`,
/// `?long=1`, `?tasks=<n>`, `?mode=0` (no permission mode recorded) and
/// `?long=1`, `?paras=1` (a chunked multi-paragraph reply), `?tasks=<n>`, `?mode=0` (no permission mode recorded) and
/// `?model=0` (a backend without models).
Map<String, String> get _query => Uri.base.queryParameters;
int get _probeTasks => int.tryParse(_query['tasks'] ?? '') ?? 0;