Keep a long reply region chip inside the composer quote

This commit is contained in:
zjs81 committed 2026-11-20 18:13:53 -07:00
1 parent bc0062363d
commit 3f4215a955
3 files changed
+23 -2

No files matched your search

+2
View File
@@ -2670,6 +2670,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
), ),
child: Text( child: Text(
context.l10n.channels_regionSetTo(replyRegion!), context.l10n.channels_regionSetTo(replyRegion!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: style:
MeshTheme.mono( MeshTheme.mono(
fontSize: 12 * textScale, fontSize: 12 * textScale,
+13 -2
View File
@@ -468,7 +468,8 @@ class ChatComposerQuote extends StatelessWidget {
), ),
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6), padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6),
child: Row( child: LayoutBuilder(
builder: (context, constraints) => Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@@ -488,7 +489,16 @@ class ChatComposerQuote extends StatelessWidget {
], ],
), ),
), ),
?trailing, // The quote shares its row with Send, so a long trailing
// control (a region chip) must not squeeze out the message
// or the dismiss button.
if (trailing != null)
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth * 0.4,
),
child: trailing,
),
IconButton( IconButton(
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
tooltip: dismissTooltip, tooltip: dismissTooltip,
@@ -499,6 +509,7 @@ class ChatComposerQuote extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
} }
+8
View File
@@ -479,10 +479,18 @@ void main() {
), ),
onDismiss: () {}, onDismiss: () {},
dismissTooltip: _l10n.chat_cancelReply, dismissTooltip: _l10n.chat_cancelReply,
// A long region chip, as a channel reply shows.
trailing: Text(
_l10n.channels_regionSetTo('north-west-valley'),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
), ),
), ),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(tester.takeException(), isNull);
expect(find.byTooltip(_l10n.chat_cancelReply), findsOneWidget);
await _type(tester, 'a' * 19); await _type(tester, 'a' * 19);
expect(tester.takeException(), isNull); expect(tester.takeException(), isNull);