English
Topic 18. The chat list: a signal store, avatars, new chats and public chat search
Goal: show the user's chats: avatars loaded with the bearer token, a store of chats built on signals, the chat list pane with unread counters, filtering and infinite scrolling, a dialog for new direct chats, groups and channels with user search, and the search for public chats.
Where we are
The first real data on screen (Fig. 18.1). The store of this topic is the client's model of "my chats"; the next topics open a chat and make the list live.
Fig. 18.1. The chat list and what it builds on
- Starting point: topic 17 — sign-in, registration and the shell work; 19 tests pass.
- At the end of the topic the shell shows the user's chats with avatars, unread counts and the last message; new direct chats, groups and channels can be created, and public ones found and joined. 21 tests pass.
Steps
- Avatars and pipes — formatting pipes · protected images as blob URLs · the avatar component with
resource() - The chat store — state in signals · computed totals · pages and details · resetting on sign-out · tests
- New chats and discovery — user search with RxJS · the new-chat dialog · two-way binding with
model()· the discover page - The chat list — the list pane · filtering · infinite scrolling with
IntersectionObserver· the shell with the list · the routes - Checkpoint — what must work, self-check questions and exercises
Materials
- Course slides, part 4, Real time and the TypeScript client (slides "The Angular client", "A signal store", "Responsive UI under a strict CSP")
chats.store.ts,chats.store.spec.tsfeatures/chat-list/,features/new-chat/,features/discover/shared/ui/,blob-url.service.tsDocs/ChatRules.md– chat types, roles and public handles