chore: remove message bubble from emoji messages (#2686)

This commit is contained in:
ggurdin 2025-05-06 12:07:14 -04:00 committed by GitHub
parent 4ebe40ae9a
commit 7ca2ea7140
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 13 deletions

View file

@ -1840,7 +1840,10 @@ class ChatController extends State<ChatPageWithRoom>
// #Pangea
String? get buttonEventID => timeline!.events
.firstWhereOrNull(
(event) => event.isVisibleInGui && event.senderId != room.client.userID,
(event) =>
event.isVisibleInGui &&
event.senderId != room.client.userID &&
!event.redacted,
)
?.eventId;

View file

@ -405,6 +405,7 @@ class Message extends StatelessWidget {
showToolbar(pangeaMessageEvent);
},
color: color,
visible: isButton && !noBubble,
child:
// Pangea#
Container(

View file

@ -18,6 +18,7 @@ class PressableButton extends StatefulWidget {
final bool playSound;
final double colorFactor;
final bool visible;
const PressableButton({
required this.borderRadius,
@ -29,6 +30,7 @@ class PressableButton extends StatefulWidget {
this.triggerAnimation,
this.playSound = false,
this.colorFactor = 0.3,
this.visible = true,
super.key,
});
@ -135,6 +137,10 @@ class PressableButtonState extends State<PressableButton>
@override
Widget build(BuildContext context) {
if (!widget.visible) {
return widget.child;
}
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(

View file

@ -13,6 +13,7 @@ import 'package:fluffychat/pangea/toolbar/enums/reading_assistance_mode_enum.dar
import 'package:fluffychat/pangea/toolbar/widgets/message_selection_overlay.dart';
import 'package:fluffychat/pangea/toolbar/widgets/message_speech_to_text_card.dart';
import 'package:fluffychat/utils/date_time_extension.dart';
import 'package:fluffychat/utils/file_description.dart';
import 'package:fluffychat/widgets/matrix.dart';
// @ggurdin be great to explain the need/function of a widget like this
@ -108,12 +109,18 @@ class OverlayMessage extends StatelessWidget {
: theme.colorScheme.primary;
}
final noBubble = {
MessageTypes.Video,
MessageTypes.Image,
MessageTypes.Sticker,
}.contains(event.messageType) &&
!event.redacted;
final noBubble = ({
MessageTypes.Video,
MessageTypes.Image,
MessageTypes.Sticker,
}.contains(event.messageType) &&
event.fileDescription == null &&
!event.redacted) ||
(event.messageType == MessageTypes.Text &&
event.relationshipType == null &&
event.onlyEmotes &&
event.numberEmotes > 0 &&
event.numberEmotes <= 3);
final noPadding = {
MessageTypes.File,
MessageTypes.Audio,
@ -254,15 +261,12 @@ class OverlayMessage extends StatelessWidget {
);
return Material(
color: color,
clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder(
borderRadius: borderRadius,
),
type: MaterialType.transparency,
child: Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: noBubble ? Colors.transparent : color,
borderRadius: borderRadius,
color: color,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,