Skip to content

Commit 672b6e1

Browse files
authored
Merge pull request #8 from micilini/phase-08-private-group-rooms
phase 08: add private group rooms and unread badges
2 parents df5d6a1 + f4f2a82 commit 672b6e1

9 files changed

Lines changed: 1009 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Then open:
122122
http://127.0.0.1:8002
123123
```
124124

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

127127
## Requirements
128128

examples/private-chat/README.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ It demonstrates:
88
- Online users list.
99
- Global room.
1010
- Private direct 1:1 conversations.
11+
- Private group rooms with selected online users.
1112
- Direct messages delivered only to the sender and the selected recipient.
12-
- Typing indicators for global and direct conversations.
13+
- Group messages delivered only to selected members.
14+
- Unread badges for global, direct and private group conversations.
15+
- Typing indicators for global, direct and private group conversations.
1316
- Simple message receipts for sent, received and read states.
1417
- Safe rendering with `textContent`.
1518
- Plain HTML, CSS and JavaScript.
@@ -75,8 +78,40 @@ Expected behavior:
7578
- Duplicate names are rejected.
7679
- User messages are rendered safely without `innerHTML`.
7780

78-
## Important notes
81+
## Private group rooms
82+
83+
PrivateChat also supports private group rooms.
84+
85+
A user can click `+ New private room`, select online users, optionally name the room, and create a private conversation.
86+
87+
Only selected members receive the room and its messages.
88+
89+
## Manual group test
7990

80-
This phase implements direct 1:1 private messaging.
91+
Open four browser tabs:
92+
93+
```txt
94+
Tab 1: William
95+
Tab 2: Ana
96+
Tab 3: Bruno
97+
Tab 4: Carla
98+
```
99+
100+
Expected behavior:
101+
102+
- William creates a room with Ana and Bruno.
103+
- William, Ana and Bruno see the new room.
104+
- Carla does not see the room.
105+
- Messages in that room are delivered only to William, Ana and Bruno.
106+
- Carla receives no group messages.
107+
- Unread badges appear when a message arrives in a room that is not currently open.
108+
109+
## Unread badges
110+
111+
PrivateChat displays unread badges for Global Room, direct conversations and private group rooms.
112+
113+
Badges increase while a conversation is not open and reset when the conversation is opened.
114+
115+
## Important notes
81116

82-
Private group rooms are implemented in the next phase.
117+
This phase implements direct 1:1 private messaging and private group rooms.

0 commit comments

Comments
 (0)