v3: chatbox improvements (typing indicators, answer to previous messages, backlog days separators, scroll to last message position, visual tweaks)
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s

This commit is contained in:
2026-06-30 12:27:03 +02:00
parent 124866ad4f
commit d2d086831e
17 changed files with 857 additions and 86 deletions

View File

@@ -228,6 +228,13 @@ export interface ChatMessage {
updatedAt?: Date;
authorUsername: string;
authorAvatarMime?: string;
/** Id of the message this one replies to, if any. Kept even when the target
* was deleted (the preview fields below then go undefined). */
replyToId?: string;
/** Author/snippet of the replied-to message, for a subtle inline reference.
* Absent when there's no reply, or the target has since been deleted. */
replyToAuthor?: string;
replyToBody?: string;
}
export type RawChatMessage = WithStringDate<ChatMessage>;
@@ -537,6 +544,11 @@ export interface WSChatMessageDeletedMessage {
id: string;
}
export interface WSChatTypingUpdateMessage {
type: "chat_typing_update";
users: OnlineUser[];
}
export type IncomingWSMessage =
| WSPingMessage
| WSWelcomeMessage
@@ -561,7 +573,8 @@ export type IncomingWSMessage =
| WSForceLogoutMessage
| WSChatMessageMessage
| WSChatMessageUpdatedMessage
| WSChatMessageDeletedMessage;
| WSChatMessageDeletedMessage
| WSChatTypingUpdateMessage;
/**
* WebSocket messages — client → server (outgoing)
@@ -590,6 +603,12 @@ export interface WSCommentLikeRemoveMessage {
export interface WSChatSendMessage {
type: "chat_send";
body: string;
replyToId?: string;
}
export interface WSChatTypingMessage {
type: "chat_typing";
typing: boolean;
}
export interface WSChatFocusMessage {
@@ -615,6 +634,7 @@ export type OutgoingWSMessage =
| WSCommentLikeCastMessage
| WSCommentLikeRemoveMessage
| WSChatSendMessage
| WSChatTypingMessage
| WSChatFocusMessage
| WSChatEditMessage
| WSChatDeleteMessage;