Followup from the chat sample (`examples/chat/`). The current sample
hardcodes the room list in `shared/rooms.ts`; this issue tracks
making rooms dynamic.
Approach
Replace `DEFAULT_ROOMS` with a DistributedData-backed registry:
```ts
const ROOMS_KEY = 'chat.rooms';
dd.update<ORSet>(ROOMS_KEY, () => ORSet.empty(), s => s.add(replicaId, name));
```
Protocol additions
```ts
type ClientMessage = ... | { type: 'create-room', name: string };
type ServerMessage = ... | { type: 'room-added', name: string }
| { type: 'room-removed', name: string };
```
UI
- "+ New room" button in the rooms panel.
- Subscribe to ORSet changes → push `room-added`/`room-removed` to all clients.
Out of scope (followup)
- Per-room access control (private rooms).
- Room deletion + history archival.
Source: `examples/chat/` README → "Out of scope" section.
Followup from the chat sample (`examples/chat/`). The current sample
hardcodes the room list in `shared/rooms.ts`; this issue tracks
making rooms dynamic.
Approach
Replace `DEFAULT_ROOMS` with a DistributedData-backed registry:
```ts
const ROOMS_KEY = 'chat.rooms';
dd.update<ORSet>(ROOMS_KEY, () => ORSet.empty(), s => s.add(replicaId, name));
```
Protocol additions
```ts
type ClientMessage = ... | { type: 'create-room', name: string };
type ServerMessage = ... | { type: 'room-added', name: string }
| { type: 'room-removed', name: string };
```
UI
Out of scope (followup)
Source: `examples/chat/` README → "Out of scope" section.