Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Then open:
http://127.0.0.1:8002
```

PrivateChat demonstrates global chat plus direct 1:1 private conversations. A direct message is delivered only to the sender and the selected recipient.
PrivateChat demonstrates global chat, direct 1:1 conversations, private group rooms, unread badges, typing indicators and simple message receipts.

## Requirements

Expand Down
43 changes: 39 additions & 4 deletions examples/private-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ It demonstrates:
- Online users list.
- Global room.
- Private direct 1:1 conversations.
- Private group rooms with selected online users.
- Direct messages delivered only to the sender and the selected recipient.
- Typing indicators for global and direct conversations.
- Group messages delivered only to selected members.
- Unread badges for global, direct and private group conversations.
- Typing indicators for global, direct and private group conversations.
- Simple message receipts for sent, received and read states.
- Safe rendering with `textContent`.
- Plain HTML, CSS and JavaScript.
Expand Down Expand Up @@ -75,8 +78,40 @@ Expected behavior:
- Duplicate names are rejected.
- User messages are rendered safely without `innerHTML`.

## Important notes
## Private group rooms

PrivateChat also supports private group rooms.

A user can click `+ New private room`, select online users, optionally name the room, and create a private conversation.

Only selected members receive the room and its messages.

## Manual group test

This phase implements direct 1:1 private messaging.
Open four browser tabs:

```txt
Tab 1: William
Tab 2: Ana
Tab 3: Bruno
Tab 4: Carla
```

Expected behavior:

- William creates a room with Ana and Bruno.
- William, Ana and Bruno see the new room.
- Carla does not see the room.
- Messages in that room are delivered only to William, Ana and Bruno.
- Carla receives no group messages.
- Unread badges appear when a message arrives in a room that is not currently open.

## Unread badges

PrivateChat displays unread badges for Global Room, direct conversations and private group rooms.

Badges increase while a conversation is not open and reset when the conversation is opened.

## Important notes

Private group rooms are implemented in the next phase.
This phase implements direct 1:1 private messaging and private group rooms.
Loading
Loading