always make event previews two lines for non-state events

This commit is contained in:
Henry Hiles 2026-10-04 00:32:20 -04:00
commit ffaa516dcd
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 27 additions and 36 deletions

View file

@ -18,21 +18,17 @@ class const EventPreview(final Event event, {super.key})
if (event.content is MessageContent) MessageAvatar(event), if (event.content is MessageContent) MessageAvatar(event),
Flexible( Flexible(
child: Row( child: Column(
crossAxisAlignment: .center, mainAxisAlignment: .center,
mainAxisSize: .min, crossAxisAlignment: .start,
spacing: 8,
children: [ children: [
if (event.content is MessageContent) if (event.content is MessageContent) MessageDisplayname(event),
Flexible(child: MessageDisplayname(event)), EventRenderer(
Flexible(
child: EventRenderer(
event.rowId, event.rowId,
roomId: event.roomId, roomId: event.roomId,
textOnly: true, textOnly: true,
maxLines: 1, maxLines: 1,
), ),
),
], ],
), ),
), ),

View file

@ -199,11 +199,7 @@ class const MessageRenderer(
child: Padding( child: Padding(
padding: .symmetric(vertical: 8, horizontal: 12), padding: .symmetric(vertical: 8, horizontal: 12),
child: SizedBox( child: SizedBox(
height: 32, height: 48,
child: OverflowBox(
alignment: .centerLeft,
minHeight: 0,
maxHeight: .infinity,
child: switch (ref.watch( child: switch (ref.watch(
EventController.provider( EventController.provider(
.new( .new(
@ -226,7 +222,6 @@ class const MessageRenderer(
), ),
), ),
), ),
),
rendered, rendered,
if (!textOnly) ReactionRow(event), if (!textOnly) ReactionRow(event),
], ],