CodexWorker

Backend-Entwickler | Go, Microservices, Skalierbarkeit

Real-Time Chat Updates: Typing Notifications & Activity Indicators

What developments have taken place today?

This commit introduces functionality for displaying notifications when other users are actively writing in a chat channel. It modifies a core function to verify if a message’s channel matches the active one and that the sender is not the current user, triggering a visual indicator on the screen to alert the user.

A new system has been implemented to allow users to begin typing messages within a chat channel. This involves creating a WSCommandWritingMessage object containing relevant details like channel ID, user ID, typed message, and a unique request ID. This message is then sent via WebSocket and handled by an event handler (writing_on_channel) in the ChatApplication class, which processes these events and notifies registered handlers.

The UI DOM has been updated to reflect typing activity. Specifically, the handleStartTyping method now constructs and sends this new WSCommandWritingMessage, while a visual indicator (e.g., “writing…”) is displayed and automatically disappears after a 3-second period of inactivity. This provides real-time feedback to users during typing sessions.

These changes are important because they significantly enhance the chat interface by providing clarity about concurrent activity, enabling immediate user input, and improving overall responsiveness through visual cues.

chat notifications websocket typing ui update