Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

add typing indicators

Fixes #92
This commit is contained in:
Henry Hiles 2026-10-21 15:07:02 -04:00
commit 0fcbc275cd
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -15,6 +15,7 @@ import "package:nexus/helpers/hooks/chat_scroll.dart";
import "package:nexus/models/event.dart";
import "package:nexus/models/relation_type.dart";
import "package:nexus/widgets/composer/composer.dart";
import "package:nexus/widgets/composer/typing_indicator.dart";
import "package:nexus/widgets/error_dialog.dart";
import "package:nexus/widgets/loading.dart";
import "package:nexus/widgets/pinned_events_drawer.dart";
@ -46,6 +47,7 @@ final class const RoomChat({
final highlightedEvent = useState<int?>(null);
final composerSize = useState<double>(64);
final typingIndicatorSize = useState<double>(0);
final userId = ref.watch(ClientStateController.provider)?.userId;
final memberListOpened = ref
@ -252,6 +254,8 @@ final class const RoomChat({
: null,
highlightedEvent: highlightedEvent.value,
composerHeight: composerSize.value,
typingIndicatorHeight:
typingIndicatorSize.value,
),
AsyncLoading _ => Loading(),
AsyncError(
@ -262,6 +266,17 @@ final class const RoomChat({
},
),
),
Positioned(
bottom: composerSize.value,
left: 12,
// To give space for jump to bottom button
right: 72,
child: MeasureSize(
onChange: (size) =>
typingIndicatorSize.value = size.height,
child: TypingIndicator(roomId),
),
),
Positioned(
right: 16,
bottom: composerSize.value,