vm/{avatar,tree,servers,streams,home,chat,social,studio} and the UI
settings (settings.rs: keys, UiSettings, LastVoice, ClientPlaybackMap,
the audio form) move into voelin-ui-vm with their tests (102 there now;
the 86 view-model tests of voelin-ui all survive, the old list::sync test
became the list::diff tests). They produce the plain bridge structs, with
Rgb for colours and ImageRef for pictures:
- a file picture is ImageSource::File { path, stamp }: the engine writes
a picture that arrives again into the same file, so the length and
write time are part of the reference and a changed file redraws its
row; size() reads the header once per stamp (no toolkit decoder);
- pictures held in memory (chat previews) are ImageSource::Memory;
- the line cache of the chat no longer keeps Slint models alive for
pointer equality: plain lines compare by value, so an unchanged
message makes the same line with or without the cache.
voelin-ui keeps every model as bind::rows::Rows<T>: the plain rows last
shown plus the VecModel, synced with list::diff, converting only the rows
that changed (bind/convert has the From impls). The controllers hand the
view-model rows to Rows::sync and convert forms at the bridge
(`.into()`); crate::vm is now `voelin_ui_vm as vm`, so paths stay.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
39 lines
1.4 KiB
TOML
39 lines
1.4 KiB
TOML
[package]
|
|
name = "voelin-ui-vm"
|
|
version = "0.0.1-alpha"
|
|
description = "Toolkit-free view models of the desktop client: engine state turned into plain rows, shared by the Slint and GPUI front ends."
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
|
|
[lib]
|
|
name = "voelin_ui_vm"
|
|
path = "src/lib.rs"
|
|
|
|
# No UI toolkit here (no slint, no gpui): `cargo tree -p voelin-ui-vm -e normal`
|
|
# must show neither. The front ends convert these types (docs/ui.md).
|
|
[dependencies]
|
|
chrono = { version = "0.4.45", default-features = false, features = ["clock"] }
|
|
# Picture sizes (the header of a file); PNG and JPEG are listed as the
|
|
# front end's toolkit used to bring them.
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp", "bmp", "ico"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
# The Twemoji archive's blocks (raw deflate).
|
|
miniz_oxide = "0.8"
|
|
# Grapheme clusters for emoji in chat text.
|
|
unicode-segmentation = "1.13"
|
|
voelin-audio = { path = "../voelin-audio", default-features = false }
|
|
voelin-core = { path = "../voelin-core", default-features = false, features = ["media"] }
|
|
voelin-gateway-proto = { path = "../voelin-gateway-proto" }
|
|
voelin-model = { path = "../voelin-model" }
|
|
voelin-store = { path = "../voelin-store" }
|
|
|
|
[dev-dependencies]
|
|
png = "0.18"
|
|
serde_json = "1"
|
|
|
|
[lints]
|
|
workspace = true
|