Split the development switches: the sample data into voelin-ui-vm

dev/logic.rs now has the sample of VOELIN_DEMO_UI as plain values and as
the events a server would send: the servers and their presence, the
pictures (PNG bytes the front end saves), the chats with their pins and
topics, the contacts, the private chats, the poke, the offline messages,
the gateway's events, the notices and the recordings, and the older pages
that answer scrolling up. The helpers that only look at the state (the
divider of VOELIN_OPEN=unread, the first locked channel) moved with it. The
Slint side (dev/bind.rs) keeps the switches, the window and the screenshot,
and feeds the sample through the app's own events; a test replays the
whole sample through events::handle and checks the state it leaves.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-21 13:57:42 +03:00
1 parent 2d6cbf66af
commit bf72d85a22
11 files changed
+1447 -1036

No files matched your search

+7 -5
View File
@@ -39,6 +39,7 @@ crates/voelin-ui-vm/ view models and state, no UI toolkit
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
dev/logic.rs the sample data of `VOELIN_DEMO_UI` as plain values and events
social/logic.rs the friends, the bell and the search as rows, what the user's moves on
them do, and what an event does to the friends, pokes and notices
settings_page/logic.rs
@@ -93,7 +94,9 @@ crates/voelin-ui/ the Slint front end
(plain values → Slint values), rows.rs (a Slint model kept in step
with a plain list)
images.rs the image cache (LRU, bounded by `ui.image_cache_mb`)
dev.rs development switches (screenshots, sample data)
dev/ mod.rs (the switches, listed), bind.rs: the window's size, the
screenshot, the screens opened at start, the sample data fed through
the app's own events
```
Models are created once (`app::Models`) and updated row by row with
@@ -164,7 +167,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`, `chat`, `servers`, `settings_page` and `social`.
timers, threads, engine commands). Done: `settings_pages`, `studio`, `streams`, `chat`, `servers`, `settings_page`, `social` and `dev`.
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.
@@ -186,7 +189,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`) |
| `dev.rs` | 23 | development switches and the sample data (the switches stay with the window; the sample rows can move) |
| `images.rs` | 13 | the decoded-picture cache |
| `messages.rs` | 12 | direct messages |
| `appearance.rs` | 11 | theme, font scale and breakpoints |
@@ -583,7 +585,7 @@ for importing the official clients' identities on start
the Slint side as `impl App` in `voelin-ui/src/<name>.rs`, with the
decisions in the view-model crate (`<name>/logic.rs`, [Two
crates](#two-crates)).
5. A development switch to open it (`dev.rs`, `VOELIN_OPEN=<name>`), a
5. A development switch to open it (`dev/bind.rs`, `VOELIN_OPEN=<name>`), a
screenshot (below) and a line in this file.
## Settings
@@ -669,7 +671,7 @@ notifications and the home's news show the text on one line
## Development switches and screenshots
Environment variables (see `src/dev.rs`):
Environment variables (see `src/dev/mod.rs`):
- `VOELIN_DEMO_UI=1`: sample servers, channels, members, chat with
formatting and emoji (and two pages of older messages, which load when