feat(chat): people's read receipts beside agents', and a reciprocal DM setting
What
The "seen" faces under messages now show the people who read, not only the agents, in the same stack and spot, with the same "one seen per run" rule. You never see your own face. The popover says "Visto por Bruno Lima e Claude Code de Ana Souza", with a little more room under that line.
There is also a new setting, Settings › Conta › "Confirmação de leitura", on by default and reciprocal in DMs (as in WhatsApp). The server enforces it.
Why
Valls: "queria ter o read não só dos agents, mas dos users também".
Root cause: the faces come from the room's receipts list (Book.receiptsList, now receiptsFor). Until now it was filled only from agents' cursors (src/agent.ts → Book.receipt). People's read points were stored only in D1 human_reads, for the unread dots, and never reached the room. Nothing in the UI filtered people out; the room never received their reads.
What changed
- Server, read point:
Book.markReadruns when someone opens the room, and for everyone who has the room open when a message lands. It now also writes that person's read point as a receipt (p:<email>, read = delivered: an open room is what they saw).- It rides the existing coalesced
receiptspush (at most one every ~2s per room), so scrolling or a burst of posts doesn't spam. - The list goes out only on the room's member sockets.
- People have their own limit (50), so they can't push agents out of the 20 agent rows.
- It rides the existing coalesced
- Client (
messageFooters,MessageFooter):- A person's face never sits on their own message, and yours is never shown.
- People come before agents, read before delivered.
- A person's face has no agent badge.
- The "one seen per run" rule can move a face past where the person read. Then the popover says "leu em parte" instead of "recebeu".
- Setting:
users.read_receipts(ALTERS), returned in/api/measread_receipts, saved byPOST /api/me/read-receipts. The toggle is in Settings › Conta, with a one-line explanation.- In a DM, if either person has it off,
receiptsFordrops every person's read point. This covers the snapshot, the light/roomread and every push. - Changing the setting re-pushes the receipts of all your DMs, so the other person's tab updates at once.
- Rooms ignore the setting. Agents' reads are never hidden.
- In a DM, if either person has it off,
Checks run
bun run check: pass (after rebasing on main)bun test --conditions=browser scripts/ui-panels.test.ts: 171 pass. New: a stack with people and agents (no badge on a person, not yourself, names in the popover, the live move) and the setting toggle (saves, goes back when saving fails)bun test scripts/chat.test.ts scripts/read-receipts.test.ts: pass. New: placement and order of people's faces; server tests for person receipts, the DM reciprocal rule, and rooms ignoring the settingbun run test:design-system: pass (gallery and inbox)bun run screens -- --hover --receipts --publish: pass. The new--receiptsflag fails if a message doesn't have the faces it should. It shares the test-agent OAuth setup with--choices(connectTestAgent).
Router bench
not touched
Deliberate decisions
none
Screens















The popover in these screens opens over earlier lines. On a room's first message it opens upward and the chat column clips it; that was already true for agents' popovers before this change. The screens close the "Começando a sala" card first, as a used room has it.
🤖 Generated with Claude Code
Summary by cubic
Shows people's read receipts in the seen stack under messages, next to agents', and adds a reciprocal DM read-receipts setting.
Book.markReadnow writes a person's open-room point as a receipt, riding the existing coalesced receipts push.- The footer shows one face per person: never your own, never on their own message, people before agents, no agent badge; the popover reads "Visto por Ana, Bia e Claude de Ana".
- New Settings › Conta toggle "Confirmação de leitura" (on by default) returns
read_receiptsin/api/meand saves viaPOST /api/me/read-receipts. - In DMs, either person off makes the server drop everyone's person read points; toggling re-pushes all your DMs. Rooms ignore it and agents' reads stay.
- Adds
--receiptsscreens and tests for placement, the stack, and the DM rule.