From fd4b16c700438066ddee77af9be5f78819eea988 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 4 Apr 2026 18:36:20 -0400 Subject: [PATCH] Pass href to mention chip, fixing some mentions --- lib/widgets/chat_page/html/html.dart | 4 +++- lib/widgets/chat_page/html/mention_chip.dart | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/widgets/chat_page/html/html.dart b/lib/widgets/chat_page/html/html.dart index f3b756f..8e9bb58 100644 --- a/lib/widgets/chat_page/html/html.dart +++ b/lib/widgets/chat_page/html/html.dart @@ -60,7 +60,9 @@ class Html extends ConsumerWidget { "a" => element.attributes["href"]?.mention == null ? null - : InlineCustomWidget(child: MentionChip(element.text)), + : InlineCustomWidget( + child: MentionChip(element.attributes["href"]!), + ), "img" => src == null diff --git a/lib/widgets/chat_page/html/mention_chip.dart b/lib/widgets/chat_page/html/mention_chip.dart index d4b9927..b850211 100644 --- a/lib/widgets/chat_page/html/mention_chip.dart +++ b/lib/widgets/chat_page/html/mention_chip.dart @@ -5,19 +5,20 @@ import "package:nexus/helpers/extensions/link_to_mention.dart"; import "package:nexus/helpers/extensions/show_user_popover.dart"; class MentionChip extends ConsumerWidget { - final String label; - const MentionChip(this.label, {super.key}); + final String content; + const MentionChip(this.content, {super.key}); @override Widget build(BuildContext context, WidgetRef ref) { - final membership = label.mention.startsWith("@") == true + final membership = content.mention.startsWith("@") == true ? ref - .watch(UserController.provider(label.mention)) + .watch(UserController.provider(content.mention)) .whenOrNull(data: (data) => data) : null; return InkWell( onTapUp: (details) { + content.mention; if (membership != null) { context.showUserPopover( membership, @@ -29,7 +30,7 @@ class MentionChip extends ConsumerWidget { child: Chip( label: Text( (membership == null ? null : "@${membership.displayName}") ?? - label.mention, + content.mention, style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).colorScheme.onPrimary,