feat(realtime): add voice/video recording activity events
Some checks are pending
CI / test (push) Has started running

This commit is contained in:
2026-03-08 19:53:48 +03:00
parent 1ef0cdf29d
commit ac82e25d16
8 changed files with 135 additions and 9 deletions

View File

@@ -46,6 +46,8 @@ export function MessageList() {
const activeChatId = useChatStore((s) => s.activeChatId);
const messagesByChat = useChatStore((s) => s.messagesByChat);
const typingByChat = useChatStore((s) => s.typingByChat);
const recordingVoiceByChat = useChatStore((s) => s.recordingVoiceByChat);
const recordingVideoByChat = useChatStore((s) => s.recordingVideoByChat);
const hasMoreByChat = useChatStore((s) => s.hasMoreByChat);
const loadingMoreByChat = useChatStore((s) => s.loadingMoreByChat);
const loadMoreMessages = useChatStore((s) => s.loadMoreMessages);
@@ -130,6 +132,17 @@ export function MessageList() {
const focusedMessageId = activeChatId ? (focusedMessageIdByChat[activeChatId] ?? null) : null;
const hasMore = Boolean(activeChatId && hasMoreByChat[activeChatId]);
const isLoadingMore = Boolean(activeChatId && loadingMoreByChat[activeChatId]);
const typingCount = activeChatId ? (typingByChat[activeChatId] ?? []).length : 0;
const recordingVoiceCount = activeChatId ? (recordingVoiceByChat[activeChatId] ?? []).length : 0;
const recordingVideoCount = activeChatId ? (recordingVideoByChat[activeChatId] ?? []).length : 0;
const activityLabel =
recordingVideoCount > 0
? "recording video..."
: recordingVoiceCount > 0
? "recording voice..."
: typingCount > 0
? "typing..."
: "";
const selectedMessages = useMemo(() => messages.filter((m) => selectedIds.has(m.id)), [messages, selectedIds]);
const channelOnlyDeleteForAll = activeChat?.type === "channel" && !activeChat?.is_saved;
const canDeleteAllForSelection = useMemo(
@@ -683,7 +696,7 @@ export function MessageList() {
})}
</div>
<div className="px-5 pb-2 text-xs text-slate-300/80">{(typingByChat[activeChatId] ?? []).length > 0 ? "typing..." : ""}</div>
<div className="px-5 pb-2 text-xs text-slate-300/80">{activityLabel}</div>
{showScrollToBottom ? (
<div className="pointer-events-none absolute bottom-20 right-4 z-40 md:bottom-24">
<button