add minimal scroll to message, only when on current timeline

This commit is contained in:
Henry Hiles 2026-03-12 21:09:11 -04:00
commit 9a3f7e9bdc
No known key found for this signature in database
4 changed files with 22 additions and 9 deletions

View file

@ -435,6 +435,7 @@ class RoomChat extends HookConsumerWidget {
customWidget: getTextWidget(message),
topWidget: TopWidget(
message,
onTapReply: notifier.scrollToMessage,
groupStatus: groupStatus,
),
message: message,
@ -491,6 +492,8 @@ class RoomChat extends HookConsumerWidget {
topWidget: TopWidget(
message,
groupStatus: groupStatus,
onTapReply:
notifier.scrollToMessage,
alwaysShow: true,
),
message: textMessage,
@ -503,6 +506,8 @@ class RoomChat extends HookConsumerWidget {
: TopWidget(
message,
groupStatus: groupStatus,
onTapReply:
notifier.scrollToMessage,
alwaysShow: true,
),
customImageProvider: CachedNetworkImage(
@ -547,6 +552,7 @@ class RoomChat extends HookConsumerWidget {
child: FlyerChatFileMessage(
topWidget: TopWidget(
message,
onTapReply: notifier.scrollToMessage,
groupStatus: groupStatus,
),
message: message,

View file

@ -9,9 +9,11 @@ class TopWidget extends ConsumerWidget {
final Message message;
final bool alwaysShow;
final MessageGroupStatus? groupStatus;
final void Function(Message message)? onTapReply;
const TopWidget(
this.message, {
required this.groupStatus,
this.onTapReply,
this.alwaysShow = false,
super.key,
});
@ -54,12 +56,7 @@ class TopWidget extends ConsumerWidget {
return Padding(
padding: EdgeInsets.only(bottom: 12),
child: InkWell(
onTap: () => showDialog(
context: context,
builder: (_) => Dialog(
child: Text("TODO: Scroll to original message"),
), // TODO
),
onTap: () => onTapReply?.call(replyMessage),
child: Quoted(
Row(
mainAxisSize: MainAxisSize.min,