Split the servers controller: the rail, the card, the tree and the moves into voelin-ui-vm

servers/logic.rs now has what a server does to the state and says in plain
data: which server is shown and forgotten, how it is observed (a plan:
nothing, retry, gateway, query or discover), what finding the gateways
comes to, joining a channel (a move, the password question, or connecting
into it), the members' search, the voice view and the invite link, and the
rail, the server card and the channel tree as rows and values (rail,
toolbar, tree_view, server_tint). The Slint side (servers/bind.rs) keeps
the store, the secrets and the engine commands, and writes the Bridge and
the models from what the logic returns.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-21 12:57:24 +03:00
1 parent 02a3b3eab0
commit 156df9d95b
8 files changed
+1385 -829

No files matched your search

+9 -5
View File
@@ -27,13 +27,15 @@ crates/voelin-ui-vm/ view models and state, no UI toolkit
events/ events::apply: what an engine event does to the AppState
(mod.rs; gateway.rs: the gateway's events and directory)
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
servers/mod.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; 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
servers/logic.rs which server is shown and how it is observed, joining a channel;
the rail, the server card and the channel tree as plain data
settings.rs the UI's settings keys, the audio form
settings_pages/logic.rs, studio/logic.rs
the decisions of the settings pages and of the Stream Studio
@@ -67,12 +69,14 @@ 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 members.rs settings_page.rs appearance.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
servers/ mod.rs, bind.rs: connecting and observing (store, secrets, engine),
the rail, the server card and the tree on the Bridge
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
@@ -150,7 +154,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`, `streams` and `chat`.
timers, threads, engine commands). Done: `settings_pages`, `studio`, `streams`, `chat` and `servers`.
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.
@@ -172,7 +176,6 @@ the same shape as `settings_pages` and `studio`: move the decisions into
| File | `.set_` calls | What it mixes |
|---|---|---|
| `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 |
| `social.rs` | 23 | home's contacts, the bell and the search |
| `dev.rs` | 23 | development switches and the sample data (the switches stay with the window; the sample rows can move) |
@@ -187,7 +190,8 @@ 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, and
`chat/bind.rs`, from the 38 of `chat.rs`, 31): the Bridge and
`chat/bind.rs`, from the 38 of `chat.rs`, 31, and `servers/bind.rs`, from
the 32 of `servers.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.