Take the text of an offline message in before the redraw, not after it

The social split left the offline message's state change in the front end's
`rest` events, which `perform` handled after it drew the conversations:
`refresh_chats` drew the open message while `dm.mail` was still empty and
the inbox row was still unread, and nothing drew the page again. Before the
split `social_event` wrote both ahead of `social_refresh`.

`Event::OfflineMessage` is now taken in by `social::logic::event` like the
other offline events: the text is `Social::mail`, the inbox row turns read,
and a failure is the status line. `events::apply` no longer parks the event
in `rest`, so a tape test in `voelin-ui-vm` sees it (the mutation that
parks it fails the test). `perform` also handles what is left in `rest`
(a setting, the studio's stream, the request answers) before it draws, as
every such event ran before the redraw ahead of the split.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-24 19:33:29 +03:00
1 parent 81def06144
commit 91d70702f3
6 files changed
+138 -43

No files matched your search

+14 -7
View File
@@ -159,13 +159,20 @@ this file is `voelin_ui_vm::chat`. The boundary:
`Host` (`events/tests.rs`, `social/logic.rs`). `Update::rest` hands back the
events whose state is not in the `AppState`: the Stream Studio's stream
(`StreamState` and `StreamViewers` while `Host::studio_streams_to`),
`SettingChanged`, the offline messages and their requests (`messages.rs`
keeps those for now), and the rest that no screen looks at. The streams we
share and watch are in the `AppState` (`share`, `watch`; the capture and
the decoder are the front end's, and an update says when to attach or drop
them). The friends, the pokes, the bell's notices and what the friends page
and the search keep are in `Social` (`social::logic`), which a front end
passes to `handle` besides the `AppState`.
`SettingChanged`, the answers to the offline message requests
(`RequestDone`, a list that failed; `messages.rs` keeps those for now), and
the rest that no screen looks at. `perform` handles `rest` before it draws
what `Update::refresh` names, as what the front end keeps may be on screen.
The text of an offline message is not in `rest`: `Event::OfflineMessage`
changes the `Social` state (`mail`, and the inbox row turns read) in
`social::logic::event`, so the redraw shows it (a tape test in
`social/logic.rs`). The streams we share and watch are in the `AppState`
(`share`, `watch`; the capture and the decoder are the front end's, and an
update says when to attach or drop them). The friends, the pokes, the
bell's notices, the text of the open
offline message and what the friends page and the search keep are in
`Social` (`social::logic`), which a front end passes to `handle` besides
the `AppState`.
- **Logic and bind.** An area that interleaves decisions with Bridge writes
is split into `<area>/logic.rs` in `voelin-ui-vm` (functions over the
settings service, the `AppState` and plain rows; they return rows,