docs: the GPUI desktop shell (docs/ui.md, CHANGELOG, the spikes report's status)

docs/ui.md, "The GPUI front end": what exists now (the store at start, the
shell's entities, the quiet tick), the shell's section with its pictures (the
empty shell and a server on screen, dark and light, and the server form, made
with scripts/gpui-shot.sh on a headless display), the eleven actions against
the Slint callbacks, the store, the window's place and what the shell leaves
out, the figures idle (0.3 to 0.5 % of a core, 192 MiB, no frame drawn while
nothing happens) and what was seen against the TeamSpeak 3 development server
(connect, mute, disconnect, reconnect, close with no ghost client); the
slice list says the shell is done and the channel tree is next, and "For the
next slices" says what the shell settled (the event task, the tick, the close
grace) and what it found (the focus the root's handlers need, the window
manager's say over the position).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-27 17:24:56 +03:00
1 parent b218059a20
commit 2e961eb411
8 files changed
+295 -72

No files matched your search

+11 -3
View File
@@ -9,9 +9,7 @@ User-visible changes of the apps and the `tsgw` gateway. The format follows
### Added
- `voelin-gpui`, the GPUI front end of the desktop app, in its first form: a
window titled Voelin with one line of the app's state in it (the version,
the voice connections that are up, the engine events handled, the seconds
up), fed by the same engine and the same view models as the Slint app
window fed by the same engine and the same view models as the Slint app
(`cargo run -p voelin-gpui --release`), in the Voelin theme: every colour,
radius, size and type token of the Slint app's `theme.slint`, light and dark
(a test reads the Slint file and fails when the two differ), written into
@@ -26,6 +24,16 @@ User-visible changes of the apps and the `tsgw` gateway. The format follows
stays the app; both run on one engine until the GPUI one reaches parity
(docs/ui.md). It needs Vulkan or OpenGL at run time (Mesa's lavapipe renders
in software); no package ships it yet.
- The GPUI front end's desktop shell: the server rail, the top bar, the
sidebar and the main area, on the client's own database (the servers saved in
the Slint app are there, and the other way round). Add, edit, select and
remove a server, connect and disconnect voice, mute the microphone and the
sound, hold to talk and copy an invite link, as in the Slint app; the window's
title names the server on screen, and its size is kept for the next run
(setting `ui.window`). The channel tree, the chat and the other pages are the
next slices; the search and the settings buttons only log that. `VOELIN_DEMO_UI=1`
shows the Slint app's sample servers without sending or keeping anything
(docs/ui.md, "The desktop shell").
- Log files: each run logs to `<state>/voelin/logs/voelin.log`, the previous
four runs are kept; `VOELIN_LOG` sets what is logged. Settings → Advanced
opens the folder.
+20 -5
View File
@@ -23,8 +23,9 @@ cases the foundation's review ran again on a quiet machine. The same day the
foundation of step 3 landed on `phase5/gpui-foundation` (items 1 to 4 and 6
of "What step 3's first slice must contain": Rust 1.95, ashpd on `async-io`,
the `voelin-gpui` crate with its root entity, the theme with Inter and Lucide,
the cost meter; item 5, the shell, is next): what exists, how to run it and
the slices that follow are in [docs/ui.md](../ui.md), "The GPUI front end".
the cost meter; item 5, the shell, followed the same day, below): what exists,
how to run it and the slices that follow are in [docs/ui.md](../ui.md), "The
GPUI front end".
The foundation was reviewed and gated the same day (a Sonnet review, then the
Opus gate: no blocker and no major, six minors), and the minors are closed in
the commits after it: the meter's `/proc` test waits for a CPU tick instead of
@@ -32,7 +33,17 @@ burning 60 ms, zbus runs on `async-io` alone in every binary (with a test for
the order of ashpd's callers), the lock figures and the Lucide 1.43 credit are
corrected, the slice list points at "Open choices for step 3", and the parity
test sees a second brush or string. The risks the review and the gate left to
the slices that meet them are in docs/ui.md, "For the next slices".
the slices that meet them are in docs/ui.md, "For the next slices". Item 5, the
desktop shell, is slice 1 of the step's list and landed on `phase5/gpui-shell`
(2026-10-27): the store at start (the client's database, the settings with the
UI's keys, the secrets, the default identity), the server rail, the sidebar,
the top bar and the main area as entities that draw when what they show
changed, the eleven callbacks of `bind/servers.rs` as actions through
`voelin-ui-vm`'s logic and the engine's commands, the window's size and
position kept in `ui.window`, the engine-event task in steps and a tick that
draws nothing. What it shows, what it costs idle and what it leaves to the
slices after it are in docs/ui.md, "The desktop shell"; the next slice is the
channel tree and the members.
| Spike | The plan's no-go | Seen (software rendering, see Setup) | Verdict |
|---|---|---|---|
@@ -637,8 +648,12 @@ set; the meter as `VOELIN_METER=1`. The crate is named `voelin-gpui` (binary
`voelin-gpui`), the choices below stayed as the report leaves them except
those named in docs/ui.md ("The GPUI front end"): the theme's second layer is
written as a `ThemeColor` mapping (a table there), and the client's Lucide set
is served under gpui-component's `icons/` paths. Item 5, the shell, is the
next task.
is served under gpui-component's `icons/` paths. Item 5, the shell, is done on
`phase5/gpui-shell` (the status paragraph above, docs/ui.md "The desktop
shell"): the screenshots are made the `docs/ui.md` way
(`scripts/gpui-shot.sh` under `headless.sh`), the form that adds a server is the
shell's own until the dialogs slice, and the open choices that remain (video,
emoji, links) are untouched by it.
### The risks of plan section 6, against what was seen
+264 -64
View File
@@ -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/gpui-spikes.md).
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,148 @@ colours would change the tokens' values).
![The swatch page, dark](ui/gpui-swatch-dark.png)
![The swatch page, light](ui/gpui-swatch-light.png)
### 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 shell, no server, dark](ui/gpui-shell-empty-dark.png) | ![the shell with a server, dark](ui/gpui-shell-server-dark.png) |
| ![the shell, no server, light](ui/gpui-shell-empty-light.png) | ![the shell with a server, light](ui/gpui-shell-server-light.png) |
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.
![the server form, dark](ui/gpui-shell-form-dark.png)
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 this
commit, 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 +1320,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 +1357,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 +1394,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 +1415,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
Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB