fix: Show signal chips on double tap

This commit is contained in:
Janez T
2026-03-18 16:59:02 +01:00
parent 68ec72534d
commit f286b0afd1
2 changed files with 72 additions and 5 deletions

View File

@@ -74,12 +74,14 @@ class MessageBubble extends StatefulWidget {
class _MessageBubbleState extends State<MessageBubble> {
static final RegExp _mentionPattern = RegExp(r'@\[(.+?)\]');
bool _isExpanded = false;
bool _showReceivedStats = false;
@override
void didUpdateWidget(MessageBubble oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.message.id != widget.message.id) {
_isExpanded = false;
_showReceivedStats = false;
return;
}
@@ -175,6 +177,19 @@ class _MessageBubbleState extends State<MessageBubble> {
widget.onTap?.call();
}
void _handleBubbleDoubleTap({
required bool isSarMarker,
required bool isDrawing,
}) {
if (widget.isCompact || isSarMarker || isDrawing) {
return;
}
setState(() {
_showReceivedStats = !_showReceivedStats;
});
}
Future<void> _retryFailedMessage(
BuildContext context,
Message failedMessage,
@@ -1924,6 +1939,10 @@ class _MessageBubbleState extends State<MessageBubble> {
isSarMarker: isSarMarker,
isDrawing: message.isDrawing,
),
onDoubleTap: () => _handleBubbleDoubleTap(
isSarMarker: isSarMarker,
isDrawing: message.isDrawing,
),
onLongPress: widget.isCompact
? null
: () => _showMessageOptions(context),
@@ -2493,7 +2512,8 @@ class _MessageBubbleState extends State<MessageBubble> {
if (!widget.isCompact &&
!isSarMarker &&
!message.isDrawing &&
!message.isSentMessage) ...[
!message.isSentMessage &&
_showReceivedStats) ...[
const SizedBox(height: 6),
buildReceivedSignalStatus(
context,
@@ -2706,6 +2726,7 @@ class _MessageBubbleState extends State<MessageBubble> {
message.isContactMessage &&
message.deliveryStatus ==
MessageDeliveryStatus.delivered &&
_showReceivedStats &&
message.roundTripTimeMs != null;
return Column(
@@ -2811,7 +2832,8 @@ class _MessageBubbleState extends State<MessageBubble> {
);
},
),
if (shouldShowSentChannelStats(message)) ...[
if (_showReceivedStats &&
shouldShowSentChannelStats(message)) ...[
const SizedBox(height: 6),
buildChannelEchoStatus(context, message),
],