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:
@@ -66,3 +66,11 @@ TextStyle? chatMessageTextStyle(BuildContext context, bool cupertino) =>
|
||||
cupertino
|
||||
? CupertinoTheme.of(context).textTheme.textStyle
|
||||
: Theme.of(context).textTheme.bodyLarge;
|
||||
|
||||
/// The empty-line gap between two paragraphs of a reply: about one line of
|
||||
/// body text at [fontSize] (else the ambient text size), scaled by the
|
||||
/// operator's text scaling, so chunks read as separate paragraphs.
|
||||
double chatParagraphGap(BuildContext context, [double? fontSize]) {
|
||||
final size = fontSize ?? DefaultTextStyle.of(context).style.fontSize ?? 14;
|
||||
return MediaQuery.textScalerOf(context).scale(size) * 0.9;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user