Split the chat controller: the chat view, the user's moves and the lines into voelin-ui-vm

chat/logic.rs now has what the chat view shows (the strip, the lines with
their divider and downloads, the pins, the topics and the counts, as plain
data), the lines of a tab or of an open topic (lines_of, also for the Stream
Studio's chat, with the pokes of a private chat's peer), and what the user's
moves do: select and close a tab, send, ask for older messages, mark read,
react, pin, the topics, download, attach and upload. The Slint side
(chat/bind.rs) writes the Bridge and the models from it and calls the
transitions. Poke and its lines moved to voelin_ui_vm::social.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-21 07:05:58 +03:00
1 parent 0d2ad3f250
commit 02a3b3eab0
10 files changed
+1437 -867

No files matched your search

+7 -5
View File
@@ -29,7 +29,8 @@ crates/voelin-ui-vm/ view models and state, no UI toolkit
previews.rs pictures linked in chat: which to fetch, the transfers
servers.rs tree.rs chat/mod.rs social.rs home.rs streams/mod.rs avatar.rs studio/mod.rs
pure view models (engine state → bridge structs), unit-tested
chat/logic.rs chat tabs, messages and what is read, pins and topics, files
chat/logic.rs chat tabs, messages and what is read, pins and topics, files; the
chat view (tabs, lines, divider, drawers) and the user's moves
streams/logic.rs the streams we share and watch: their state, the events and the
user's choices, the streams panel's, the share card's and the
viewer's rows and texts
@@ -66,11 +67,12 @@ crates/voelin-ui/ the Slint front end
a `voelin_ui_vm::state::AppState` and the window
host.rs SlintHost (the answers the transitions ask for), `App::apply_event`,
`transition` and `perform`: doing what an `Update` says
servers.rs chat.rs members.rs settings_page.rs appearance.rs
servers.rs members.rs settings_page.rs appearance.rs
home.rs social.rs messages.rs events.rs previews.rs popout.rs
the Slint side of each area (social.rs: contacts, the bell and the
search; previews.rs: pictures in chat; popout.rs: the stream's own
window)
chat/ mod.rs, bind.rs: the chat view's Bridge writes and models
settings_pages/ mod.rs (Pages), bind.rs: the settings pages on the Bridge
streams/ mod.rs (Share: the capture), bind.rs: the streams panel, the share
dialog and the viewer on the Bridge, the capture and the decoder
@@ -148,7 +150,7 @@ this file is `voelin_ui_vm::chat`. The boundary:
settings service, the `AppState` and plain rows; they return rows,
commands or messages for the status line, and write no Bridge) and
`<area>/bind.rs` in `voelin-ui` (the Bridge and model writes, windows,
timers, threads, engine commands). Done: `settings_pages`, `studio` and `streams`.
timers, threads, engine commands). Done: `settings_pages`, `studio`, `streams` and `chat`.
The pure code is tested in `voelin-ui-vm` (`cargo test -p voelin-ui-vm`,
no display); the Slint crate's tests are what needs the window types.
@@ -169,7 +171,6 @@ the same shape as `settings_pages` and `studio`: move the decisions into
| File | `.set_` calls | What it mixes |
|---|---|---|
| `chat.rs` | 33 | the chat view: lines, the unread divider, pins, topics and downloads (the engine's history batches, the reads and the gateway's pins and topics are in `chat/logic.rs`) |
| `app.rs` | 31 | setup, the status line, the toolbar and tree refreshes (the event dispatch is `vm::events::apply`) |
| `servers.rs` | 32 | the rail, the server dialog and the channel tree's refresh (the server's name, icon and gateway, joining again and the password are in `events`) |
| `settings_page.rs` | 26 | the audio settings page and the devices |
@@ -185,7 +186,8 @@ Before the work on `voelin-ui-vm` began, `studio.rs` had 64 `.set_` calls
and `settings_pages.rs` 52 (the two with the most, then `streams.rs` with 45;
62 was `studio.rs` once the view models had moved, two setters having
gone with them). Their `bind.rs` files still show 58 and 51 (and
`streams/bind.rs`, split from the 45 of `streams.rs`, 38): the Bridge and
`streams/bind.rs`, split from the 45 of `streams.rs`, 38, and
`chat/bind.rs`, from the 38 of `chat.rs`, 31): the Bridge and
model writes stay where the toolkit is, and what each write says now comes
from `logic.rs`, which has tests of its own.