make names in typing indicators clickable

This commit is contained in:
Henry Hiles 2026-10-21 23:01:22 -04:00
commit 1715ee785e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -4,6 +4,7 @@ import "package:material_ui/material_ui.dart";
import "package:nexus/controllers/room_typing.dart"; import "package:nexus/controllers/room_typing.dart";
import "package:nexus/controllers/user.dart"; import "package:nexus/controllers/user.dart";
import "package:nexus/helpers/extensions/get_localpart.dart"; import "package:nexus/helpers/extensions/get_localpart.dart";
import "package:nexus/helpers/extensions/show_user_popover.dart";
import "package:nexus/widgets/bouncing_dots.dart"; import "package:nexus/widgets/bouncing_dots.dart";
class const TypingIndicator(final String roomId, {super.key}) class const TypingIndicator(final String roomId, {super.key})
@ -19,20 +20,28 @@ class const TypingIndicator(final String roomId, {super.key})
...typing ...typing
.take(named) .take(named)
.map( .map(
(typingUserId) => TextSpan( (typingUserId) => WidgetSpan(
text: alignment: .baseline,
ref baseline: .alphabetic,
.watch( child: Builder(
UserController.provider( builder: (context) => InkWell(
.new(roomId: roomId, userId: typingUserId), onTap: () =>
), context.showUserPopover(typingUserId, roomId: roomId),
) child: Text(
.value ref
?.displayName ?? .watch(
typingUserId.localpart, UserController.provider(
style: TextStyle( .new(roomId: roomId, userId: typingUserId),
fontWeight: .bold, ),
color: theme.colorScheme.onSurface, )
.value
?.displayName ??
typingUserId.localpart,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: .bold,
),
),
),
), ),
), ),
), ),