|
|
|
@@ -50,8 +50,9 @@ crates/voelin-ui-vm/ view models and state, no UI toolkit
|
|
|
|
|
bbcode.rs emoji.rs chat formatting; the Twemoji archive, text → runs of text and emoji
|
|
|
|
|
crates/voelin-gpui/ the GPUI front end, under construction (binary voelin-gpui; gpui-kit
|
|
|
|
|
pinned exactly); it uses voelin-ui-vm and the engine, not voelin-ui:
|
|
|
|
|
the root state, the theme, Inter and Lucide, the swatch page, the
|
|
|
|
|
cost meter ([The GPUI front end](#the-gpui-front-end))
|
|
|
|
|
the root state and the store, the desktop shell, the theme, Inter
|
|
|
|
|
and Lucide, the swatch page, the cost meter
|
|
|
|
|
([The GPUI front end](#the-gpui-front-end))
|
|
|
|
|
crates/voelin-ui/ the Slint front end
|
|
|
|
|
ui/
|
|
|
|
|
app.slint MainWindow: picks the shell, puts the page's screens in it, dialogs
|
|
|
|
@@ -967,58 +968,91 @@ conditions it settled, are in [design/gpui-spikes.md](design%2Fgpui-spikes).
|
|
|
|
|
crates/voelin-gpui/
|
|
|
|
|
build.rs the client's 147 Lucide icons as a table of include_bytes!
|
|
|
|
|
src/
|
|
|
|
|
main.rs lib.rs `run()`: logging, the engine's runtime, the window; closing it
|
|
|
|
|
tells the engine to close the sessions, ends the app and, when
|
|
|
|
|
there were sessions, waits 500 ms for the engine to send the
|
|
|
|
|
main.rs lib.rs `run()`: logging, the engine's runtime, the store, the window (opened
|
|
|
|
|
where it was left); closing it keeps the window's place and the
|
|
|
|
|
settings, tells the engine to close the sessions, ends the app and,
|
|
|
|
|
when there were sessions, waits 500 ms for the engine to send the
|
|
|
|
|
closes before the runtime goes (as the Slint front end does)
|
|
|
|
|
engine.rs HostedEngine: Engine::start on a tokio runtime, its events
|
|
|
|
|
forwarded into a channel the window reads
|
|
|
|
|
app.rs AppState, the root Entity: the voelin-ui-vm state and Social,
|
|
|
|
|
the three loops (events, tick, Later), the one line of state
|
|
|
|
|
view.rs MainView: the status line, the shell's page (empty), the swatch
|
|
|
|
|
backend.rs the store at start: the client's database in the data directory,
|
|
|
|
|
the settings service on it with the UI's keys, the secrets, the
|
|
|
|
|
default identity; what the engine is handed (history, settings)
|
|
|
|
|
app.rs AppState, the root Entity: the voelin-ui-vm state and Social, the
|
|
|
|
|
backend, the three loops (events in batches, a quiet tick, Later)
|
|
|
|
|
and the callbacks of the Slint `bind/servers.rs` that the shell has
|
|
|
|
|
view.rs MainView, the window's root view: the shell or the swatch, the
|
|
|
|
|
handlers of the actions, the server form, the title, the window's place
|
|
|
|
|
shell/ the desktop shell (below): rail.rs, sidebar.rs, topbar.rs,
|
|
|
|
|
main_panel.rs, form.rs, toast.rs, actions.rs, widgets.rs
|
|
|
|
|
swatch.rs the swatch page (every token, widgets, icons)
|
|
|
|
|
theme/ VoelinTheme: tokens.rs, components.rs, slint_parity.rs (test)
|
|
|
|
|
fonts.rs Inter, from crates/voelin-ui/ui/assets/fonts
|
|
|
|
|
assets.rs icons/<name>.svg: the client's set before gpui-kit-assets'
|
|
|
|
|
assets.rs icons/<name>.svg: the client's set before gpui-kit-assets'; logo.svg
|
|
|
|
|
dev.rs the development switches
|
|
|
|
|
meter.rs the cost meter
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- **The root state.** `AppState` (an `Entity`) holds `voelin_ui_vm::state::AppState<Vec<ChatLine>>`
|
|
|
|
|
and `Social`; `events::handle` is its one dispatch, as in the Slint front end,
|
|
|
|
|
and the `Update` it returns is carried out as far as this front end has the
|
|
|
|
|
parts: the engine's commands go out, the warnings are logged, the rest
|
|
|
|
|
(what to redraw, what to keep, the streams' capture and decoder) is for the
|
|
|
|
|
slices that have those parts. Three loops start with it and end when the
|
|
|
|
|
entity is released: **the engine's events** (a foreground task awaits the
|
|
|
|
|
tokio receiver, `this.update(cx, ...)`, `cx.notify()`; a tokio channel needs
|
|
|
|
|
no reactor, so GPUI's executor polls it); **the tick**, once a second, a loop
|
|
|
|
|
of `background_executor().timer`; and **`Later`**: GPUI's `AsyncApp` is not
|
|
|
|
|
`Send`, so a hotkey, camera or decoder thread holds a `Later` and calls
|
|
|
|
|
`later.run(|app, cx| ...)`, a queue a third foreground task drains with the
|
|
|
|
|
entity, as `later(|app| ...)` does in Slint. The window shows one line:
|
|
|
|
|
the version, the voice connections up, the engine events handled, the seconds
|
|
|
|
|
up; each part moves by one of the loops. The window's start shows no store:
|
|
|
|
|
the shell slice opens it with the settings and the bookmarks.
|
|
|
|
|
and `Social`, and the `Backend` (the store, the settings, the secrets);
|
|
|
|
|
`events::handle` is its one dispatch, as in the Slint front end, and the
|
|
|
|
|
`Update` it returns is carried out as far as this front end has the parts:
|
|
|
|
|
the engine's commands go out, the status line is set (the toast shows it),
|
|
|
|
|
what is to be kept goes to the store and the settings (a bookmark, the UI's
|
|
|
|
|
settings, the audio settings, the clients' volumes), a changed `ui.theme` or
|
|
|
|
|
`ui.font_scale` reaches the theme, the warnings are logged; the rest (what to
|
|
|
|
|
redraw, the notices, the pictures to decode, the streams' capture and
|
|
|
|
|
decoder) is for the slices that have those parts. Three loops start with it
|
|
|
|
|
and end when the entity is released: **the engine's events** (a foreground
|
|
|
|
|
task awaits the tokio receiver, takes what is queued, up to 64 events, in one
|
|
|
|
|
update with one `cx.notify()`, and yields to GPUI's executor before the next
|
|
|
|
|
step: a server's first sync neither starves the window nor draws it once per
|
|
|
|
|
event; a tokio channel needs no reactor, so GPUI's executor polls it); **the
|
|
|
|
|
tick**, once a second, a loop of `background_executor().timer`, which keeps
|
|
|
|
|
what is due (the window's place) and **notifies nobody**: nothing the shell
|
|
|
|
|
shows moves with the clock, so a window nobody touches is not drawn; and
|
|
|
|
|
**`Later`**: GPUI's `AsyncApp` is not `Send`, so a hotkey, camera or decoder
|
|
|
|
|
thread (or the gateway lookup on the engine's runtime) holds a `Later` and
|
|
|
|
|
calls `later.run(|app, cx| ...)`, a queue a third foreground task drains with
|
|
|
|
|
the entity, as `later(|app| ...)` does in Slint. The root notifies on every
|
|
|
|
|
batch and every move of the user's; the views compare what they would show
|
|
|
|
|
with what they showed and tell the window only when it differs
|
|
|
|
|
([The desktop shell](#the-desktop-shell)).
|
|
|
|
|
- **Tests**: the unit tests need no display (GPUI's test platform, `#[gpui::test]`, with
|
|
|
|
|
`gpui-pre`'s `test-support` as a dev-dependency beside gpui-kit's own pin: its
|
|
|
|
|
`test-support` feature would make Cargo lock the unused `gpui-fast` backend and
|
|
|
|
|
pin taffy 0.15.0): an injected engine event, a real engine's event, the tick
|
|
|
|
|
and a job from another thread reach the entity; the theme reaches
|
|
|
|
|
gpui-component, follows the window's appearance and the text size; the
|
|
|
|
|
Slint file's tokens equal the Rust ones (below); the icons and fonts load.
|
|
|
|
|
`tests/launch_failure.rs` starts the built binary where its window cannot
|
|
|
|
|
open (below): one of its two cases needs the test display of
|
|
|
|
|
`VOELIN_X11_TEST_DISPLAY` and is skipped without it, as the X11 tests of
|
|
|
|
|
the other crates are. `cargo test -p voelin-gpui`.
|
|
|
|
|
pin taffy 0.15.0): the root state (a burst of events is taken in steps, the tick
|
|
|
|
|
is quiet, a job from another thread reaches the entity, the store's servers are
|
|
|
|
|
the rail's, a server is saved, edited, removed and selected, a connect and the
|
|
|
|
|
other commands reach the engine's wire, the sample servers send nothing, the
|
|
|
|
|
window's place is kept and found again, the theme follows the settings and a
|
|
|
|
|
switch), the shell on a drawn window that the tests click (a server added is in
|
|
|
|
|
the rail, a click selects it and titles the window, an engine event updates the
|
|
|
|
|
rail and the cards, the form adds and removes, the toast goes, an idle window is
|
|
|
|
|
not told), a connect through a real engine that has no connector (it answers
|
|
|
|
|
that none serves the address, which reaches the status line), the store on a
|
|
|
|
|
directory of its own, the theme (it reaches gpui-component, follows the window's
|
|
|
|
|
appearance and the text size), the Slint file's tokens equal the Rust ones
|
|
|
|
|
(below), the icons and fonts load. `tests/launch_failure.rs` starts the built
|
|
|
|
|
binary where its window cannot open (below): one of its two cases needs the test
|
|
|
|
|
display of `VOELIN_X11_TEST_DISPLAY` and is skipped without it, as the X11 tests
|
|
|
|
|
of the other crates are. `cargo test -p voelin-gpui`.
|
|
|
|
|
|
|
|
|
|
### Running it
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cargo run -p voelin-gpui --release # the window and its one line of state
|
|
|
|
|
cargo run -p voelin-gpui --release # the desktop shell, on the client's store
|
|
|
|
|
VOELIN_DEMO_UI=1 cargo run -p voelin-gpui --release # the sample servers, nothing kept
|
|
|
|
|
VOELIN_OPEN=swatch VOELIN_DEV_THEME=light cargo run -p voelin-gpui --release
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The shell opens the client's database in the data directory (the platform's,
|
|
|
|
|
`~/.local/share/voelin` on Linux; `VOELIN_DATA_DIR` moves it) that the Slint
|
|
|
|
|
front end uses too, so the servers saved in one are the other's; **a run that
|
|
|
|
|
is not the user's own (a test, a screenshot, a measurement) sets
|
|
|
|
|
`VOELIN_DATA_DIR`** and, for the logs, the XDG directories (the headless
|
|
|
|
|
scripts below do).
|
|
|
|
|
|
|
|
|
|
GPUI draws through wgpu: it needs a Vulkan driver (Mesa's RADV, ANV or NVK,
|
|
|
|
|
NVIDIA's) or OpenGL at run time; in a virtual machine, a remote desktop or
|
|
|
|
|
CI, Mesa's lavapipe (`mesa-vulkan-drivers`) draws in software. The binary
|
|
|
|
@@ -1055,21 +1089,26 @@ anyway).
|
|
|
|
|
| Switch | Does |
|
|
|
|
|
|---|---|
|
|
|
|
|
| `VOELIN_OPEN=swatch` | the swatch page in place of the shell; the Slint front end's other pages are not here yet and are named in a warning |
|
|
|
|
|
| `VOELIN_DEV_THEME=dark\|light\|system` | the theme mode (the settings' `ui.theme` will give it) |
|
|
|
|
|
| `VOELIN_FONT_SCALE=1.25` | the text size factor (`ui.font_scale`) |
|
|
|
|
|
| `VOELIN_WINDOW_SIZE=1440x960` | the window's size |
|
|
|
|
|
| `VOELIN_METER=1` | the cost meter: once a second a log line (`voelin_gpui::meter`) with the process's CPU, the CPU of each group of threads (`llvmpipe` is the software renderer, work a GPU takes over; `voelin-gpui` is GPUI's thread), the resident memory, the app's own counters per second (engine events, ticks, renders, `Later` jobs) and the voice connections up |
|
|
|
|
|
| `VOELIN_DEMO_UI=1` | the Slint front end's sample servers (`voelin_ui_vm::dev::logic`) in place of the stored ones, through the app's own events (the first is connected, the second observed); nothing is sent to the engine or kept in the store, the window's place included, and the servers cannot be changed |
|
|
|
|
|
| `VOELIN_DEV_THEME=dark\|light\|system` | the theme mode, in place of the settings' `ui.theme` |
|
|
|
|
|
| `VOELIN_FONT_SCALE=1.25` | the text size factor, in place of the settings' `ui.font_scale` |
|
|
|
|
|
| `VOELIN_WINDOW_SIZE=1440x960` | the window's size, in place of the remembered one (`ui.window`), which it then leaves alone: the window's place is not kept while it is set |
|
|
|
|
|
| `VOELIN_METER=1` | the cost meter: once a second a log line (`voelin_gpui::meter`) with the process's CPU, the CPU of each group of threads (`llvmpipe` is the software renderer, work a GPU takes over; `voelin-gpui` is GPUI's thread), the resident memory, the app's own counters per second (engine events, ticks, renders: one render is one pass of the window's root view, a frame; `Later` jobs) and the voice connections up |
|
|
|
|
|
|
|
|
|
|
Screenshots are made headless, the way `scripts/shots.sh` makes the Slint
|
|
|
|
|
ones: `scripts/gpui-shot.sh out.png swatch 1440x960` runs the binary under
|
|
|
|
|
`xvfb-run`, takes the window with `xwd`, closes it with Alt+F4 when a window
|
|
|
|
|
manager is there (else TERM) and says how the app ended. On NixOS, with the
|
|
|
|
|
spikes' environment (a headless X display with openbox, lavapipe as the only
|
|
|
|
|
Vulkan driver, the XDG directories and the D-Bus bus private):
|
|
|
|
|
`xvfb-run`, takes the window with `xwd` (found by its title, "Voelin" and
|
|
|
|
|
"Voelin - <server>"), closes it with Alt+F4 when a window manager is there
|
|
|
|
|
(else TERM) and says how the app ended; `VOELIN_DEMO_UI=1` in its environment
|
|
|
|
|
puts a server on screen. On NixOS, with the spikes' environment (a headless X
|
|
|
|
|
display with openbox, lavapipe as the only Vulkan driver, the XDG directories
|
|
|
|
|
and the D-Bus bus private):
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
GPUI_SHOT_HEADLESS=1 DELAY=4 VOELIN_DEV_THEME=dark spikes/gpui/shell.sh \
|
|
|
|
|
spikes/gpui/headless.sh -- scripts/gpui-shot.sh docs/ui/gpui-swatch-dark.png swatch 1440x960
|
|
|
|
|
GPUI_SHOT_HEADLESS=1 DELAY=4 VOELIN_DEMO_UI=1 VOELIN_DEV_THEME=dark spikes/gpui/shell.sh \
|
|
|
|
|
spikes/gpui/headless.sh -- scripts/gpui-shot.sh docs/ui/gpui-shell-server-dark.png "" 1440x960
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Wayland, the desktop's session bus and its portals are out of the environment,
|
|
|
|
@@ -1081,6 +1120,149 @@ colours would change the tokens' values).
|
|
|
|
|

|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
### The desktop shell
|
|
|
|
|
|
|
|
|
|
Slice 1 of plan section 6 step 3: the frame of `ui/shells/desktop.slint` and
|
|
|
|
|
the server callbacks of the Slint `bind/servers.rs` (about 13 properties and 11
|
|
|
|
|
callbacks), on the client's store.
|
|
|
|
|
|
|
|
|
|
| Empty (no server) | A server on screen |
|
|
|
|
|
|---|---|
|
|
|
|
|
|  |  |
|
|
|
|
|
|  |  |
|
|
|
|
|
|
|
|
|
|
The pictures are the shell at 1440 by 960 under `scripts/gpui-shot.sh`; the
|
|
|
|
|
server on screen is the first of the sample servers (`VOELIN_DEMO_UI=1`),
|
|
|
|
|
connected, with its voice card and the user's card. `gpui-shell-form-dark.png`
|
|
|
|
|
is the server form.
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
What is on screen, each part an entity of `crates/voelin-gpui/src/shell/` that
|
|
|
|
|
observes the root state, makes its view of it (`voelin_ui_vm::servers::logic`:
|
|
|
|
|
`rail`, `toolbar`) and tells the window only when the view differs from the one
|
|
|
|
|
it showed: an engine event about a talker, a setting that is not the theme's or
|
|
|
|
|
a tick draws nothing (the `what_changes_nothing_shown_draws_nothing` test counts
|
|
|
|
|
the parts told).
|
|
|
|
|
|
|
|
|
|
- **The rail** (`rail.rs`): the app's mark, then the saved servers as 46 pixel
|
|
|
|
|
rounded squares (the server's icon from the engine's cache, else its initials
|
|
|
|
|
on its tint), a dot for the state (green: voice connected, blue: observed
|
|
|
|
|
invisibly, amber: connecting), the unread count, a red dot while someone
|
|
|
|
|
streams, the pill and the ring of the one on screen; a click selects, a second
|
|
|
|
|
click edits; the plus adds a server and the gear is the settings button.
|
|
|
|
|
- **The top bar** (`topbar.rs`): the page's title (the server on screen, else
|
|
|
|
|
"Voelin"), the search box and the settings button, which log that their
|
|
|
|
|
slices are to come (`OpenSearch`, `OpenSettings`).
|
|
|
|
|
- **The sidebar** (`sidebar.rs`): the server on screen (name, "9 online · 9
|
|
|
|
|
channels" once its presence is known, else its address), the place of the
|
|
|
|
|
channel tree (slice 2), the voice card while voice is connecting or connected
|
|
|
|
|
(the channel we are in, copy an invite, disconnect, and Hold to talk when the
|
|
|
|
|
transmit mode is push-to-talk) and the user's card (nickname, Online,
|
|
|
|
|
Observing or Offline, the microphone and sound buttons, which work with
|
|
|
|
|
voice).
|
|
|
|
|
- **The main area** (`main_panel.rs`): "No server selected" with an Add a server
|
|
|
|
|
button, or the server on screen (name, address, its state) with Connect or
|
|
|
|
|
Disconnect and Edit, until the pages of the next slices come.
|
|
|
|
|
- **The server form** (`form.rs`), in the place of the main area until the
|
|
|
|
|
dialogs slice: address (all a server needs), name (empty: the server's own),
|
|
|
|
|
nickname (the default identity's, else the system user's) and the server's
|
|
|
|
|
password (kept in the secrets, not in the database); Save, Save and connect,
|
|
|
|
|
Cancel, and for a saved server Remove, which asks twice. Enter saves.
|
|
|
|
|
- **The toast** (`toast.rs`): the status line ("Connecting to ts.example…", "A
|
|
|
|
|
server needs an address") for five seconds.
|
|
|
|
|
|
|
|
|
|
The window's title is "Voelin" and "Voelin - <server>" with one on screen. Its
|
|
|
|
|
minimum size is 640 by 480.
|
|
|
|
|
|
|
|
|
|
The eleven callbacks of `bind/servers.rs` that the shell has are GPUI actions
|
|
|
|
|
(`shell/actions.rs`); a click dispatches one with `Window::dispatch_action`,
|
|
|
|
|
`MainView` handles it, and the handler asks the root state for what the Slint
|
|
|
|
|
callback did, through `voelin-ui-vm`'s `servers::logic` and the engine's
|
|
|
|
|
commands:
|
|
|
|
|
|
|
|
|
|
| Slint callback | Action | What it does |
|
|
|
|
|
|---|---|---|
|
|
|
|
|
| `select_server` | `SelectServer { id }` | `logic::select_server`, then observes the server invisibly: through its gateway, else its own query login, else the gateway is looked up on the engine's runtime first (`logic::observe_plan`, `discover_wanted`, `gateway_found`) |
|
|
|
|
|
| `connect_voice` | `ConnectVoice` | `Command::ConnectVoice` with the bookmark's address, nickname and default channel, its identity, its password from the secrets |
|
|
|
|
|
| `disconnect_voice` | `DisconnectVoice` | `Command::DisconnectVoice` |
|
|
|
|
|
| `set_input_muted`, `set_output_muted` | `SetInputMuted { muted }`, `SetOutputMuted { muted }` | the same commands |
|
|
|
|
|
| `push_to_talk` | `PushToTalk { on }` | `Command::SetTransmitting`: on at the button's press, off at its release, on or off the button |
|
|
|
|
|
| `edit_bookmark` | `EditServer { id }` | opens the form with `servers::form` |
|
|
|
|
|
| `save_bookmark` | `SaveServer` | `logic::bookmark_from_form`, the store, the secrets; shows the server |
|
|
|
|
|
| `save_and_connect` | `SaveAndConnect` | saves, then connects into the form's channel or the default one (`servers::connect_to`) |
|
|
|
|
|
| `delete_bookmark` | `DeleteServer { id }` | `CloseSession`, the secrets and the store, `logic::forget_server` |
|
|
|
|
|
| `invite` | `Invite` | `logic::invite_link`, the link on the clipboard, the status line's note |
|
|
|
|
|
|
|
|
|
|
The others of that file are the next slices': `search_members`,
|
|
|
|
|
`show_voice_view`, `join_channel`, `join_with_password`, `toggle_collapse`,
|
|
|
|
|
`open_client` and `client_audio_changed` (the channel tree, the members, the
|
|
|
|
|
voice page), and `copied`, which the Slint toast of a copy needs and `Invite`
|
|
|
|
|
does for itself. `AddServer`, `CancelServerForm`, `OpenSearch` and
|
|
|
|
|
`OpenSettings` are the shell's own.
|
|
|
|
|
|
|
|
|
|
**The store at start** (`backend.rs`) is `run()` of the Slint front end through
|
|
|
|
|
`voelin-ui-vm`: the client's database at `<data dir>/client.db` (bookmarks,
|
|
|
|
|
identities, chat read marks), the settings service on it with the UI's keys
|
|
|
|
|
(and `config.toml` and the `VOELIN_SETTING_*` variables below the stored
|
|
|
|
|
values), the secrets (the OS keyring, memory where it refuses, memory alone
|
|
|
|
|
with the sample servers), the default identity (made and kept when there is
|
|
|
|
|
none), and the engine handed the chat history and the settings. The theme mode
|
|
|
|
|
and the text size come from the settings (`ui.theme`, `ui.font_scale`), a
|
|
|
|
|
development switch winning, and follow them when the engine reports a change.
|
|
|
|
|
Left out against the Slint front end, for later slices: importing the
|
|
|
|
|
identities of the official TeamSpeak clients at start (it reads the user's own
|
|
|
|
|
files: it comes with the identities page), the crash reports, `--set` on the
|
|
|
|
|
command line, `stream_peer` of a connect (what this front end can decode is for
|
|
|
|
|
the stream viewer's slice) and the stream effects of an update.
|
|
|
|
|
|
|
|
|
|
**The window's place** is the setting `ui.window` (`voelin_ui_vm::settings::
|
|
|
|
|
WindowState`: size, position where the platform tells one, maximized; none until
|
|
|
|
|
a run has left one; a value out of any screen's reach is refused in words). The
|
|
|
|
|
window reports where it is when it moves or changes size, the root state keeps
|
|
|
|
|
it at the next tick and at close, and the next run opens there: the size always,
|
|
|
|
|
the position when a screen still shows its corner and the window manager lets a
|
|
|
|
|
window choose (GPUI asks X11 for the place, and openbox, like most window
|
|
|
|
|
managers, places new windows itself; Wayland tells no position at all, so none
|
|
|
|
|
is kept there), maximized if it was. A development switch that sets the size or
|
|
|
|
|
the sample data leaves it alone.
|
|
|
|
|
|
|
|
|
|
**What the shell costs idle** (`VOELIN_METER=1`, release build of the shell
|
|
|
|
|
commit `6b4341a`, the later ones change nothing that runs while idle; 1440 by
|
|
|
|
|
960 on Mesa 26.2.5's lavapipe through Vulkan on Xvfb `:97`
|
|
|
|
|
with openbox, the machine's other jobs at a load average of 10 to 27; the
|
|
|
|
|
first 15 seconds of 75 left out, 60 samples of one second; CPU in percent of
|
|
|
|
|
one core, whose resolution is the 1 % of a clock tick):
|
|
|
|
|
|
|
|
|
|
| | CPU, mean (max) | Resident memory | Renders per second | Ticks per second |
|
|
|
|
|
|---|---|---|---|---|
|
|
|
|
|
| The empty shell (no server) | 0.3 % (2 %) | 191.7 MiB | 0.0 | 1.0 |
|
|
|
|
|
| The sample servers, the first connected (`VOELIN_DEMO_UI=1`) | 0.5 % (2 %) | 192.7 MiB | 0.0 | 1.0 |
|
|
|
|
|
|
|
|
|
|
A window nobody touches is not drawn (a render is one pass of `MainView`, so
|
|
|
|
|
one frame of the window): the foundation's tick told the root once a second,
|
|
|
|
|
which drew the window once a second by construction (not measured on that
|
|
|
|
|
commit). The software renderer's threads (`llvmpipe`) show nowhere in the
|
|
|
|
|
lines: they had no work. What the shell costs while it is used (the events of a
|
|
|
|
|
connect, a click, the form's typing) is not measured here: a frame takes a
|
|
|
|
|
frame's work on the GPU and, on this machine's software device, the CPU
|
|
|
|
|
(docs/design/gpui-spikes.md has the per-frame figures of the spikes).
|
|
|
|
|
|
|
|
|
|
**Seen against a server** (the TeamSpeak 3 development server of
|
|
|
|
|
`dev/docker-compose.yml`, 3.13.8, release build, the same headless display and
|
|
|
|
|
no sound card or sound server: `ALSA_CONFIG_PATH` empty, the XDG runtime
|
|
|
|
|
directory private): the server added through the form with Save and connect
|
|
|
|
|
shows its client (`clientlist -voice` over ServerQuery), the window's title and
|
|
|
|
|
the rail take the server's own name ("TeamSpeak ]I[ Server"), the voice card
|
|
|
|
|
says "Voice Connected"; the user card's buttons mute the microphone and the
|
|
|
|
|
sound, which the server sees (`client_input_muted=1`, `client_output_muted=1`);
|
|
|
|
|
the voice card's disconnect leaves the server (no client), the main area's
|
|
|
|
|
Connect joins again, and closing the window with Alt+F4 while connected ends
|
|
|
|
|
the app with exit status 0 and leaves **no ghost client** on the server after
|
|
|
|
|
two seconds. (The close found a panic in the foundation's wait for the engine's
|
|
|
|
|
closes, which no run had reached; it is fixed and a test calls the wait from
|
|
|
|
|
the GPUI thread.)
|
|
|
|
|
|
|
|
|
|
### The theme
|
|
|
|
|
|
|
|
|
|
Two layers (docs/design/gpui-spikes.md, "The theme against Theme tokens"):
|
|
|
|
@@ -1139,10 +1321,15 @@ draws the icons the client draws and the rest of the catalogue still answers.
|
|
|
|
|
The slices of plan section 6 step 3, in order, with what each takes from the
|
|
|
|
|
Slint `Bridge` (`ui/bridge.slint:801-1206`; properties / callbacks):
|
|
|
|
|
|
|
|
|
|
1. the **desktop shell**: the server rail, the sidebar, the top bar, the empty
|
|
|
|
|
main area, window state (about 13 / 11, `bind/servers.rs`), the store and the
|
|
|
|
|
settings opened as in Slint's `run()`;
|
|
|
|
|
2. the channel tree and the members (about 13 / 6);
|
|
|
|
|
1. the **desktop shell** (done, [above](#the-desktop-shell)): the server rail,
|
|
|
|
|
the sidebar, the top bar, the empty main area, window state (about 13 / 11,
|
|
|
|
|
`bind/servers.rs`), the store and the settings opened as in Slint's `run()`;
|
|
|
|
|
2. **next: the channel tree and the members** (about 13 / 6): the sidebar's
|
|
|
|
|
placeholder becomes `logic::tree_view`'s rows (`TreeItem`, `MemberItem`), the
|
|
|
|
|
callbacks `join_channel`, `join_with_password`, `toggle_collapse`,
|
|
|
|
|
`search_members`, `show_voice_view`, `open_client` and `client_audio_changed`
|
|
|
|
|
become actions beside the shell's, and the password prompt the transitions ask
|
|
|
|
|
for (`Update::password`, which the root state only logs today) gets its dialog;
|
|
|
|
|
3. the voice page and the call bar (6 / 6);
|
|
|
|
|
4. chat, the composer and emoji (about 19 / 18, and the `Emoji` global 3 / 3):
|
|
|
|
|
first the two open choices of the report that it touches
|
|
|
|
@@ -1171,17 +1358,21 @@ entries); the in-window keys as GPUI key bindings and the global ones through
|
|
|
|
|
What the foundation's review and the Opus gate (2026-10-27) found and left to
|
|
|
|
|
the slices that meet it; none of it is a defect of what exists today.
|
|
|
|
|
|
|
|
|
|
- **The engine-event task drains its channel without yielding** (`app.rs`,
|
|
|
|
|
`while let Some(event) = events.recv().await`): a burst of events (a server's
|
|
|
|
|
first sync) keeps the receiver ready, so the loop handles them back to back
|
|
|
|
|
without returning to GPUI's executor (a tokio receiver is cooperative only
|
|
|
|
|
inside a tokio runtime), and the window waits for the whole burst. The shell
|
|
|
|
|
slice takes what is queued in one go (`try_recv` after the first event, one
|
|
|
|
|
`update`, one `cx.notify()`) or yields between events.
|
|
|
|
|
- **The tick notifies the root every second** (`AppState::tick`), which draws
|
|
|
|
|
the window once a second whether or not anything changed. Notify only on a
|
|
|
|
|
change once the shell shows more than the uptime (the line of state moves
|
|
|
|
|
with it today, and it is how the loop is seen to run).
|
|
|
|
|
- **Settled by the shell slice: the engine-event task and the tick.** The task
|
|
|
|
|
takes what is queued (64 events at most) in one `update` with one
|
|
|
|
|
`cx.notify()` and yields between steps, and the tick notifies nobody (the
|
|
|
|
|
shell shows nothing that moves with the clock: the line of state with the
|
|
|
|
|
seconds is gone, and the meter's `ticks` counter is how the loop is seen to
|
|
|
|
|
run). A slice that shows something that moves with time (a clock, a speaking
|
|
|
|
|
indicator that fades) makes its own view notify, not the tick.
|
|
|
|
|
- **A view that handles actions sits under the window's focus.** GPUI
|
|
|
|
|
dispatches an action from the focused element up, and with nothing focused
|
|
|
|
|
from the window's root node, which is the root view's wrapper, not its
|
|
|
|
|
element. `MainView` keeps a focus handle on its root element, focuses it at
|
|
|
|
|
start and takes the focus back when the element that had it is gone
|
|
|
|
|
(`on_focus_lost`: the form closed, a button replaced by another). A later
|
|
|
|
|
window (the Stream Studio's) does the same, and a new page's buttons dispatch
|
|
|
|
|
actions the root handles rather than listeners of their own.
|
|
|
|
|
- **The hotkey portal calls `tokio::spawn`** (`voelin-platform`,
|
|
|
|
|
`hotkey/portal.rs`, `PortalBackend::new`): it panics where no tokio runtime
|
|
|
|
|
is current, and a GPUI foreground task has none. The GPUI front end starts
|
|
|
|
@@ -1204,7 +1395,19 @@ the slices that meet it; none of it is a defect of what exists today.
|
|
|
|
|
- **System mode's first frame is Light** until the colour-scheme portal answers
|
|
|
|
|
(`cx.window_appearance()` before the window exists; `set_system_appearance`
|
|
|
|
|
follows the answer): a dark desktop sees a light frame at start. The shell
|
|
|
|
|
slice, which reads the settings, can start from the last resolved mode.
|
|
|
|
|
reads `ui.theme`, whose default is dark (as in Slint), so only a user who chose
|
|
|
|
|
`system` sees it; starting from the last resolved mode needs a place to keep
|
|
|
|
|
it, which nothing has yet.
|
|
|
|
|
- **The window's position is the window manager's to give back.** GPUI asks X11
|
|
|
|
|
for the place saved in `ui.window` and sets no position hint, so openbox (and
|
|
|
|
|
most window managers) places the window itself; the size is restored, the
|
|
|
|
|
position is not, and on Wayland there is none to tell. A window manager that
|
|
|
|
|
honours the request, or a hint GPUI does not set, would make the saved
|
|
|
|
|
position count; the setting keeps it either way.
|
|
|
|
|
- **The identity import and the crash reports are not started**
|
|
|
|
|
(`backend.rs` says so): the import reads the official TeamSpeak clients' files
|
|
|
|
|
and belongs with the identities page, the crash hook with the settings pages.
|
|
|
|
|
A connection uses the store's default identity (made at the first start).
|
|
|
|
|
- **The gate's deviations from the mapping table** of the report ("The theme
|
|
|
|
|
against Theme tokens"): `bg-rail` is not mapped (the report has it with
|
|
|
|
|
`surface` on `sidebar.background`; the sidebar takes `surface` and the shell
|
|
|
|
@@ -1213,13 +1416,11 @@ the slices that meet it; none of it is a defect of what exists today.
|
|
|
|
|
`overlay` gets `scrim`), and gpui-base's non-colour tokens (radii, spacing,
|
|
|
|
|
type, shadows, motion) are not written: gpui-base 0.8.1 has no storage to
|
|
|
|
|
write them to, so those live in `VoelinTheme::metrics` only.
|
|
|
|
|
- **The close grace is not seen end to end** until a slice opens sessions:
|
|
|
|
|
`run()` waits `CLOSE_GRACE` (500 ms) for the engine to send the closes only
|
|
|
|
|
when the window's close found sessions to close, and the binary opens none
|
|
|
|
|
yet (the unit test counts the closes `shutdown` sends, and the engine ignores
|
|
|
|
|
a close for a session it never opened). The first slice that opens a session
|
|
|
|
|
checks against a server that no ghost client stays behind after the window is
|
|
|
|
|
closed.
|
|
|
|
|
- **The close grace is seen end to end now** (the shell opens sessions): a
|
|
|
|
|
connected window closed with Alt+F4 leaves no ghost client on the TeamSpeak 3
|
|
|
|
|
development server and exits with status 0 ([The desktop
|
|
|
|
|
shell](#the-desktop-shell)). `run()` waits `CLOSE_GRACE` (500 ms) for the engine
|
|
|
|
|
to send the closes only when the window's close found sessions to close.
|
|
|
|
|
|
|
|
|
|
## Limits
|
|
|
|
|
|
|
|
|
@@ -1269,4 +1470,4 @@ the slices that meet it; none of it is a defect of what exists today.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
*Mirrored from [`docs/ui.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ba224e1dff3a30ebd683dec94986274b84f2ef02/docs/ui.md) at `ba224e1` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
|
|
|
|
|
*Mirrored from [`docs/ui.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/0d32ac25f03d62148e86dce1eae62225ba15f919/docs/ui.md) at `0d32ac2` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
|