Files
faumarayandGemini 4 Neon f4afd83a5f docs: document GPUI voice fix round (PTT guards, compact stage, tooltips)
Update `docs/ui.md` ("The voice page and the call bar") and `CHANGELOG.md` for the fix round: fail-closed `hotkey.rs` loop, hardened `AppState` / `Sidebar` / `MainView` push-to-talk state machine (`button_held`, `hotkey_held`, `shutting_down`, per-event disconnect handling, mode/server/delete/focus/shutdown guards), centred smaller stage and re-shot compact screenshots (`15a1b60`, Xvfb `:621`/`:622`, Mesa 26.3.0 lavapipe), and `IconButton` dynamic tooltip refresh via `ElementId::NamedChild`.

Co-Authored-By: Gemini 4 Neon <noreply@google.com>
2026-11-23 08:35:10 +03:00

2412 lines
181 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# The user interface
`crates/voelin-ui` is the Slint UI of the desktop app and of the Android app
(`crates/voelin-android` runs the same window). It uses Slint's software
renderer, the Inter font, Lucide icons and Twemoji; the look follows the
design mockups (deep navy panels, a blue accent, a server rail, a top bar, a
sidebar with the user card, an optional right panel). What its screens show
is made by `crates/voelin-ui-vm`, which knows no UI toolkit ([Two
crates](#two-crates)). `crates/voelin-gpui` is the second front end, on GPUI,
under construction and built on the same view models and the same engine; the
Slint one stays the app until it reaches parity.
![Server page](screenshots/desktop-server.png)
## Structure
```
crates/voelin-ui-vm/ view models and state, no UI toolkit
assets/twemoji.bin the Twemoji SVGs packed by scripts/pack-twemoji.py
src/
image.rs color.rs ImageRef (a picture by where it comes from), Rgb
list.rs list::diff(old, new) → Changes (update, remove, insert by index)
bridge.rs the bridge structs as plain values (Arc<str>, ImageRef, Rgb, Vec)
studio_bridge.rs the same for the Stream Studio
state.rs AppState, SessionView, Tab, Msg: what the client knows apart from
the window, generic over the list type of a chat tab's lines
host.rs Host (what a transition asks of its front end), Update (what it
tells: Refresh, status, commands, Persist, ...), Cx
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/mod.rs tree.rs chat/mod.rs social/mod.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
servers/sequence.rs what both front ends do for a server over the store, the secrets
and the engine (connect, observe, the gateway lookup, save and
remove a bookmark), as transitions over a `Backing`
settings.rs the UI's settings keys, the audio form, `open_settings`
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
the audio settings page (devices, form, microphone test, push to
talk), the crash notice and the volume dialog of a client
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 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
theme.slint Theme global: design tokens (colours, radii, spacing, type)
icons.slint Icons global: Lucide icons (tint them with `Icon`)
bridge.slint structs, the Bridge global (data and callbacks for Rust),
Images (decoded images) and Emoji (the picker's data)
nav.slint Nav global: page, settings section, phone tab, dialogs, panel size
studio-bridge.slint the Stream Studio's structs and globals (StudioBridge, StudioNav)
studio-window.slint StudioWindow: the studio in a window of its own
viewer-window.slint ViewerWindow: the stream we watch in a window of its own
components/ the design system (catalogue below); index.slint exports all
shells/ desktop.slint (rail, top bar, Sidebar), mobile.slint (bottom
navigation), common.slint (Panel, VoiceCard, UserCard, ...)
screens/ channels, chat, members (panel, card), drawers (pins, topics),
voice (the voice channel), voice-parts (its people and
streams, also the phone's), streams (viewer; the phone's
panel), settings, settings-pages (its sections), home,
friends, messages (direct messages), events, overlays
(the bell, the search, a picture), dialogs, mobile and
mobile-voice (phone-only pages),
studio-parts (the studio's pieces), studio (its page, its
phone layout)
assets/ fonts/ (Inter, OFL), icons/ (Lucide, ISC), logo.svg
src/
app.rs setup, the Slint models (`Models`), the event loop; `App` holds
a `voelin_ui_vm::state::AppState` and the window
host.rs SlintHost (the answers the transitions ask for), `App::handle_event`,
`transition` and `perform`: doing what an `Update` says
members.rs appearance.rs
home.rs messages.rs events.rs previews.rs popout.rs
the Slint side of each area (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 (the callbacks of
`servers/sequence.rs`, the gateway lookup's thread hop), the rail,
the server card and the tree on the Bridge
social/ mod.rs (the models), bind.rs: contacts, the bell and the search on
the Bridge, the desktop toasts, the navigation after a move
settings_page/ mod.rs, bind.rs: the audio devices, the hotkey, the codec download,
the crash reports and the Bridge writes of the settings page
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
studio/ mod.rs (StudioState), bind.rs: the Stream Studio's windows and engine
bind/ callbacks of each area, wired once; convert.rs, convert/items.rs
(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/ 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
`bind::rows::Rows::sync`, which finds what changed with
`voelin_ui_vm::list::diff`, keeps the rows shared at both ends and changes,
inserts or removes the rest: a client that starts talking changes one row of
the tree. Every chat tab owns a `Rows` of its lines (`app::ChatRows`); the
chat view shows the selected tab's model, so a new message is one `push` and
switching tabs swaps the model. Lists that can grow (channels, messages,
notices, the emoji grid) use `ListView`, which builds only the visible rows.
## Two crates
`voelin-ui-vm` turns engine state into rows and decides what the controls
change; it has no `slint` and no `gpui` in its dependency tree, and the
Slint crate imports it as `vm` (`use voelin_ui_vm as vm`), so `vm::chat` in
this file is `voelin_ui_vm::chat`. The boundary:
- **Values.** A picture is an `ImageRef` (`Arc<ImageSource>`: a file of the
engine's cache with its stamp, decoded RGBA pixels, SVG or memory bytes,
or none; `size()` decodes a raster file once to tell it shows, and parses an SVG, so a
picture with a size is one a front end can draw). A colour is an `Rgb(u32)`, a
shared string an `Arc<str>`, a list a `Vec`. The bridge structs (51 in
`bridge.rs`, 10 in `studio_bridge.rs`) are plain `Clone + PartialEq + Debug`
structs with the field names of the Slint structs in `bridge.slint` and
`studio-bridge.slint`; `MytsBadge` and `MytsForm`, which have no data source
in this build, stay Slint-only. The crate warns about undocumented public
items (`#![warn(missing_docs)]`) and has none, the mirror modules' 559
fields (460 in `bridge.rs`, 99 in `studio_bridge.rs`) included: 210 carry
the comments of the `.slint` files, and the other 349 (288 in `bridge.rs`,
61 in `studio_bridge.rs`), which had none there, were described from the
code that fills them. No module is exempt from the lint.
- **Lists.** `list::diff(old, new)` gives `Changes`: updates, removals and
insertions by index, in the order to apply them. `bind/rows.rs` applies
them to a `VecModel` and converts only the changed rows; a GPUI view
re-renders from the list and needs no `Changes`.
- **Conversion.** The Slint crate owns the temporary `From` impls from the
plain structs to the Slint ones (`bind/convert/items.rs`), the colour,
picture and model helpers (`bind/convert.rs`) and the decoded-picture cache
(`images.rs`).
- **State.** `AppState<L>` (the servers, their sessions, the settings the
screens show, the dialogs' targets), `SessionView<L>` and `Tab<L>` live in
`voelin_ui_vm::state`, generic over the list type `L` of a chat tab's
lines: the Slint app plugs in `Rows<ChatLine>` (`app::ChatRows`), a front
end that re-renders can use a `Vec`. `App.state` is the one `AppState`.
- **Events.** `voelin_ui_vm::events::handle(state, social, host, event)` is
the one dispatch: it lets `social::logic::event` look at the event first
(the friends, pokes, offline messages and the notices, which need the state
as it was before the event), then `events::apply` changes the `AppState`,
and returns an `Update`, which says what the front end has to do: the parts
to draw again (`Refresh`, each once however many events set it), the status
line, the engine commands in order, what to keep (`Persist`: a bookmark,
the UI's settings, the audio settings, the clients' volumes), pictures to
decode again, the servers whose gateway is to be looked up, the password
dialog, notices for the bell, the chats that changed and a stream to watch.
`Host` is what the transitions ask while
they run: whether the chat or a private chat is on screen, the store's read
markers, the preview limit, the time. The Slint client's
`App::handle_event` is `handle` and then `perform`, which carries the update
out in `host.rs`; a GPUI client calls `handle` and draws what
`Update::refresh` names. The vm tests replay tapes of events against a fake
`Host` (`events/tests.rs`, `social/logic.rs`). `Update::rest` hands back the
events whose state is not in the `AppState`: the Stream Studio's stream
(`StreamState` and `StreamViewers` while `Host::studio_streams_to`),
`SettingChanged`, the answers to the offline message requests
(`RequestDone`, a list that failed; `messages.rs` keeps those for now), and
the rest that no screen looks at. `perform` handles `rest` before it draws
what `Update::refresh` names, as what the front end keeps may be on screen.
The text of an offline message is not in `rest`: `Event::OfflineMessage`
changes the `Social` state (`mail`, and the inbox row turns read) in
`social::logic::event`, so the redraw shows it (a tape test in
`social/logic.rs`). The streams we share and watch are in the `AppState`
(`share`, `watch`; the capture and the decoder are the front end's, and an
update says when to attach or drop them). The friends, the pokes, the
bell's notices, the text of the open
offline message and what the friends page and the search keep are in
`Social` (`social::logic`), which a front end passes to `handle` besides
the `AppState`.
- **Logic and bind.** An area that interleaves decisions with Bridge writes
is split into `<area>/logic.rs` in `voelin-ui-vm` (functions over the
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`, `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.
### Controllers still to split
Plan section 6 step 2 (the toolkit-free `voelin-ui-vm` crate) is done: the
view models, the state, the state transition of every engine event and the
decisions of every area controller that interleaved them with Bridge writes
are in `voelin-ui-vm`, and the Slint crate keeps the writes. What is left
for step 3 (the GPUI front end) is the list at the end of this section.
Status at the merge of main 6e0df51 (2026-10-24): the branch carries the
session seam of main (c60acf9) and, since, the CI deploy key, the media codec
test and the seam follow-ups. None of them touches `voelin-ui` or
`voelin-ui-vm`, and the `.set_` counts below were counted again on the merged
tree and are as stated. The colour of a chat's avatar (the server's own for a
server's chat, the title's colour for any other and for a server that is
gone, never black) is `servers::logic::conversation_tint`, which `messages.rs`
calls and a test pins.
The measure is the number of `.set_` calls in the file (`grep -c '\.set_'`):
every setter counts, those of the Bridge, `Nav`, the window, models and the
engine, and the status line's `self.set_status(…)`, which writes the Bridge's
status text too. In the seven largest files before this round's splits
(230 calls: `streams.rs`, `chat.rs`, `app.rs`, `servers.rs`, `settings_page.rs`,
`social.rs` and `dev.rs`) 150 are direct writes to the Bridge (140 written as
`bridge.set_…`, ten as `ui.global::<Bridge>().set_…` or a chained setter;
one of the ten is `set_status_text`, the write inside `set_status`, so it is
not one of the 36) and 36 go through the status line, so Bridge writes are 186
of the 230, about four fifths of those files, and direct ones about two
thirds; the rest are `Nav`, window and engine setters (in `dev.rs` mostly
those). Each controller was a slice of the same shape as `settings_pages` and
`studio`: the decisions moved into
`voelin-ui-vm/src/<area>/logic.rs`, the writes stayed in
`voelin-ui/src/<area>/bind.rs`. The `.set_` calls of each file before and
after, every number counted with that command:
| Area | Before | After |
|---|---|---|
| Stream Studio | `studio.rs` 64 (62 once the view models had moved) | `studio/bind.rs` 58 |
| Settings pages | `settings_pages.rs` 52 | `settings_pages/bind.rs` 51 |
| Streams | `streams.rs` 45 | `streams/bind.rs` 38 |
| Chat | `chat.rs` 38 | `chat/bind.rs` 31 |
| Servers | `servers.rs` 37 | `servers/bind.rs` 31 |
| Audio settings page | `settings_page.rs` 26 | `settings_page/bind.rs` 26 |
| Friends, the bell, search | `social.rs` 23 | `social/bind.rs` 5 and `social/mod.rs` 15 (the models handed to the Bridge once) |
| Development switches | `dev.rs` 23 | `dev/bind.rs` 21 |
| Event dispatch and setup | `app.rs` 38 | `app.rs` 31 and `host.rs` 8 (carrying out an `Update`) |
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.
Why the studio went before `streams.rs`: it had the most calls, and it is
self-contained. It has its own state (`StudioState`), windows and bridge
(`studio-bridge.slint`), so its decisions moved without touching the event
dispatch of `app.rs`. `streams.rs`, `chat.rs` and the rest of the list were
driven by that dispatch (the watch, share and history events), so they
followed it: the state transition of every engine event came first
(`events::apply`), then the controllers that show the result, `streams` first
as the one whose events were still the front end's.
Still to split before or while the GPUI front end is written (the files as they
stand):
| File | `.set_` calls | What it mixes |
|---|---|---|
| `app.rs` | 31 (4 in tests) | setup and the model hand-off, the status line, `setting_changed` (which setting touches what); the event dispatch itself is `vm::events::handle` and `events::apply`; the toolbar and tree refreshes are `servers/bind.rs` (`refresh_toolbar`, `refresh_tree`), which `app.rs` only calls |
| `images.rs` | 13 | the decoded-picture cache |
| `messages.rs` | 11 | direct messages |
| `appearance.rs` | 11 | theme, font scale and breakpoints |
| `popout.rs` | 8 | the viewer's own window |
| `members.rs`, `links.rs`, `inbox.rs`, `home.rs`, `events.rs` | 6, 5, 5, 5, 4 | small; split with their neighbours |
The gate that accepted `voelin-ui-vm` asked for the `app.rs`/`events.rs` split
before the GPUI client. The dispatch is what moved (the `app.rs` part:
`handle` and `apply` in the crate, `host.rs` here); `events.rs` of
`voelin-ui` is no dispatch but the controller of the gateway's events page
(the event form, RSVP, the channels an event can be in), and it is not split.
Neither is the rest of `app.rs` named above: they are the next slices.
## Theme tokens
`Theme` (ui/theme.slint) holds every colour and size; components never use
literal colours.
| Group | Tokens |
|---|---|
| Mode | `mode` ("dark", "light", "system"; set from `ui.theme`), `dark` (resolved), `font-scale` (from `ui.font_scale`) |
| Backgrounds | `bg-app`, `backdrop` (gradient), `bg-rail`, `surface` (panels), `surface-2` (cards, inputs), `surface-3` (hover, menus), `surface-4` (pressed), `scrim` (behind modals), `scrim-light` (behind pop-ups), `overlay` |
| Lines | `border`, `border-strong`, `border-popup` (pop-ups, menus, tooltips), `glow`, `glow-width` (focus/selection ring; the software renderer draws no shadows) |
| Accent | `accent`, `accent-hover`, `accent-pressed`, `accent-soft` (selected rows), `accent-soft-hover`, `accent-text` (links), `name-text` (chat authors), `on-accent` |
| States | `live`, `live-soft`, `danger`, `danger-soft`, `success`, `success-soft`, `warning`, `warning-soft`, `idle`, `dnd`, `offline`, `gold` (crown), `info` |
| Text | `text`, `text-secondary`, `text-muted`, `text-disabled`, `icon` |
| Meter | `meter-low` (green), `meter-mid` (yellow), `meter-high` (red), `meter-off` |
| Radii | `radius-xs` 4, `radius-sm` 6, `radius-md` 8, `radius-lg` 12, `radius-xl` 16, `radius-pill` |
| Spacing | `space-1` 2 … `space-8` 32 (2, 4, 8, 12, 16, 20, 24, 32) |
| Type (scaled) | `font-xs` 11, `font-sm` 12, `font-body` 14, `font-md` 15, `font-lg` 17, `font-xl` 20, `font-2xl` 24, `font-3xl` 30; `weight-regular` … `weight-bold` |
| Sizes | `row-height`, `control-height` 36, `control-height-sm` 28, `icon-sm/md/lg` 16/20/24, `rail-width` 72, `sidebar-width` 264 (grows with the font scale), `topbar-height` 44 (more when large text makes the controls taller), `right-panel-min` |
| Motion | `fast` 120 ms, `normal` 200 ms |
A light palette is filled in for every colour; `mode` switches at runtime.
The standard widgets (scroll bars, context menus) follow through
`Palette.color-scheme`.
## Components
All in `ui/components/`, exported by `components/index.slint`.
A component used in many places keeps `opacity`, `visible`, shadows and
animations off its root element: Slint inlines such a component at every
use, which grows the generated code and the compiler's memory (IconButton
puts them on an inner `face`).
A 0 × 0 element (`PopupMenu`, `ShareMenu`) inside a layout caps that layout's
size across its direction at its minimum: put it outside the layout with
`x: 0; y: 0`, as the phone's `ShareControl` does.
| Component | File | Key properties |
|---|---|---|
| `Icon` | icon.slint | `source` (an `Icons.*`), `size`, `tint` |
| `Spinner` | icon.slint | `size`, `tint`, `running` |
| `Button` | button.slint | `text`, `icon`, `kind` (`ButtonKind.primary/secondary/danger/ghost`), `enabled`, `checked`, `small`; `clicked` |
| `IconButton` | button.slint | `icon`, `label` (screen readers), `tooltip` (default `label`, "" for none; on hover, also while disabled, desktop only), `checked`, `danger`, `alarm` (filled red with a white icon: Leave), `round`, `filled`, `edge` (the border of a filled one while not checked), `size`, `icon-size`, `tint`, `dot`, `count` (a neutral number at the top right, hidden at 0 or less); `clicked` |
| `ActionButton` | button.slint | round button with a caption (the phone's voice bar: Mic on or off, Deafen, Share, Leave; the You page: Mute, Deafen, Go Live, Leave), no tooltip: `icon`, `text`, `checked`, `danger`, `alarm`, `checkable` (screen readers hear `checked`), `size`, `icon-size`, `edge` |
| `FocusRing` | button.slint | the accent ring of focused controls |
| `TextField` | text-field.slint | `text`, `placeholder`, `input-type`, `icon`, `label`, `bare`, `read-only`; out `has-focus`, `text-height` (the height of its lines); `accepted`, `edited`, `key-pressed`; `clear()`, `select-all()`, `focus-end()` (the cursor after the text) |
| `SearchBox` | text-field.slint | a TextField with a magnifier and the Ctrl K hint (`show-shortcut`) |
| `Kbd` | text-field.slint | a key cap |
| `Field` | text-field.slint | `label` above a control (@children), `hint` below |
| `Select` | select.slint | drop-down: `model`, `current-index`, `current-value`, `icon`, `label`; `selected(string)` |
| `Toggle` | toggle.slint | the pill switch: `checked`, `label`; `toggled(bool)` |
| `ToggleRow` | toggle.slint | settings row: `icon`, `text`, `description`, `checked`; `toggled(bool)` |
| `RadioRow` | toggle.slint | `checked`, `text`, `description`, `icon`; `clicked` |
| `Slider` | slider.slint | `value`, `minimum`, `maximum`, `step`, `label`; `changed(float)` while dragging, `released(float)` |
| `SegmentedTabs` | tabs.slint | `model`, `current-index`, `label`; `selected(int)` |
| `TabItem` | tabs.slint | underlined tab: `text`, `selected`, `badge`, `closable`; `clicked`, `close` |
| `Avatar` | avatar.slint | `image` or `initials` + `tint` (one letter under 28 px, through `Images.first-letter`), `size`, `status` (`Status.online/idle/dnd/offline/info`), `speaking` (green ring), `crown`, `square` (server icons); a server icon at most half as wide (TeamSpeak's 16 px ones) is drawn at twice its size, sharp, on the tint (a person's picture always fills it) |
| `Art` | art.slint | a painted picture (`Icons.art-*`) covering `cover-width` × `cover-height` at its own aspect ratio, cut by the parent's clip; `align-x`, `align-y` (0 keeps the left or top edge, 1 the other); home's banner and cards, the stream cards |
| `CountBadge` | badge.slint | count bubble: `count`, `fill` (red), `ink` (the number) |
| `LiveBadge` | badge.slint | `text` (LIVE), `large` |
| `Chip` | badge.slint | tag: `text`, `icon`, `picture` (in its own colours, a badge's), `tint`, `fill`, `outlined` |
| `BadgeIcons` | badge.slint | up to three 14 px pictures after a name (`first`, `second`, `third`); empty ones take no room |
| `Dot` | badge.slint | a status dot |
| `Card` | card.slint | panel card with optional `title`, `icon`, `subtitle`, `selected`; `inset`, `gap` |
| `SectionHeader` | card.slint | `text`, `icon`, `count`, `action` ("See All >"), `small`; `action-clicked` |
| `Divider` | card.slint | horizontal line |
| `Banner` | card.slint | warning/error strip: `text`, `icon`, `tone`, actions as @children |
| `Meter` | meter.slint | segmented level meter: `level` (dBFS), `threshold`, `show-threshold`, `active`, `segments` |
| `SpeakingBars` | meter.slint | animated "speaking" bars |
| `NavItem` | list-item.slint | navigation entry: `icon`, `text`, `subtitle`, `selected`, `badge`, `chevron`; `clicked` |
| `ListItem` | list-item.slint | row with a leading slot (@children), `title`, `subtitle`, `trailing`, `selected` |
| `PopupMenu` | overlay.slint | themed menu: `entries` ([MenuEntry]), `show(x, y)`, relative to the menu element (where that is not in a layout give it `x: 0; y: 0`, or Slint centres it in its parent); `activated(int)` |
| `Tooltip` | overlay.slint | wraps @children; `text` shows at the pointer after a moment, until it leaves (desktop only: `Bridge.desktop`) |
| `HoverTooltip` | tooltip.slint | the same, put last in an element (as IconButton does): `text`; `pressed` and `hovered` of the element's TouchArea (a press closes it until the pointer leaves) |
| `TooltipBubble` | tooltip.slint | a tooltip's bubble: `text`, wrapping at `widest` (400px) |
| `Modal` | overlay.slint | dialog with backdrop: `title`, `subtitle`, `icon`, `card-width`, `card-height`; `dismissed` (backdrop, Escape, ×) |
| `Toast` | overlay.slint | `text`, `icon`, `timeout`, `shown` |
| `ResizeHandle` | overlay.slint | drag to resize a side panel: `size` (two-way), `minimum`, `maximum`, `left` |
| `RichText` | emoji.slint | text with formatting and inline emoji: `blocks` ([TextBlock]) of lines, quotes (a bar and the author), code (on a background), list items and rules; a block's `runs` ([TextRun]: bold, italic, underline, strike, code, the author's colour per theme, links underlined in the accent colour) flow and wrap in a FlexboxLayout; a click on a link opens it (`Nav.open-link`), a right-click shows Open link and Copy link |
| `MessageText` | emoji.slint | a message's text (`line`: ChatLine): one `Text` when it has neither formatting nor emoji, else a `RichText`; a note for a blocked contact's. The chat, the pins drawer and the studio's chat use it |
| `EmojiPicker` | emoji.slint | search, categories, virtualised grid; `picked(EmojiCell)`, `close` |
| `ListView`, `ScrollView` | std-widgets | re-exported (virtualised lists) |
Shell pieces (ui/shells/): `DesktopShell` (rail + top bar + panels as
@children), `Sidebar` (page navigation above the voice card and user card),
`Panel`, `ServerRail` (Home, the servers, Add a server, the settings; each
server shows its icon or its initials, on a colour no other server has while
there are at most ten, kept when a server is added),
`TopBar` (the search, starting over the main panel, opens the search like
Ctrl+K; the bell at the right), `MobileShell` (top bar: the tab's or the
page's name, such as Servers, Activity, You or Settings, the app's name on
Home, the server with the chat below on Chats; on the voice screen Back,
the channel with the server below, the people, Chats and More; the page;
bottom navigation), `VoiceCard` (Voice Connected, or Connecting…, and our
channel; Disconnect, and Hold to talk with push-to-talk; on the phone a tap
opens the voice screen), `VoiceButtons` (mute, deafen, share; `gear` adds
the voice settings; `round` and `filled` for the voice view's call bar),
`UserCard` (its avatar and name open Settings → My Account), `HoldToTalk`.
Pages bring their own title; About is in the settings (and on the phone's
You page).
Voice parts (ui/screens/voice-parts.slint), for the desktop's voice view and
the phone's voice screen: `Participant` (`member`, `size`: the avatar's) and
`StreamCard` (`stream`), both with `compact`, the phone's smaller look (a
person ringed only while talking or streaming, LIVE below the name; a stream
as a row with the streamer's avatar). The protocol has no thumbnails (a
picture means joining the stream, which the streamer sees as a request), so
a stream card shows the stream only while we watch it, and our own from the
Stream Studio its preview while live; otherwise the streamer's avatar,
ringed, with what they share, on a painted scene in their colour.
## The server page
The server page follows the design mockups 03 to 08 (desktop). Each part
comes from the engine's events; what a gateway adds is hidden without it.
| Part | `VOELIN_OPEN` | What it shows | Engine data |
|---|---|---|---|
| Chat | `server` (`server:chat`: the server chat), `actions`, `link-confirm[:<url>]`, `unread[:end]` | Header with the channel's topic, then icon buttons for Pinned messages and Topics (each with its count once the gateway sent them: asked for when the chat is shown), the voice channel and the members; chat tabs (the server chat and channel chats; private chats are on the Direct Messages page); messages grouped by author ("Today at 10:14"), avatars, BBCode formatting (see Formatting below), emoji, reactions with an add button, pin and topic marks, file cards with download; composer with attach, emoji and send. A link opens in the browser; one whose text is not its address (a masked link) first shows where it goes in `LinkDialog` (the host, the whole address; Open, Copy link, Cancel); a TeamSpeak link opens in Voelin (Adding a server: Links, below); a right-click on a link offers Open link and Copy link. Every message has actions on hover (`MessageActions`; `actions` shows the last one's): Quote (`> Author: …` lines at the start of the composer, which takes the focus to write below them and grows to show up to about eight lines) and Copy text, and with a gateway quick reactions, pin and Start a topic; a right-click on a message shows Copy text, Copy link (its first web address), Quote, and with a gateway React… and Pin. The server chat starts with the server's welcome message (and its host message when the server puts it in the chat log). Opens at the newest message and follows new ones while at the end. Scrolling up to within a screen of the top loads the page before, above the rows on screen, which stay in place (a spinner above the oldest message while it loads). The Older messages button there is for a chat too short to scroll, and for after a page that brought nothing (scrolling loads again once the list was a screen away). The voice view, the phone's voice screen and private chats load the same way. Messages count as read while their chat is on screen in the focused window; the chat tabs and the server rail count the others (not our own; private chats count on Direct Messages). A chat that comes on screen with new messages, or that is on screen when messages that came while away arrive (a stored or gateway page), shows a red line with New above the first (`NewDivider`) until the chat is left; while that line is above the view, a bar over the list says how many are new and since when (`UnreadBar`: "5 new messages since 10:14", Jump, and × to mark them read). Where each chat was read is kept on this device (the store's `chat_reads`), so the counts survive a restart: messages that came while away (a gateway's history) count as new | `ChatHistory` (and `Chat` for servers without history), `Presence` (welcome and host message), `AvatarReady`, `Transfer`, `Gateway` (pins; reactions arrive as stored messages); `Command::LoadOlderHistory`, `DownloadChatFile`, `UploadFile`, `GatewayRequest::React`, `Unreact`, `Pin`, `Unpin` |
| Members panel | `server` (`panel`, `no-panel`) | "Members — N" and a search; those streaming first (the people in our channel while the voice channel or a stream is shown), then each server group in the server's order with its icon, then those without a group. Rows: avatar with status, name, crown (admin groups), priority speaker, channel commander, recording, up to three myTeamSpeak badges, moderator role, a hand when their channel needs more talk power than they have ("Needs talk power to speak"; the member card has the number), what they do or the channel they are in. Resizable: the width is `ui.members_width` | `Presence`, `Groups`, `Talking`, `IconReady`, `PictureReady` |
| Member card | `member` | Description, groups, badges (up to three chips in the client's order, what each is for on hover; "Badge" for one the app does not know), talk power, country; private message (on Direct Messages), poke, friend, block; volume and mute for us | `ContactsChanged`, `PictureReady` (badges); `Command::SetContact`, `SetClientVolume`, `SetClientMuted`, `Poke` |
| Poke | `poke` (the first other member's, card open; after `friends` a contact's) | `PokeDialog`, from the member card, a friend's row and the direct message header: an optional message with a "12/100" count, Send off above 100 characters, Enter sends, Escape cancels | `Command::Poke` (trimmed, cut to 100 characters; the engine cuts too) |
| Channel password | `channel-password`, `channel-password:wrong` | Joining a channel (a double-click in the tree, joining a friend) moves there with voice, or connects into it (by its id) without; when the server puts us elsewhere on connecting, as it does for a wrong password, it is joined again, which says why. A locked channel first asks for its password in `ChannelPasswordDialog`, unless one was given since voice connected; a refused one asks again under "Wrong password". A full channel or another refusal is a toast | `Presence` (`has_password`), `JoinFailed`; `Command::MoveToChannel`, `ConnectVoice` (`channel_password`) |
| Pinned messages | `pins` | In the members panel's place: cards with author, time, text, files and reactions; the pin unpins, a click jumps to the message | `Gateway` `Pins`, `Pinned`, `Unpinned`; `GatewayRequest::Pins`, `Unpin` |
| Topics | `topics`, `topic:<id>` | In the members panel's place: search, cards with the message count, creator and last activity, Create Topic; an open topic replaces the chat's messages and takes replies | `Gateway` `Topics`, `Topic`, `TopicHistory`; `GatewayRequest::Topics`, `TopicHistory`, `CreateTopic`, `Post` |
| Voice channel | `voice`, `voice:compact` | Title, topic, "5 in voice / 50 total", Copy invite link (a `ts3server://` link to the channel; the phone's Invite button does the same), the members button, Smaller stage / Larger stage, Chat only; the people as large avatars (talking ring and bars, muted, crown, streaming); the streams as cards (the streamer's avatar on a painted scene in their colour, or the picture while watched, and our own from the Stream Studio its preview: `studio:live,server,voice`; LIVE, viewers, kind, bitrate, sound, Watch Stream); the call bar: mute and deafen (red while on), share (its menu opens above it), the voice settings and Leave; the channel's chat. The smaller stage (`ui.voice_compact`, and always in windows under 800 px tall, where its button is disabled) is one row of small avatars, scrolling sideways, and the streams as rows (Watch, Show), so the chat gets about 200 to 240 px more | `Presence`, `Talking`, `StreamsChanged`, viewer counts from `StreamsChanged`, else the `Gateway` stream directory |
| Watching a stream | `watch`, `watch,theatre`, `popout` | A header (on our channel's background) with the streamer's avatar, the title, the streamer and viewers, LIVE, the picture's height (the simulcast picker when a Voelin streamer offers layers), the members button and Leave; the player, with nothing over the picture but its controls: volume, elapsed time, what arrives (codec, size, frame rate, bitrate), back to the chat, theatre mode, pop out (desktop), full screen. The controls hide 2.5 s after the pointer last moved over the picture and come back when it moves (in full screen the cursor hides with them; on a touch screen a tap on the picture shows or hides them); while waiting for the picture and after the stream ended they stay, and so do they before the pointer was ever over the picture, as in screenshots. Then a note that the stream belongs to the channel; the channel's chat and a Stream Info tab. In theatre mode (`Nav.theatre`) it fills the window without the shell or the members button, the chat still under the picture; it ends with the viewer, and a narrow window keeps the phone layout. Escape leaves full screen, then theatre mode. In full screen (and on the phone outside the voice screen) the player is alone, with the streamer, title, viewers, LIVE and the quality over the picture's top, hiding with the controls. Popped out (`ViewerWindow`, `src/popout.rs`), the player alone is in a window of its own titled with the stream, while the main window goes on (`Bridge.viewer-popped`; the main window's `viewer-open` is false meanwhile): its controls keep it on top of the other windows (`always-on-top`, picture in picture; the next pop-out remembers it for the run) and bring it back; full screen and Escape are that window's, and it stays when another stream is watched. The stream's card on the voice page says "Playing in its own window", with Bring back (the streams panel's card has Bring back too). Closing the window brings the stream back too, on its server's page; Leave closes it, and so does closing the main window. The pictures go only to the window that shows the player | `WatchState`, `WatchLayers`, decoded frames and their stats (`src/video.rs`), `StreamsChanged` (viewer counts; the `Gateway` stream directory where the server gives none) |
The pins and topics share the place of the members panel: opening one
closes the other, and the members button brings the panel back. On the
phone the chat is the Chat tab and the members of our channel are on the
Activity tab, with the streams (the streamer's avatar on their colour, Watch,
Show and Leave). The Chat tab counts the server's unread chats; private chats
count on the Home tab, where the direct messages are.
The phone's Servers tab (`tab:servers`) is titled Servers: the servers as a
row of icons (a double tap edits one, + adds one), then the server card, the
one place for the server's name, counts and banner, with its menu (Edit
server, Add a server); Connect, or the voice card with our channel (a tap
opens the voice screen); and the channel tree.
The phone's voice screen (`voice` in a phone-sized window,
`screens/mobile-voice.slint`) has one header, the shell's top bar: Back (it
closes the pins, the topics or the members over the screen first, then the
screen), the channel's name on its banner with the server below, the people
in voice (the members page), Chats with the unread count, and More: Pinned
Messages and Topics (with a gateway), Stream Studio, Voice Settings and
Activity (`more` opens it). Below it come the stream we watch or the streams
as rows, the people (44 px avatars, scrolling sideways) and Invite, the
channel's chat and the composer. The stream and the people take at most
45 % of the screen, so the chat keeps about 320 px at 390 × 844 while
watching. The bottom bar has Mic on or Mic off and Deafen; with push-to-talk
Hold to talk in the middle (green, Talking…, while held) and Share,
otherwise Share in the middle; Share opens the share menu (Share screen,
Stream Studio) as the desktop's call bar does; and Leave, the screen's only
one. The transmit mode comes from the stored audio settings at start.
## Home, friends, messages and the settings pages
These follow the design mockups 01 (home, desktop and phone), 02 (direct
messages), 03 (the links above the channel tree) and 11 (Voice & Video,
desktop and phone), mapped onto what TeamSpeak has: there is no global
network, so nothing pretends one. "Friends" are the contacts (friend,
blocked or neither) and where they are is what the servers we are on (or
look into) say; "communities" are the user's servers. Nothing here needs
a gateway; what one adds (events, the stream directory, activity) shows
where a server has it.
| Part | `VOELIN_OPEN` | What it shows | Engine data |
|---|---|---|---|
| Home | `home`, `first-run` | Before the first server a banner with Voelin and Add a Server; after it "Continue where you left off": the voice channel we were in last (`ui.last_voice`, kept when our channel changes) with Join, which connects into it, or Open while voice is there (none once its server is deleted or has another address), and up to three unread mentions (they open their chat). Then friends online where the right column is hidden (as many whole bubbles as fit, Find Friends after them); live streams on our servers (any channel, the gateways' directories, clients flagged streaming) with viewers, server, channel and kind; our servers with who is there and Join or Open; the latest chats of every server. At the right what friends do and what is happening (gateway events and scheduled streams, soonest first, then server news). The sidebar lists the five newest private chats, unread first (not on the messages page). The phone has the messages, servers and live streams in one column after the friends | `State` (our channel), `FriendPresence`, `ContactsChanged`, `StreamsChanged`, `Gateway` (stream directory, events), `Presence` (the servers' welcome and host messages), `Chat` (mentions), `History::recent_chats` |
| Library | `library` | The Stream Studio's recordings and clips (the files in `studio.recording_dir`, newest first) with Play and Open Folder | the folder |
| Friends | `friends[:<uid>]` | Online, All and Blocked tabs, a search; each contact with where they are (server, channel, away, live), message, poke, join, watch. The selected one at the right: relation, where, a note, our volume and mute for them, friend, block, forget | `ContactsChanged`, `FriendPresence`; `Command::SetContact`, `RemoveContact`, `Poke`, `MoveToChannel` |
| Direct messages | `messages[:<uid>]`, `inbox`, `offline` | The private chats of every server and of the store (peers by unique id) with the last message and unread counts, All, Unread and Inbox (offline messages); the conversation with the chat's message list, pokes among the messages, pictures and files, a composer, and a clear state when the peer cannot be reached (an offline message instead, where the server keeps them); the peer at the right: relation, note, the servers they are on, shared pictures and files, our volume for them. A private chat is not a tab of the server page: while it is open here it is its server's current chat (a channel's chat opened meanwhile, as voice connecting opens its channel's, waits), and leaving the page goes back to the server's last chat tab (coming back reopens it). Its unread messages count on Direct Messages (on the phone, on the Home tab), not on the server rail | `ChatHistory` (`ChatTarget::Private` by unique id), `Command::LoadOlderHistory`, `Poke`, offline messages (`ListOfflineMessages`, `GetOfflineMessage`, `SendOfflineMessage`, `DeleteOfflineMessage`, `SetOfflineMessageRead`) |
| The bell | `notifications` | A panel under the bell, as tall as its notices (up to 560 px, then it scrolls): mentions, pokes, private messages, event reminders and friends coming online, newest first, unread marked; Mark all read, clear, the settings. Each kind is off, in the app or also a desktop notification (`notify.*`) | `Chat` and `ChatHistory` (mentions, private messages), `Poke`, `GatewayUpdate::EventReminder`, `FriendPresence`; `voelin_platform::notify` |
| Search | `search[:<text>]` | Ctrl+K: servers, channels of every server, people (on the servers and the contacts) and the settings pages; arrows choose, Enter opens | the sessions, contacts, bookmarks |
| Events | `events`, `event-form` | Above the channel tree (gateway `events`): a server's events with date, time, channel, scheduled stream, Going, Maybe and Not going with counts, who answered, reminders, Watch while live; create, edit and delete. Members (above the tree too) opens the members panel | `Gateway` events; `GatewayRequest::Events`, `CreateEvent`, `UpdateEvent`, `DeleteEvent`, `Rsvp` |
| Pictures in chat | `picture` | A linked png, jpg, gif or webp up to `ui.image_preview_kb` is downloaded into memory, decoded once into the image cache and shown as a card in the message; a click opens it larger. A picture on the web a message shows (`[img]`) comes into the engine's picture cache like banners, up to the same size and only with `cache.fetch_images`; until then, or without it, the message shows its address as a link | `Command::DownloadChatFile` with `DownloadTo::Memory`, `Transfer`; `Command::FetchPicture`, `PictureReady` |
| Join by address | `join` (the same as `bookmark`) | The add-server dialog (Adding a server, below): Connect saves the server, then connects | `Command::ConnectVoice` |
| TeamSpeak links | `link:<url>` | A `ts3server://`, `teamspeak://` or `tmspk.gg` link: in voice on its server, a move into its channel; else the add-server dialog filled in from it (Adding a server: Links, below) | `Command::MoveToChannel`, `Command::ConnectVoice` |
Settings sections (`settings:<section>`):
| Section | Holds |
|---|---|
| `account` | The identity in use (nickname, TeamSpeak 3 and 6 unique ids, security level), and a note that account sign-in is not available in this build |
| `profiles` (also `identities`) | Identities with where they came from: rename, use as default (the store's default, `Store::set_default_identity`), export as a TeamSpeak 3 .ini, delete, raise the security level on every core; the import of the official clients' identities on start (`identity.import_from_teamspeak`) and by hand from their settings and .ini files (key material is never shown); the identity per server |
| `appearance` | Theme, text size, the phone layout's width, the image cache |
| `voice` | Microphone (device, test, level, noise suppression, echo cancellation, automatic gain), output (device, test sound, volume), streaming permissions, camera (device, preview with the background effect), video settings (resolution, frame rate 15 to 320 fps, codec, hardware acceleration, mirror), stream quality presets (Auto, 720p to 8K) with free bitrate entry (slider up to 60 Mbit/s, empty: automatic) and the upload it takes |
| `streaming` | Frame rate, bitrate, codec, capture backend, simulcast layers, the stream's audio sources (desktop without Voelin, applications, the shared window's application, microphone; gain and mute each), recording and replay |
| `devices` | Microphones, speakers, cameras and what can be shared |
| `notifications` | Each kind of notification: off, in the app, on the desktop; a test notification |
| `privacy` | Who may send private messages and poke us, blocked people and what happens to their messages, streaming permissions |
| `keybinds` | Voice activation, push-to-talk and its global key, the window's shortcuts |
| `integrations` | The gateways of our servers with their features, and their administration for admins (configuration keys, permission rules); FFmpeg, the video encoders and decoders, what works and why not |
| `advanced` | Encoder and decoder, hardware acceleration and decoding, SRTP profiles, chat history, cache, transfers, logs and crash reports, and every setting by its key as JSON |
Settings controls read and write `voelin_core::settings` and apply at once;
numbers are typed freely next to the presets.
There is no account sign-in in this build: no login page at start, and
Settings → My Account shows the identity in use under a note, "Account sign-in
is not available in this build." The myTeamSpeak account (profile, avatar,
badges, User Tag) is meant to return through the gateway; the sign-in
screens (`screens/account.slint`) stay in the Slint code for it, fed no data
(`Bridge.myts` keeps its default: signed out, not available, no prompt).
[research/myteamspeak.md](research/myteamspeak.md) keeps the protocol notes.
## The Stream Studio
![Stream Studio](screenshots/desktop-studio-live.png)
The studio (mockups 09, 10 and the phone's 04) is a page of the main window
(the Share button's menu: "Share screen" for a quick share of a screen or
window, "Stream Studio" for the studio; while a share runs the button opens
its dialog), a window of its own (the button in its
header; closing that window brings it back) and a phone page. Its controller
is `src/studio/` on the engine's studio ([studio.md](studio.md)), its decisions in `voelin-ui-vm`'s `studio/logic.rs`: the
studio runs while it is shown, live or recording, and a `Streamer` started
for it encodes the composite from the start, so Record Clip and recordings
work before going live.
| Part | `VOELIN_OPEN` | What it shows | Engine data |
|---|---|---|---|
| Scenes | `studio` | The scenes, the live one highlighted, with what each shows; click to switch live, double-click or the menu to rename, remove; Add Scene | `Event::Scenes`; `AddScene`, `SetActiveScene`, `RenameScene`, `RemoveScene` |
| Sources | `studio`, `studio:source`, `studio:camera` | The live scene's sources, front first: add a screen, window (on Wayland through the portal, on X11 the monitors and windows), camera, image, text or colour; show or hide; a menu with transform, crop, opacity, lock, background effect (cameras: off, blur, image, colour), forward, backward, rename, remove | `AddSource` (as `SetScenes`, with a placement), `UpdateSource`, `ReorderSource`, `RemoveSource`; per source size, rate and error from `Stats` |
| Header | `studio`, `studio:live` | "Streaming to channel • server", the connection (the viewers' bandwidth estimates against the bitrate, and the composed frame rate), resolution • fps • kbit/s, details on the info button | `Stats`, `Streamer::stats`, the stream's viewers |
| Preview | `studio`, `studio:live`, `studio:record` | The composite, LIVE and the time (or PREVIEW, REC), watching and joined viewers, title • destination | `Studio::preview` turned into pictures on a thread of its own, latest wins; `State` |
| Audio mixer | `studio`, `studio:audio` | One row per `stream.audio_sources` entry: meter, gain (dB), mute, a menu; + adds the microphone, desktop audio without Voelin, the shared window's application or an application that plays | the mixer's meters (lock-free, about 15 times a second); `Streamer::reconfigure` follows the setting |
| Stream chat | `studio` | The chat of the channel the stream goes to and a composer | the destination tab's stored messages, made into lines as the chat view does |
| Stream settings | `studio` | Destination (the voice channel of each TeamSpeak 6 server we are in), title, game, go-live message (sent to the channel when the stream is up), Show Viewer Count / Chat Overlay / Now Playing, Enable Stream Audio, Advanced Settings, output size and rate (presets 720p to 8K and 30 to 240 fps, or any numbers), bitrate (empty: automatic, up to 60 Mbit/s) or simulcast layers | `studio.ui`, `stream.bitrate_kbps`, `stream.layers`, `SetOutput` |
| Bottom bar | `studio`, `studio:settings` | Share Window, Share Screen, Record Clip (and start or stop a recording, the replay length, the folder), Go Live, End Stream, Studio Settings (replay seconds and memory, folder, preview size) | `SaveClip`, `StartRecording`, `StopRecording`, `studio.*`, `SetPreview`; `Command::StartStream`, `Streamer::attach`, `GoLive`, `EndStream` |
| Window of its own | `studio:window` | The same pieces, compact | — |
The studio's window has globals of its own: the controller sets the same
models (shared `VecModel`s) and the same values on both windows' globals
and wires both to the same callbacks (`bind/studio.rs`). The overlay
switches keep text sources named "Viewer count", "Chat overlay" and "Now
playing" in the live scene (they can be moved like any source). A TeamSpeak
stream has a name only, so the game goes into it after the title ("title —
game"), which is also what the gateway's directory shows. With sample data
(`VOELIN_DEMO_UI`) the studio runs from synthetic sources (the test pattern,
the synthetic camera with background blur, text, colours) and test tones,
on settings in memory, and recordings go to a temporary folder.
### Frame rate and quality in the quick share
The share dialog's lists (`FPS_CHOICES`, `BITRATE_CHOICES` in
`src/settings.rs`, the same lists in `dialogs.slint`) offer 15, 30, 60,
120, 144, 240 and 320 fps, and Auto (the default: from the size and frame
rate shared, up to 60 Mbit/s, the bitrate field left empty), 2.5, 4.6, 8,
10, 20, 40 and 60 Mbit/s; any other number can be typed, with no maximum.
Both are the settings `stream.fps` and `stream.bitrate_kbps` (0:
automatic). The `ui` blob keeps the index of the closest entry of the old
three- and four-entry lists for older versions.
### Sound in the quick share
The share dialog (`share`, and `share:live` for a running share) mixes its
sound with the studio's pieces: while "Share system audio" is on (off: no
audio at all) it shows the studio's mixer rows (`MixerRow`: meter, gain,
mute, a menu) for `stream.audio_sources`, and Add opens the studio's picker
(`PickDialog`) over it: the microphone, desktop audio without Voelin, the
shared window's application, any application that plays (on Android the
launchable apps with their icons), several at once. The rows read the
main window's `StudioBridge`, filled without starting the studio
(`App::mixer_show`). Starting a share hands the sources to the capture
(`CaptureRequest::audio_sources`); while it runs the dialog shows the
same rows with the share mixer's meters (about 15 times a second), and
every change of `stream.audio_sources`, from the dialog or anywhere else,
goes to the running capture at once (`Capture::follow_audio`, which calls
`Streamer::reconfigure`). A share started without sound has no audio track
to add sources to. With sample data `share:live` shares the test pattern
with the sample studio's sources, live at once with sample viewers.
## Adding a server
The add-server dialog (`BookmarkDialog` in `screens/dialogs.slint`, logic in
`servers/`: the decisions in `voelin-ui-vm`'s `servers::logic`, the Slint side
in `servers/bind.rs`) asks for the address (host, host:port, IP or server
nickname; the resolver finds the port through SRV records and TSDNS) and
an optional server password. *Advanced* (open when editing) has the name
and the nickname, and empty fields there are filled in: the name is the
address until the first connection, then the server's own name
(`adopt_server_name` in `voelin-ui-vm`'s `events`); the nickname is the
default identity's (one imported from TeamSpeak keeps its nickname there),
else the system user's, else "Voelin user"; the identity is the default one,
there is no default channel.
There are no gateway or ServerQuery fields: the gateway is looked up from
the address (DNS SRV records, else the gateway's `/.well-known/tsgw`) when
the server is saved, selected or connected
([gateway-admin.md](gateway-admin.md#letting-voelin-find-the-gateway)), one
found is stored, and a new address looks again. `bookmark` (or `join`) and
`bookmark:edit` open it (below).
Its footer has Delete at the left (when editing; only the icon on a phone),
then Cancel, Save and Connect. Save keeps the server. Connect, also Enter in
the address or password field, keeps it, connects it with voice and shows it
(`Bridge.save-and-connect`, `App::save_and_connect`): nothing connects when
saving failed. While the server has voice, Connect is hidden and Save is the
main button. Home's Add a Server opens this dialog too. The form also
carries a channel, its password and a privilege key for TeamSpeak links,
which are not stored with the server: with a channel the dialog shows
"Joins <channel>" and Connect connects into it; with a key it shows "This
link grants a server group".
### Links
A TeamSpeak link clicked in chat (or `link:<url>`, below) opens in Voelin
(`App::open_link` in `links.rs`). `voelin_model::Link::parse` reads
`ts3server://` and `teamspeak://` links (the scheme and the keys in any
case): the host (with a port as `host:port` or `[v6]:port`), and `port`,
`nickname`, `password`, `channel` (names from the top, `A/B`; a `/` in a
name is `%2F`, and `\/` in the path the dialog and the server get), `cid`
(a channel id, kept as the path `/<id>`), `channelpassword` and `token` (a
privilege key); other keys are ignored.
`tmspk.gg/s/<host>?…` (and `/s=<host>`) is the same server link, as its
page sends the browser on to `teamspeak://<host>?…`. Invite codes
(`tmspk.gg/<code>`, `teamspeak://invite=<code>`) only a TeamSpeak service
can resolve: the toast says they can't be opened yet.
The link's server is a saved one when the addresses match
(`vm::servers::same_address`: the host in any case, an IPv6 address with or
without brackets, no port as 9987; of several saved at that address, the
one in voice, else the one shown, `vm::servers::link_server`). In voice on
it, Voelin shows it and moves into the link's channel
(`vm::servers::channel_by_path`; of channels with the same name the first
in the tree that has the rest of the path) through `App::join_channel`,
with the link's channel password: a locked channel without one, or with a
wrong one, asks for it. A channel the server does not have is a toast.
Otherwise the dialog above opens filled in by
`vm::servers::link_form`: a saved server keeps its address, name, nickname
(a link never changes it) and stored password unless the link has one; a
new server takes the link's address, nickname (else the default one) and
password; both get the link's channel, its password and the key. Nothing
connects before Connect. `vm::servers::invite_link` (Copy invite link)
writes links with `ServerLink::to_url`, so they read back the same.
Selecting a server observes it invisibly through its gateway (or a query
login an older version stored), so its channels, members and chats show
without joining; there is no Observe button. Without a gateway, observing
starts once one is found.
Settings → Profiles (`ProfilesSection` in `screens/settings-pages.slint`;
`settings_pages/`, and `identities.rs` for the default and the import
switch) lists the stored identities with where they came from, marks the
store's default and has "Use as default" for the others, plus the switch
for importing the official clients' identities on start
([identity.md](identity.md)). `settings:profiles` opens it, and
`settings:identities` as well.
## Adding a screen
1. Write the screen in `ui/screens/<name>.slint` from the components
(`import { ... } from "../components/index.slint";`), reading data from
`Bridge` and navigating through `Nav` (e.g. `Nav.open-settings(...)`,
`Nav.show(Page.home)`). Text goes to the clipboard with `Nav.copy(text)`
(through a hidden text field in `MainWindow`; a toast confirms it).
2. New data: add a struct and a property (models: `[Struct]`) and callbacks to
`ui/bridge.slint`.
3. Place it: add a `Page` value in `ui/nav.slint` if it is a page, and in
`ui/app.slint` put its sidebar and main parts into `DesktopShell` under
`if Nav.page == Page.<name>:` (and a case in `MobileShell`). Dialogs go at
the end of `MainWindow` with an `*-open` flag in `Nav`.
4. Rust: a pure view model in `voelin-ui-vm/src/<name>.rs` (with tests) that
turns engine state into the plain bridge structs (`bridge.rs`, with a
`From` impl for the Slint struct in `bind/convert/items.rs`); a model in
`app::Models` set on the Bridge once and updated with `Rows::sync`;
callbacks in `voelin-ui/src/bind/<name>.rs` (call it from `bind::wire`);
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/bind.rs`, `VOELIN_OPEN=<name>`), a
screenshot (below) and a line in this file.
## Settings
The UI's keys (besides the engine's): `ui` (push-to-talk, H.264, share
dialog; one JSON value), `client_playback`, and the appearance keys, applied
live when they change (settings page, `--set`, another window):
| Key | Type | Default | Effect |
|---|---|---|---|
| `ui.theme` | dark / light / system | dark | colours |
| `ui.font_scale` | number above 0 | 1.0 | every type size |
| `ui.narrow_breakpoint` | pixels | 800 | below this width the phone layout |
| `ui.image_cache_mb` | megabytes | 256 | decoded images kept in memory (0: none) |
| `ui.members_width` | pixels | 280 | width of the members panel (dragging its edge sets it) |
| `ui.window` | JSON `{width, height, x?, y?, maximized}` | none | where the main window was when the last run ended: its size (the one it returns to when `maximized`), its position where the platform tells one (Wayland does not: no `x` and `y`), and whether it was maximized; the next run opens there. Read at start, not applied live; written by the GPUI front end only (the Slint app neither registers nor reads it) |
| `ui.tree` | JSON by server id: `{"<id>": {collapsed, selected}}` | none | what each server's channel tree remembers: the channels folded shut (`collapsed`, channel ids) and the channel last selected (`selected`), under the id of the server's bookmark; a server with nothing folded or selected has no entry. Read at start, written at every fold, unfold and selection (not with the sample servers); written by the GPUI front end only (the Slint app neither registers nor reads it: its tree forgets both when it ends) |
| `ui.voice_compact` | bool | false | the voice channel view's smaller stage (its Smaller stage / Larger stage button sets it, in both front ends; windows under 800 px tall always have it) |
| `ui.image_preview_kb` | kilobytes | 8192 | pictures linked in chat (files and `[img]`) up to this size show as pictures (0: never) |
| `notify.mentions`, `notify.private_messages`, `notify.pokes`, `notify.event_reminders`, `notify.friends_online` | off / app / desktop | desktop (friends: app) | what the bell and the desktop say about each kind |
| `video.camera`, `video.background`, `video.resolution`, `video.mirror` | device id; none / blur; auto or WxH; bool | first camera, none, auto, true | the camera of the preview and the default of camera sources |
| `studio.ui` | JSON | see below | the Stream Studio's stream settings: `title`, `game`, `message` (go-live), `show_viewers`, `show_chat`, `show_now_playing`, `audio` (stream audio), `preview_width` (960), `preview_fps` (15) |
In a config file write them as dotted keys at the top level
(`"ui.theme" = "light"`): a `[ui]` table is read as the `ui` value.
## Emoji
The software renderer has no colour glyphs, so emoji are images. The 3720
Twemoji SVGs are packed by `scripts/pack-twemoji.py` into
`crates/voelin-ui-vm/assets/twemoji.bin` (64 KiB blocks of raw deflate, an index sorted by key,
picker names and categories; 1.9 MB) and embedded in the binary. `voelin-ui-vm`'s `emoji.rs`
splits chat text into grapheme clusters, maps emoji to Twemoji keys (code
points in hex; U+FE0F dropped outside ZWJ sequences, as Twemoji names its
files; text-default symbols such as © or digits only with U+FE0F) and makes
runs of each span of a message (see Formatting): one per word and one per
emoji. A message without formatting or emoji stays one `Text` (fast path);
any other is a `RichText`, whose runs wrap in a `FlexboxLayout` (lines break
between words, not inside them; a run does not wrap, so a word longer than
24 characters, such as an address, is cut into runs). One to three emoji
alone are shown large. `Images.emoji(key)` decodes an emoji once
(`images.rs`, LRU by bytes) when a visible row asks for it.
The picker lists the emoji without skin-tone variants by category (coarse
code-point ranges) and searches Unicode names. There are no shortcodes yet.
## Formatting
TeamSpeak clients format chat with BBCode. `voelin-ui-vm/src/bbcode.rs` reads a message
into a `Doc`: blocks (lines, quote lines, code, list items, rules) of spans
with a style (bold, italic, underline, strike, code, colour, link) or a
picture. The Doc does not depend on BBCode, so Markdown (TeamSpeak 6) can be
a second parser making the same Doc.
- Tags: `[b]`, `[i]`, `[u]`, `[s]`, `[color=#rgb|#rrggbb|name]`, `[url]`,
`[url=…]`, `[img]`, `[quote]`, `[quote=Name]`, `[code]` (nothing inside is
a tag; one line is inline code, more are a block), `[list]` with `[*]`,
`[hr]`. `[left]`, `[center]`, `[right]`, `[size]`, `[table]`, `[th]` and
`[td]` are dropped and their text kept; `[tr]` starts a line.
- Tags are read in any case, and only known ones: `[Nova] hi` and `[1]`
stay text. A tag left open ends with the message; a closing tag that
closes nothing stays text.
- A line break starts a block. Bare `http(s)://` and `www.` addresses are
links, without the punctuation after them. Links go only to the web,
TeamSpeak servers and channel files: `[url=javascript:…]` is no link.
`classify_link` says which (`LinkKind`: `Web`, `Server` for
`ts3server://`, `teamspeak://` and `tmspk.gg` invites, `File`, `Refused`
for other schemes, backslashes, spaces, control characters and a leading
`-`); only those reach `TextRun.link`. A link whose text is not its own
address (`[url=…]raid board[/url]`, another address) is masked
(`is_masked`, `TextRun.masked`): it asks before it opens.
- Colours are honoured, made readable on each theme (a contrast of 4.5:1 to
the chat's background, keeping the hue).
- Past 16 tags open at once or 1500 spans (or runs), a message is plain
text.
`vm::chat` turns a Doc into `TextBlock`s of `TextRun`s, leaves out the file
links shown as cards, and shows `[img]` pictures that are in the engine's
cache as picture cards (else their address as a link). `ChatLine.text` is
the plain text (quotes as `> `, list items as `• `), for screen readers and
copying; `ChatLine.link` is the first web address. Lists of chats,
notifications and the home's news show the text on one line
(`Doc::one_line`). Built lines are kept per message id and revision
(`LineCache`), so a refresh leaves unchanged rows alone.
## Development switches and screenshots
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
scrolled up), and a stream, without a server (nothing is stored).
- `VOELIN_OPEN=<what>[,<what>...]`: `home`, `server` (`server:chat`: the server chat), `settings[:voice|keybinds|streaming|privacy|appearance|profiles]` (`identities` is the same as `profiles`),
`about`, `share[:live]`, `bookmark[:edit]`, `emoji`, `client`, `panel`, `no-panel`,
`voice` (`voice:compact`: the smaller stage, not stored), `more` (after `voice` on the phone: the
voice screen's More menu), `pins`, `topics`, `topic:<id>`, `member`, `poke`,
`channel-password[:wrong]`, `actions` (the last message's actions, as if
hovered: a screenshot cannot hover), `first-run` (Home's banner as before
the first server, over the sample data), `link-confirm[:<url>]` (the question
before a masked link opens, by default the sample's), `link:<url>` (a
TeamSpeak link opened, as from chat: the server dialog filled in from
it, or in voice on its server a move; Adding a server: Links), `unread` (the
current chat read up to five messages before its end: the New line,
scrolled up to; `unread:end` ten messages before, at the end of the list,
under the bar that counts them), `watch`, `theatre` (after `watch`:
theatre mode), `popout` (`watch` in a window of its own)
(the server page, above), `tab:<home|servers|chat|activity|you>` (phone
layout); `friends[:<uid>]`, `messages[:<uid>]`, `inbox`, `offline`,
`library`, `events`, `event-form`, `search[:<text>]`, `notifications`,
`join` (the same as `bookmark`), `picture`, `camera` (the settings'
camera preview, the test pattern) and the settings sections `account`,
`profiles`, `devices`,
`notifications`, `integrations`, `advanced` (above). With sample data, `watch` plays the local test pattern in the
sample stream's place. `studio[:window|live|record|source|audio|camera|scene|settings]`
opens the Stream Studio (above) in that state (`studio:live` also with a
screen opened after it: `studio:live,server,voice` shows our stream's card
with the studio's picture); with its window open, or the stream's
(`popout`), a screenshot also saves the window alone (`<name>-window.png`)
and draws it over the main window.
- `VOELIN_WINDOW_SIZE=390x844`: window size (phone layout below the breakpoint).
- `VOELIN_SCREENSHOT=<png>`, `VOELIN_SCREENSHOT_DELAY=<s>`: save the window and exit.
- `VOELIN_DEMO_STREAM=1`, `VOELIN_AUTOCONNECT`, `VOELIN_AUTOWATCH`,
`VOELIN_AUTOSHARE`, `VOELIN_DATA_DIR` as before.
```sh
scripts/shots.sh shot.png settings:appearance 1440x960
# which runs, headless:
env -u WAYLAND_DISPLAY -u XDG_SESSION_TYPE SLINT_BACKEND=winit-software VOELIN_DATA_DIR=$(mktemp -d) \
VOELIN_DEMO_UI=1 VOELIN_OPEN=settings:appearance VOELIN_WINDOW_SIZE=1440x960 \
VOELIN_SCREENSHOT=shot.png VOELIN_SCREENSHOT_DELAY=4 \
xvfb-run -a -s "-screen 0 1440x960x24" target/debug/voelin
```
Remove `WAYLAND_DISPLAY` as above in a Wayland session: winit prefers
Wayland, so the window would open on the desktop instead of on the Xvfb
server (and take whatever size the compositor gives it). Remove
`XDG_SESSION_TYPE` too: with `wayland` there the push-to-talk hotkey (and
screen capture) use the desktop portal of the real session even on Xvfb,
and the desktop may ask to bind the shortcut. The script also
turns FFmpeg off (`VOELIN_FFMPEG=0`: probing hardware encoders is not
needed for pictures and has crashed in a driver), makes the screen twice
the window's size so the pointer is not over the window, and passes
`$ARGS` to the app (`ARGS="--set ui.theme=light"`). The pictures in
`docs/screenshots/` were made this way (reduced to 256 colours with
`convert -colors 256 PNG8:`).
| Server page | |
|---|---|
| ![chat and members](screenshots/desktop-server.png) | ![voice channel](screenshots/desktop-voice.png) |
| ![pinned messages](screenshots/desktop-pins.png) | ![topics](screenshots/desktop-topics.png) |
| ![a topic](screenshots/desktop-topic.png) | ![member card](screenshots/desktop-member-card.png) |
| ![watching a stream](screenshots/desktop-stream-viewer.png) | ![popped out](screenshots/desktop-popout.png) |
| Stream Studio | |
|---|---|
| ![studio](screenshots/desktop-studio.png) | ![live](screenshots/desktop-studio-live.png) |
| ![its own window](screenshots/desktop-studio-window.png) | ![the window alone](screenshots/desktop-studio-detached.png) |
| ![a source](screenshots/desktop-studio-source.png) | ![phone](screenshots/mobile-studio-details.png) |
| Desktop | |
|---|---|
| ![home](screenshots/desktop-home.png) | ![light](screenshots/desktop-light.png) |
| ![settings](screenshots/desktop-settings-voice.png) | ![appearance](screenshots/desktop-settings-appearance.png) |
| ![emoji](screenshots/desktop-emoji-picker.png) | ![volume](screenshots/desktop-client-volume.png) |
| ![share](screenshots/desktop-share-dialog.png) | ![sharing](screenshots/desktop-share-live.png) |
| ![add server](screenshots/desktop-add-server.png) | ![about](screenshots/desktop-about.png) |
| Home, friends, messages | |
|---|---|
| ![friends](screenshots/desktop-friends.png) | ![direct messages](screenshots/desktop-messages.png) |
| ![the bell](screenshots/desktop-notifications.png) | ![search](screenshots/desktop-search.png) |
| ![events](screenshots/desktop-events.png) | ![library](screenshots/desktop-library.png) |
| ![integrations](screenshots/desktop-settings-integrations.png) | ![profiles](screenshots/desktop-settings-profiles.png) |
| Phone layout | | | | |
|---|---|---|---|---|
| ![chat](screenshots/mobile-chat.png) | ![servers](screenshots/mobile-servers.png) | ![home](screenshots/mobile-home.png) | ![you](screenshots/mobile-you.png) | ![settings](screenshots/mobile-settings.png) |
| ![voice channel](screenshots/mobile-voice.png) | ![activity](screenshots/mobile-activity.png) | ![studio](screenshots/mobile-studio.png) | ![share](screenshots/mobile-share.png) | ![sharing](screenshots/mobile-share-live.png) |
| ![friends](screenshots/mobile-friends.png) | ![messages](screenshots/mobile-messages.png) | ![events](screenshots/mobile-events.png) | ![the bell](screenshots/mobile-notifications.png) | ![streaming settings](screenshots/mobile-settings-streaming.png) |
| ![add server](screenshots/mobile-add-server.png) | | | | |
## Server and channel pictures
The compact server card shows its icon over the host banner. TeamSpeak 6
channel banners sit behind their titles in fixed-height tree rows (34 pixels),
and behind desktop and phone chat/voice headers. Artwork uses centred cover
cropping without distortion; it never adds height to navigation. Custom channel
icons lead the title. Top-level spacer channels show their text without the
prefix and without an icon or a member count: `[spacerN]` and `[lspacerN]` on
the left, `[cspacerN]` centred, `[rspacerN]` on the right, and `[*spacerN]---`
repeats its text across the row as a line (any text may follow `spacer`, as
it only keeps names unique). Every screen that names a channel, and the
Android voice notification, shows a spacer's text; the tree search, Ctrl+K and
the event form leave out lines and empty spacers. A theme-aware surface
gradient (74% to 66% opacity) keeps primary text above 4.5:1 contrast even on
all-white or all-black artwork, while leaving the image visible. Missing
pictures retain the normal background.
A channel has one icon everywhere, a speaker (`Icons.channel`, a lock for a
locked one in the tree), and chat tabs, notifications and search results name
it without a `#`. A server icon at most half as wide as its avatar (TeamSpeak's
are often 16 pixels) is drawn at twice its size, sharp, on the server's colour
instead of stretched. Avatars under 28 pixels, as the tree's clients, show one
letter.
Bookmarks remember the server icon ID and the address that supplied it. The
server list, search results and server header load its cached bytes before
connecting, including after restarting the app. Editing a server address
invalidates the association; queued details from the old address cannot replace
it. A missing or evicted image falls back to initials. This requires no
ServerQuery configuration and starts no background voice connection.
First-visit icon downloads before login remain unverified. On a private TS6
6.0.0-beta13.1 fixture, the native encrypted handshake completed without
`clientinit`, but pre-login `serverinfo`, `getserverinfo`, `servergetvariables`,
`ftinitdownload` and `ftgetchannelfilehttptoken scid=icons` probes each received
no response within three seconds. The installed official client's UI code
populates its bookmark icon cache from connected server properties. Its clean
profile requires account setup before the server list, so no fresh-profile
network capture was obtained. These observations do not establish that every
server or client version lacks a pre-login mechanism.
Badges arrive as GUIDs (`client_badges`; on TeamSpeak 6 also
`client_signed_badges`, the myTeamSpeak badges the server verified, which
come first: `voelin_model::shown_badges`). Their names and descriptions come
from a table in `voelin-model` (`badges::info`, tsclientlib's list and the
newer entries of TeamSpeak's own, `https://badges-content.teamspeak.com/list`,
as of October 2026); newer badges show as "Badge". Their pictures are SVGs
on TeamSpeak's server (`https://badges-content.teamspeak.com/<guid>/<filename>.svg`,
`badges::icon_url`), fetched like web banners for the first three badges of
each client in the presence shown, and reported with `PictureReady`. A
client's tree row shows the pictures that arrived right after the name (its
group and client icons stay at the end); so does its row in the members
panel.
The engine downloads banners and badges, and the pictures chat messages
show (`[img]`, `Command::FetchPicture`), only while `cache.fetch_images` is
enabled.
Banners on the web (`http`, `https`) come from their host; banners in the
server's own files, linked as `ts3image://` (TeamSpeak 5 and 6:
`ts3image://<host>?port=…&channel=…&path=…&filename=…`, the file browser's
`ts3file://` link with its scheme changed; TeamSpeak 3:
`ts3image://<name>?channel=…&path=…`), come through the voice connection's
file transfer, so they need voice and the server's file permissions. Their
cache entry is named by the server too, as the same address names another
file elsewhere. Up to 16 web downloads run at once, at most 6 per host (a
redirect's target counts); duplicate URLs share a request. Pictures on the
web go through the desktop's proxy (the portal's, on Linux) or the
system's, SOCKS too. A picture may be up to 128 MiB (avatars and icons
too; myTeamSpeak avatars 4 MiB, a chat's `[img]` up to
`ui.image_preview_kb`), and goes to disk as it arrives. Web downloads
connect within 20 seconds, and fail after 60 seconds without data or when,
after their first 120 seconds, they average less than 8 KiB/s; there is
no fixed overall deadline, so large banners on slow hosts still arrive.
Failed banners and badges are tried again after 1, 4, 16, 60, 300 and 900
seconds, then every 15 minutes while they are shown; one whose address is
wrong or gone (HTTP 400, 404, 410) after 15 minutes, then hourly; one whose
host asks to wait (429, 503) when it says (1 minute to 1 hour). Asked for
again, a cached picture is downloaded only if its host says it changed
(ETag, Last-Modified). Avatars, icons and chat pictures receive up to three
automatic retries after 1, 4 and 16 seconds. Retries do not wait for a
presence update. Avatar/icon/banner file-transfer negotiation expires
after 30 seconds, and the download after 60 seconds plus its size at
8 KiB/s. User file transfers retain their existing timing. Replaced images
and closed sessions discard obsolete results. A host banner's reload
interval is at least 60 seconds; failed refreshes preserve the previous
cached picture. Closing the session stops its reload timer.
`PictureReady` (and `AvatarReady`, `IconReady`) has a file that changed
decoded again before the visible models refresh, also when the URL and
cache path stay the same.
PNG, JPEG, GIF, WebP, BMP, ICO and SVG (also after a comment or DOCTYPE)
are decoded by content, since cached files have no extension. Raster
pictures whose decoded RGBA would exceed 128 MiB are refused before pixel
allocation on the UI thread; those larger than 4096 pixels on a side are
scaled down (an animation to its first frame). SVG uses Slint's vector
loader and the existing vector-cache cost.
Avatars and server, channel, client and group icons use the same image cache.
The focused checks are the `voelin-core`, `voelin-observer`,
`voelin-store` and `voelin-ui` library tests. They cover offline icon restoration,
bookmark compatibility, cache misses and old-address event rejection. The live
`ts6_banners` test checks disabled
fetching, recovery from HTTP 503 without another presence update, all three
modes, channel URL replacement and removal, and a fresh host download after
the 60-second interval. `ts6_avatars` uploads an avatar with one client and
verifies its bytes and MD5 after another client downloads it into an independent
cache. Both use
the development TS6 server by default; a private fixture can override its
endpoints without changing the other live tests:
```sh
VOELIN_LIVE=1 \
VOELIN_BANNER_VOICE_ADDR=127.0.0.1:19988 \
VOELIN_BANNER_QUERY_ADDR=127.0.0.1:20022 \
cargo test --locked -p voelin-core --test live ts6_banners -- --exact
```
The 2026-10-04 follow-up passed all 200 focused library tests. The download
checks passed both live scenarios against a private
TS6 6.0.0-beta13.1 instance, including its real reload interval. The compact
layout passed seven headless screenshot scenarios. These screenshots use
sample data on Xvfb with Slint's software
renderer; the phone layouts are desktop renders, not Android device tests.
| Desktop | Phone layout |
|---|---|
| ![Dark chat and channel banners](screenshots/banners-desktop-dark.png) | ![Channel banner in the mobile chat header](screenshots/banners-mobile-chat.png) |
| ![Light chat and channel banners](screenshots/banners-desktop-light.png) | ![Light server list](screenshots/banners-mobile-servers.png) |
| ![Banner in the desktop voice header](screenshots/banners-desktop-voice.png) | ![Banner in the mobile voice header](screenshots/banners-mobile-voice.png) |
## The GPUI front end
`crates/voelin-gpui` (binary `voelin-gpui`) is the second front end, on GPUI
(`gpui-kit`, pinned exactly at `=0.8.1`: GPUI, gpui-component and their assets
behind one pre-1.0 dependency). Plan section 6 step 3 builds it slice by
slice next to the Slint front end, which stays the app: both are `[[bin]]`s of
one workspace on the same engine and the same `voelin-ui-vm` state until the
GPUI one reaches parity. It does not depend on `voelin-ui` (that would bring
Slint in), so the few lines of the Slint crate's `HostedEngine` are repeated
in `engine.rs`. The measured case for the migration, and the versions and
conditions it settled, are in [design/gpui-spikes.md](design/gpui-spikes.md).
### What exists
```
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 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
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, the
channel tree and the members have (over `voelin_ui_vm::servers::
{logic, sequence}`, which Slint calls too)
hotkey.rs GlobalPtt: the global push-to-talk key's task, spawned on the engine's
runtime, its presses and releases handed to GPUI's thread through Later
signals.rs `Update.refresh` as per-area signals: entities with a generation
that the panes observe
pictures.rs the engine's pictures on screen: decoded per file and stamp, the
copies of a file written again dropped
view.rs MainView, the window's root view: the shell or the swatch, the
handlers of the actions, the server form, the password prompt, the
title, the window's place
shell/ the desktop shell and its panes (below): rail.rs, sidebar.rs,
topbar.rs, main_panel.rs, channels.rs (the tree), members.rs (the
panel and its card, with the volume of a person), voice.rs (the
voice channel page and its call bar), tree_model.rs, password.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'; 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`, 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 pictures the
engine wrote again are dropped from the decoded ones, and the flags of what to
redraw (`Update.refresh`) are raised as per-area signals once per batch
([The channel tree and the members](#the-channel-tree-and-the-members)); the
rest (the notices, 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 window's title and the toast follow
it); the panes listen to the signals, 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): 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, a window left maximized is zoomed once
and stays remembered so, 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), the channel tree and the members panel on the sample server's
events (the rows, folds kept in the settings and found by the next run, a
double-click that joins, the password prompt, a move and a mute as their
exact row operations, a talker that redraws the tree and the members panel
and no other pane, the member card, an avatar written again), a connect through a real
engine that has no connector (it answers that none serves the address, which
reaches the status line), the voice page and the call bar (below), 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 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
links `libxcb` and `libxkbcommon-x11` (the build needs `libxkbcommon-x11-dev`
and `libxcb1-dev`, which the package lists before it did not name) and opens
`libwayland-client`, `libvulkan.so.1` and `libEGL.so.1` by name. Which device a
run took is in the log ("Selected GPU adapter: ..."; the default filter shows
GPUI's adapter lines: `VOELIN_LOG` or `RUST_LOG` change it). On Wayland and
on X11 (a window manager is needed there for fullscreen and close requests).
A window that cannot open ends the app with the reason and exit status 1; it
does not stay up without a window. With no usable driver (none installed, or
`VK_DRIVER_FILES` pointing nowhere) the message is
```
Error: cannot open the main window
Caused by:
Failed to create surface: Failed to create surface for any enabled backend: {}
```
and above it the log has the Vulkan loader's own lines (`vkCreateInstance:
Found no drivers!`); install a driver or lavapipe. With no display server
(neither `DISPLAY` nor `WAYLAND_DISPLAY` set, over ssh for one) it is `cannot
open the main window`, caused by `no display: neither DISPLAY nor
WAYLAND_DISPLAY names a display server`; GPUI alone would start its headless
platform there, which opens windows that draw nothing and runs until it is
stopped. `tests/launch_failure.rs` starts the binary both ways (the driver one
needs the test display of `VOELIN_X11_TEST_DISPLAY`; it hides the drivers
through `VK_DRIVER_FILES`, `__EGL_VENDOR_LIBRARY_DIRS` and
`LIBGL_DRIVERS_PATH`, and is skipped where the machine's driver is found
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_OPEN=voice` (`voice:compact`) | the voice channel page in the main area once voice is connected (with the sample servers the first one is, so at start); `voice:compact` on the smaller stage, which is not stored |
| `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, with its channels, people and their pictures, the second observed); nothing is sent to the engine or kept in the store, the window's place and what the trees remember included, and the servers cannot be changed. The pictures are files of a folder of the state's own in the temporary directory, removed when the window closes (a killed run leaves it) |
| `VOELIN_DEMO_SERVER=2` | with the sample servers, the one on screen, counting from 0: the first (the default) is connected and populated, the second observed (its tree says it is loading), the third not connected (its tree says to connect) |
| `VOELIN_DEMO_TALK=10` | with the sample servers, one sample person starts or stops talking this many times a second (a rate from 0.1 to 100), through the app's own events: what the meter measures while someone talks |
| `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; the renders of each pane, `rail`, `topbar`, `sidebar`, `tree`, `main`, `members` and `voice`; `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` (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,
and the state directories are temporary ones: a run never touches the desktop
or `~/.local/state/voelin`. **The screen must be larger than the window**:
`headless.sh`'s default is 3840 by 2160 and `xvfb-run` gets twice the window.
On a screen as large as the window, openbox fits the window and its frame into
it and the picture comes out smaller (1438 by 935 for 1440 by 960, which is how
the first set of pictures was made); on a larger one it is exactly the size
asked for. `docs/ui/gpui-swatch-dark.png` and `gpui-swatch-light.png` are two
such pictures (truecolour: a reduction to 256 colours would change the tokens'
values), and the five of the shell are made the same way (1440 by 960, on
Xvfb `:143` of 3840 by 2160 with openbox and Mesa's lavapipe, the debug build,
a state directory under the checkout's `.scratch/`).
![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 empty shell at the same size, the rail's plus clicked
and an address and a name typed with `xdotool` (the nickname is the login's;
the picture was taken as `nova`).
![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
listens to the signals of its area (the next section), makes its view of the
state (`voelin_ui_vm::servers::logic`: `rail`, `toolbar`) and tells the window
only when the view differs from the one it showed (`cx.notify()`): an engine
event about a talker, a setting that is not the theme's or a tick tells no part,
so the window is not drawn at all (the `what_changes_nothing_shown_draws_nothing`
test counts the parts told). In gpui-pre 0.3.10 a child view embedded with
`.child(entity)` is rendered again on every frame; only `Entity::cached`, which
needs a size of its own, reuses a subtree until its entity is notified. Slice 1
embedded every part uncached, so a part that was told made the window draw every
part; since slice 2 the rail, the top bar, the main area, the channel tree and
the members panel are cached and only the sidebar's cards and the toast are
rendered with every frame ([what a change costs](#what-a-change-costs)).
- **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, over the server's
banner when it has one: slice 3), 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, else the
mode in words) 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, Voice channel (while voice is connected: it opens the voice page,
[below](#the-voice-page-and-the-call-bar)) and Edit, until the chat comes.
- **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
`servers::sequence`, the one sequence over the store, the secrets and the
engine's commands that the Slint front end runs too ([Shared with the Slint
front end](#shared-with-the-slint-front-end)):
| 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`; the server that comes on screen has its remembered folds put back (as has any server a transition puts on screen: a save, a connect) |
| `invite` | `Invite` | `logic::invite_link`, the link on the clipboard, the status line's note |
The others of that file: `join_channel`, `join_with_password`, `toggle_collapse`,
`search_members` and `open_client` are slice 2's ([the channel tree and the
members](#the-channel-tree-and-the-members)); `show_voice_view` is the voice
page's (slice 3, [below](#the-voice-page-and-the-call-bar)), `client_audio_changed`
the dialogs' (the member card has the volume of a person, `SetMemberVolume`), and
`copied`, which the Slint toast of a copy needs, `Invite` does for itself. `AddServer`,
`CancelServerForm`, `OpenSearch` and `OpenSettings` are the shell's own.
#### Shared with the Slint front end
What the Slint crate's `servers/bind.rs` and `app.rs` did and this front end
repeated lives in one place and both call it (the Slint methods are thin
wrappers, so its call sites are unchanged):
- **`voelin_ui_vm::servers::sequence`**: `connect_voice_to`, `connect_voice`,
`observe`, `discover_gateway`, `gateway_found`, `select_server`,
`save_bookmark`, `save_and_connect`, `delete_bookmark`, `bookmark_form`,
`default_nickname` and, since the channel tree, `join_channel` and
`join_with_password` (over `connect_into`). Each is a transition over the
state, the `Cx` and a `Backing` (the store, the secrets and the identity a
connection is made with), so the engine's commands, the status line, what is
to be kept and the gateways to look up (`Update::discover`) go out through the
update, and each front end's `perform` and its tests handle them as they
handle every other transition's (the GPUI tests see the commands as
`take_sent`, and the sample servers' are dropped there). `transition_with` of
each front end hands the `Backing` over: the GPUI root state's and the Slint
`App`'s own fields. `stream_peer` is the one input a front end gives (the
Slint one's `video.peer_config`; this one passes none).
- **`voelin_ui_vm::settings::open_settings`** and `register_keys`: the settings
service on `client.db` with the UI's keys, `config.toml`, `VOELIN_SETTING_*`
and `--set`; each front end registers its own key (`ui.window` here, the
Stream Studio's `studio.ui` there) through the function it passes.
- **`voelin_store::FallbackSecrets`** (the keyring first, memory where it
refuses) and **`Store::identity_for`** (the identity a bookmark names, else
the default, else the one made at start); the Slint settings page's own copy
of the identity choice calls the store's since the tree slice.
- **`voelin_ui_vm::tree::member_card`** (the card over a member row),
**`servers::logic::open_member`**, `Refresh::merge` (the flags of a batch of
events) and the `ui.tree` key (`settings::UI_TREE`, `TreeState`: the channels
each server's tree has folded and the one selected, written by the GPUI front
end like `ui.window` and not read by the Slint one). Slint's `bind/servers.rs`
and `members.rs` keep their own versions of the joins, the card and the open
card, since `voelin-ui` is edited only for the identity helper in this round
("For the next slices").
Left as copies, because they need the toolkit, the runtime or a front end's own
state: the thread hop of the gateway lookup (`look_up_gateway`: each front end
runs `sequence::find_gateways` on the engine's runtime and comes back through
its own `Later`/`later`), `perform` (what an `Update` does to a window), the
status line's toast, the invite's clipboard write, `HostedEngine` (`engine.rs`),
`GlobalPtt` (`hotkey.rs`: the global key's task needs the engine's runtime and the
front end's own way back to its state), the guards of the GPUI shell's save (`save_refused`: the sample servers are not
kept, and a server needs an address, which the Slint dialog checks in
`dialogs.slint` before it calls), the store at start (`Backend::open` against
`run()`: the identity import, the crash reports and `--set` of the Slint one)
and the form widgets themselves.
**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. **Maximized** is asked for twice: GPUI
asks when it creates the window (`WindowBounds::Maximized`: a Wayland
compositor is expected to honour that, which was not run here), and the window
asks again when its first frame is drawn if it is not maximized by then
(`MainView`: `Window::zoom_window`, which toggles on X11, hence the check),
because an X11 window manager manages a window only from its map, so the early
request is lost (openbox: the window opened at its restored size). The first two
windowed reports of a window opened to be maximized (the place it opened with,
and the configure an X11 window manager may send when it maps the window) are
not kept, so a run that ends before the window manager answers leaves
`maximized: true` as it found it; the reports after them are the user's, kept
whether or not the window was seen maximized (a resize before the window
manager answered, or under one that never maximizes, a tiling one, is kept),
and once it has been seen maximized what it reports is the user's too
(restoring it is kept). A maximized window is kept with the size it returns to
(X11 reports the screen's; Wayland the size it returns to). The `maximized`
request itself needs a real window: GPUI's test platform has no zoom, so the
tests count the request and report the window manager's answer themselves; it
was seen at run time under openbox (below). A development switch that sets the
size or the sample data leaves the setting alone.
Seen at run time (the debug build of the commit that made it, Xvfb `:143` of
3840 by 2160 with openbox and Mesa's lavapipe, a state directory under the
checkout's `.scratch/`, no contact with the desktop's session): a first run
opened at 1280 by 800, openbox's `A-F10` (`ToggleMaximize`, bound in the run's
private `rc.xml`) maximized it (`_NET_WM_STATE_MAXIMIZED_VERT` and `_HORZ`, 3840
by 2141 below the title bar), Alt+F4 closed it with exit status 0, and `ui.window`
held `{"width":1280,"height":800,"x":1280,"y":687,"maximized":true}`: the size
it returns to, not the screen's. A second run came up maximized with no one
touching it, and closed the same way leaving the same value. The same second
run on the commit before the fix, started on a copy of that database
(`maximized: true`): the window opened at 1280 by 800 with no `_NET_WM_STATE`, and
Alt+F4 left `{"width":1280,"height":800,"x":1280,"y":687,"maximized":false}`,
the two things the gate found; the fixed binary on the same copy came up at 3840
by 2141 with both maximized atoms and left `maximized: true`.
**The minors round** (`phase5/gpui-shell-minors`, after the Opus gate accepted
the slice with six minors; the commits say each): the records of what a part's
notify draws (above, and "For the next slices"), a window left maximized is
maximized again on X11 and stays remembered so (the paragraph above), the
pictures at 1440 by 960 (a screen larger than the window), the connect test
makes no DNS query (its lib test binary makes no `connect` or `send` at all
under `strace`), the server sequences shared with the Slint front end
([Shared with the Slint front end](#shared-with-the-slint-front-end)), and the
`ui.window` row of the settings table. The four risks the gate listed are in
"For the next slices".
**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 channel tree and the members
Slice 2 of plan section 6 step 3: the sidebar's channel tree and the members
panel of the server on screen, with the callbacks of the Slint
`bind/servers.rs` that belong to them, on the same `voelin-ui-vm` rows
(`servers::logic::tree_view`) as the Slint front end.
| An empty server (not connected) | A server on screen |
|---|---|
| ![the shell, a server not connected, dark](ui/gpui-tree-empty-dark.png) | ![the channel tree and the members, dark](ui/gpui-tree-dark.png) |
| ![the shell, a server not connected, light](ui/gpui-tree-empty-light.png) | ![the channel tree and the members, light](ui/gpui-tree-light.png) |
The pictures are the shell at 1440 by 960 under `scripts/gpui-shot.sh` (the
recipe above, on a display of its own, with the state under the checkout's
`.scratch/`): the right ones are the first sample server (`VOELIN_DEMO_UI=1`:
nine people in four groups and the streaming section, nested channels with a
centred, a right-aligned and a line spacer, banners, icons, badges, a locked
channel), the left ones the third (`VOELIN_DEMO_SERVER=2`: not connected, so
its tree and its panel say to connect). The two of the first sample server were
taken again for the review's fixes (the release build of `bad5312`, lavapipe
through Vulkan on Xvfb `:201` of 3840 by 2160 with openbox, 1440 by 960): the
banner rows, Raid Night and Music, are under the veil, and the avatars of the
tree show one letter.
![the tree with a banner row selected and one under the pointer, dark](ui/gpui-tree-banner-selected-dark.png)
`gpui-tree-banner-selected-dark.png` is the same window with Raid Night selected
(a click) and the pointer on Music: a banner row shows its selection and its
hover as a tint over the picture, as the speaking ring and bars show on Kairo's
row (release build of the commit that tinted them, lavapipe through Vulkan on
Xvfb `:233` of 3840 by 2160 with openbox, 1440 by 960, two `xdotool` moves and
`xwd`, the state under the checkout's `.scratch/`).
What is on screen:
- **The channel tree** (`channels.rs`, in the sidebar between the server card
and the voice card): the channels of the server with the people in them as
`voelin_ui_vm::tree::rows` makes them, nested 14 pixels a level. A channel
row has its icon (the server's own picture, else a speaker, else a lock), its
name as the server set it out (a spacer is centred, right-aligned or a line
cut where the row ends), its lock at the end when it has an icon of its own,
how many are in it ("3" or "3/50", with a users mark on ours), the chevron,
the banner picture behind it and our channel highlighted. The banner has the
veil of `components/banner-picture.slint` over it (`widgets::banner_scrim`:
the surface colour, 74 % opaque on the left to 66 % on the right, under the
tints of the row), so the name keeps more than 4.5 to 1 against any
picture in both themes (a test states it for the weakest end over a black
and a white picture). The row's own background (the selected one's and the
hover's) is under the picture, which covers it from the indent on, so a row
with a banner shows its states as translucent tints over the veil: our
channel's accent tint, the selected row's (surface 3 at 75 %) and the hover's
(surface 3 at 50 %, as `channels.slint` tints it). A person's row has their
avatar (the first letter
only, at half the size, under 28 pixels as `avatar.slint` does), name (ours
in the accent colour, someone away muted), badges, a
LIVE tag while they stream, the marks of local mute (or volume) and of their
microphone and sound, "away", and the icons of their groups. A click selects a
channel, a double-click joins it, the chevron folds it, a right-click offers
Join channel, Fold or unfold and Edit channel (logged: the channel editor is a
slice of its own) and, on a person, Show the card, Volume… (logged: the volume
dialog) and Move to my channel (logged: the engine has no command for moving
another client); a click on a person is the volume dialog's, logged too.
- **The members panel** (`members.rs`, as wide as `ui.members_width`, 280 by
default, for a server on screen): "Members — 9", a search, and everyone in
sections, each with its heading and count: the people streaming first, then
each server group in the server's order. A person has their avatar with the
presence dot (away, sound off, there) and the green ring while they talk,
their name with the crown of an admin group, the star of a priority speaker,
the flag of a channel commander, the record mark and up to three badges, what
they do ("Speaking" with its bars, "Streaming", "Away: brb", "In Lobby"), a
moderator's role, LIVE, the mute marks and the hand of a person who needs talk
power. The search narrows the sections to the names it matches.
- **The member card**: a click on a person opens their card over the panel with
a scrim a click outside closes: name, status, description, groups, badges (what
each is for on hover), talk power and country, and since the voice page the
Volume rows: what they are played at, a mute for us and a slider. It follows
the person while it is open and goes when they leave.
- **The password prompt**: joining a channel that has a password and whose
password was not given this connection asks for it (a card over the window,
Enter joins); a password the server refuses asks again, in words. As in the
Slint dialog, Join is off and Enter does nothing while the field is empty
(the prompt stays), and Escape closes it without joining, wherever in the
prompt the last click was (below).
#### Per-area signals and cached panes
The foundation's and the shell's reviews left the design for this slice: a
change of the channel tree must not draw the rail, and a talker draws the tree
and the members panel and nothing else (the gate's parity ruling, below). Two parts of it came from reading gpui-pre 0.3.10 and were checked by
the tests:
- **`Update.refresh` is raised as signals** (`signals.rs`). The root state
turns the flags of an update into entities with a generation, one per area
(servers, toolbar, tree, member card), once per batch of engine events and
once per transition, and the rail, the top bar, the sidebar and the tree
model listen to their areas instead of asking the root whether anything
changed for them. The flags of areas that have no pane yet (chat, streams,
...) are dropped, as `perform` dropped all of them before.
- **Panes are cached** (`Entity::cached`, which needs a size of its own): the
rail, the top bar, the main area, the channel tree and the members panel are
rendered again only when their entity was notified, which the meter counts
(`rail`, `topbar`, `sidebar`, `tree`, `main` and `members` per second beside
the window's frames). Three rules came with it. A cached pane's root must be
`size_full` (laid out on its own it is as large as its contents, which showed
as a main area as wide as its text). The ancestors of a notified view are
notified too, and a view rendered again renders the cached views inside it
again (its `refreshing` mode ignores their caches), so cached panes are
siblings under uncached containers (`MainView` and the plain divs): the tree
is cached inside the sidebar, which is not, and the sidebar is rendered with
every frame. A per-row entity inside a pane buys nothing for the same reason
(a row's notify makes the pane render, and the pane's render makes the cached
rows render), so the unit is the pane and a virtual list keeps what it builds
to the rows in view.
- **A narrow model between the state and the panes** (`tree_model.rs`): one
entity builds the rows for both panes on the tree, toolbar and member-card
signals, compares them with the rows it had (`voelin_ui_vm::list::diff`, the
operations the Slint front end applies to its `VecModel`) and emits what
differs, with the rows the operations lead to (`TreeEvent::Rows(Changes,
Arc<Vec<TreeItem>>)`, `People` the same). A pane applies the operations to its
list state (`gpui::ListState`: a person who joins is a row inserted and the
scroll stays where it was) and to the rows it has, and keeps the rows the
event carries, not the model's at the moment it hears of them; a change that
moves none of the rows of a pane emits nothing to it.
- **The tree marks who talks, and is drawn once for each start and stop.** Its
rows keep `talking`, so the avatar has the green ring and the row the three
speaking bars, as `channels.slint` draws them (the bars stand still: nothing
here draws the window with the clock). Someone who starts or stops talking
changes one row of the tree and one of the members panel, and each of those
two panes is rendered once for it, with the sidebar, which every frame
renders; no other pane is (the `a_talker_changes_one_row_and_draws_the_tree_once`
and `a_talker_redraws_the_tree_and_the_members_panel_and_no_other_pane` tests
count it). The first version of the slice cleared the flag to keep the tree out
of it; the gate ruled for parity with the Slint tree, and the cost was
measured: 9.97 renders of the tree a second for 9.97 starts and stops a second
([what a change costs](#what-a-change-costs)).
#### What a change costs
`VOELIN_METER=1`, release build of `faef132`, 1440 by 960 on Mesa 26.2.5's
lavapipe through Vulkan on Xvfb `:151` and `:152` with openbox, the first sample
server on screen (nine people, nine channels), the machine's other jobs at a
load average of 38 to 100 (the first run, of the tree committed as `aa640cf`,
which was built just before that commit, at 21 to 43, is below); the first 15
seconds of 75 left out, 60 samples of one second (59 for the second run: the
loaded machine left a second out); CPU in percent of one core, whose resolution
is the 1 % of a clock tick; renders per second as the meter counts them (the
window's frames, and each pane's passes):
| | CPU, mean (max) | Of it `llvmpipe` | GPUI's thread | Resident memory | Window frames a second | Rendered a second: rail, top bar, sidebar, tree, main, members |
|---|---|---|---|---|---|---|
| Idle, the first sample server on screen | 0.5 % (2 %) | none above 0.5 % | under 1 % (the tick) | 220.0 MiB | 0.0 | 0, 0, 0, 0, 0, 0 |
| A sample person starts or stops talking 10 times a second (`VOELIN_DEMO_TALK=10`) | 97.1 % (106 %) | 90.8 % | 5.0 % | 226.7 MiB | 9.7 | 0, 0, 9.7, 0, 0, 9.7 |
A window nobody touches is not drawn, with the tree and the panel on screen as
before (the shell alone was 192.7 MiB; the pictures and the two panes' state
are the difference, not itemized). Someone who talks is one engine event and so
one frame: the members panel was the only pane that was rendered for it (the
tree carried no `talking` then; the figures of the talking marks are below),
and the sidebar, which every frame renders (its cards are small and have no size
of their own to cache at); the rail, the top bar, the main area and the tree
were not rendered at all in the 570 events of the run. GPUI's own thread spends 5 %
of a core on the 9.7 frames a second (the first run, of the `aa640cf` tree on a
quieter machine, 3.4 % at 10.0 frames, with `llvmpipe` at 100.9 % and 105.4 % in
all; the loaded machine starved the process of a frame in ten).
The rest is the software device: `llvmpipe` draws the whole 1440 by 960 window
again for every frame, about 90 ms of CPU a frame on this machine, which a GPU
does; so the figure that says what a talker costs the app is the thread's, and
the one that says what a window nobody touches costs is the idle row.
**Again after the review's fixes** (the banner veil, one letter on small avatars
and the password prompt change what a row draws, not when a pane is rendered):
the same two runs on the release build of `bad5312`, Xvfb `:211` and `:212` of
3840 by 2160 with openbox, the machine at a load average of 23 to 40, 60 samples
each. Idle: 0.6 % (2 %), 219.9 MiB, no pane rendered and no frame. A sample
person talking 10 times a second: 106.4 % (111 %) in all, `llvmpipe` 102.3 %,
GPUI's thread 3.1 %, 225.9 MiB, 10.0 frames a second, rendered per second 0, 0,
10.0, 0, 0, 10.0 (the sidebar and the members panel only, as above).
**Again with the talking marks on the tree** (the speaking ring and bars on the
tree's rows, which the gate's ruling restored; they make the tree pane change
with every start and stop): the talking run on the release build of the commit
that restored them, lavapipe (Mesa 26.2.5, `llvmpipe (LLVM 21.1.8, 256 bits)`
through Vulkan) on Xvfb `:231` of 3840 by 2160 with openbox, 1440 by 960, the
state under the checkout's `.scratch/`, the machine at a load average of 83 at
the start and 41 at the end, 60 samples after the first 15 of 75. A sample person
talking 10 times a second (`VOELIN_DEMO_TALK=10`): 102.2 % (112 %) in all,
`llvmpipe` 95.6 %, GPUI's thread 5.0 % (8 % at most), 224.0 MiB, 9.97 engine
events and 9.97 window frames a second, rendered per second 0, 0, 9.97, 9.97, 0,
9.97 (rail, top bar, sidebar, tree, main, members): the tree pane is rendered
once for each start and stop, as the members panel is, and the rail, the top bar
and the main area not at all. The tree's pane costs no measurable CPU on top: the
thread's 5.0 % is the figure of the first run (5.0 %) and above the second's
(3.1 %), a spread the load of the machine makes, and `llvmpipe` draws the whole
window for a frame whichever pane asked for it.
**Seen against a server** (the TeamSpeak 3 development server of
`dev/docker-compose.yml`, 3.13.8, release build of the tree committed as
`aa640cf` (built just before that commit, whose own changes to the tests came
after; the fixup `faef132` touches the sample pictures and two small things the
run did not meet), Xvfb `:160` of its own with openbox, lavapipe, no sound card,
the state under the checkout's `.scratch/`; a spacer heading, a sub-channel, a
channel with a password and one limited to five clients were made over
ServerQuery for the run and deleted after it): the form's Save and connect shows
the real tree (Default Channel with our client, "1 online · 7 channels", the
lock, "0/5") and the panel ("Members — 1", "Guest — 1"). A double-click on a
channel moved the client there (`clientlist -voice` over ServerQuery: channel
4); the locked channel asked for its password, the server refused a wrong one
and the prompt asked again in words, the right one moved the client (channel 6);
a click on the person opened their card with their group. What was folded and
selected was in `ui.tree` and found by the next two processes (the fold of one
channel and the selection of another, after a restart and a reconnect). Closing
the window with Alt+F4 ended the app with exit status 0 and left no ghost client
on the server. The machine's load average was 355 to 497 from other builds while
the closes were timed (7 s from the key to the exit, 14 s against TeamSpeak 6),
so no bound is taken from them. Against the TeamSpeak 6 server (6.0.0-beta13.1)
the same form shows "1 online · 1 channel", the tree and the panel, and the
close ends with status 0; its ghosts were not looked for (its ServerQuery is
SSH).
**Against the servers again after the review's fixes** (release build of
`bad5312`, Xvfb `:221` of 3000 by 1800 with openbox, lavapipe, the state under
the checkout's `.scratch/`; over ServerQuery an `Open Room` with a sub-channel
`Child`, a `[cspacer]Heading`, a `Locked Room` with a password and `Five Max`
limited to five clients were made for the run and deleted after it): the
TeamSpeak 3 server's tree and panel ("1 online · 6 channels", the lock, "0/5",
"Members — 1"); a double-click on Open Room moved the client there
(`clientlist -voice`: channel 2); on Locked Room the prompt opened with Join
dimmed, Enter on the empty field kept it open and moved nothing, Escape closed
it (still channel 2); opened again, a wrong password was refused by the server
and the prompt asked again in words, the right one moved the client (channel 4).
Alt+F4 ended the app with status 0, 3.3 s after the key, and left no ghost
client on the server. Against the TeamSpeak 6 server the form showed "1 online ·
1 channel", the tree and the panel, and the close ended with status 0.
**Seen again after the minors round** (`phase5/gpui-tree-minors`, the release
build of `1dbe5d5`; one Xvfb of 3840 by 2160 with openbox for each run, `:236`
(the prompt), `:239` (TeamSpeak 3), `:242` (TeamSpeak 6), `:243` (the sample
server's tree) and `:245` (the talking run), after runs on `:235`, `:237` and
`:238` that only found where to click; Mesa 26.2.5's lavapipe,
`llvmpipe (LLVM 21.1.8, 256 bits)` through Vulkan, 1440 by 960; the state under
the checkout's `.scratch/`, no Wayland, no session bus and no XDG directory of
the desktop in any run; the load average 16 to 25; the two development servers
used read-only, nothing created, deleted or reset on them, and one connect to
each). On the sample
server (`VOELIN_DEMO_UI=1`, nobody talks on the real ones): Kairo's row in the
tree has the green ring and the three bars; a click on Raid Night tints the row
over its picture and the pointer on Music tints that one (the picture above); a
double-click on the locked Officers opens the password prompt, a click on the
card's corner takes the focus from the field and the prompt stays, and Escape
closes it. Against the TeamSpeak 3 server (3.13.8, `127.0.0.1:9987`, a nickname
set in the form, Save and connect): "1 online · 1 channel", Default Channel with
the client in it, "Members — 1"; the members search with `zzz` typed says "Nobody
matches." where it said to connect; Alt+F4 ended the app with status 0 and
`clientlist` over ServerQuery after the close showed the query client only, no
ghost. Against the TeamSpeak 6 server (6.0.0-beta13.1, `127.0.0.1:9988`) the
same tree, panel and "Nobody matches.", and the close ended with status 0 (its
ghosts were not looked for: its ServerQuery is SSH). The talking run again on
this build (`VOELIN_DEMO_TALK=10`, 60 samples after the first 15 of 75, load
average 24 to 17): 106 % (114 %) in all, `llvmpipe` 100.7 %, GPUI's thread
4.2 % (7 % at most), 221.8 MiB, 9.98 engine events and frames a second, rendered
per second 0, 0, 9.98, 9.98, 0, 9.98: the tree once for each start and stop.
#### The callbacks and the properties
The plan counts "about 13 properties and 6 callbacks" for the two panes. The
tables list every property and callback of the Slint `Bridge` (and of `Nav`,
whose functions call it) that `screens/channels.slint` and
`screens/members.slint` use, and the password dialog's, each with what takes it
here or the slice that will: 12 properties and 9 callbacks of the `Bridge` and
3 functions of `Nav` in the two files, the `members` property that the voice
page reads, and `join_with_password` of `dialogs.slint`. The 13 properties are
the first 13 of the second table, up to `server_banner`, each name counted once;
the 6 callbacks are the first six rows of the first (the sixth only logs), the
seventh standing in for the chat. The callbacks are GPUI actions
(`shell/actions.rs`) handled by `MainView` as the shell's are, over
`voelin-ui-vm`'s `servers::logic` and `servers::sequence`:
| Slint callback (used by) | Action | What it does, or the slice that takes it |
|---|---|---|
| `join_channel` (`channels.slint`) | `JoinChannel { channel }` | `sequence::join_channel`: `Command::MoveToChannel` with voice up, the password prompt for a locked channel unless its password was given this connection, a connect into the channel (by its id) without voice |
| `join_with_password` (`dialogs.slint`, `ChannelPasswordDialog`) | `SubmitChannelPassword`, `CancelChannelPassword` | the prompt's Join, `sequence::join_with_password` with what its field holds (an empty field joins nothing and leaves the prompt open); its Cancel, and Escape |
| `toggle_collapse` (`channels.slint`) | `ToggleChannel { channel }` | `logic::toggle_collapse`, kept for the server in `ui.tree` |
| `search_members` (`members.slint`) | `SearchMembers { text }` | `logic::search_members` |
| `open_member` (`members.slint`) | `OpenMember { client }` | `logic::open_member` (-1 closes the card) |
| `open_client` (`channels.slint`, through `Nav.open_client`, which says whether the dialog opened) | `OpenClient { client }` | logged: the person's volume dialog comes with the dialogs slice (9) |
| `open_channel_chat` (`channels.slint`, a click on a channel's row) | `SelectChannel { channel }` | selects the channel, kept in `ui.tree`; it opens the channel's chat with the chat slice (4) |
| `connect_voice` (`channels.slint`, the server card's Connect) | `ConnectVoice` | slice 1 (the shell) |
| `Nav.add_server`, `Nav.edit_server` (`channels.slint`, the server card's menu) | `AddServer`, `EditServer { id }` | slice 1 (the shell) |
| `watch_client` (`channels.slint`, the LIVE tag of a person who streams) | none | the tag is drawn and not clickable: the stream viewer, slice 6 |
| `member_action("mute")` and `member_volume` (`members.slint`, the card's mute button and volume slider) | `SetMemberMuted`, `SetMemberVolume` | slice 3: the card's Volume rows ([below](#the-voice-page-and-the-call-bar)); the volume dialog of `open_client` and `client_audio_changed` stays the dialogs slice's (9) |
| `member_action("watch")` | none | the stream viewer, slice 6 |
| `member_action("message")` | none | the chat, slice 4 |
| `member_action("poke")` | none | the poke dialog, the dialogs slice (9) |
| `member_action("friend")`, `member_action("blocked")` | none | friends, slice 7 |
| (no Slint counterpart: the context menus) | `EditChannel`, `MoveClient` | logged: the channel editor, and a command for moving a client |
| Slint property (used by) | Here |
|---|---|
| `tree` (`channels.slint`) | `TreeModel::rows` |
| `server_members` (`members.slint`) | `TreeModel::people` |
| `member_total` (`members.slint`) | `TreeModel::total` ("Members — N") |
| `member_card` (`members.slint`) | `TreeModel::card` (`voelin_ui_vm::tree::member_card`), shown by `MemberCardView` |
| `members` (the people in our channel: the voice page, not the two files) | `TreeModel::voice` (`TreeEvent::Voice`), built with the other two lists and shown by the voice page (slice 3) |
| `current_server` (`channels.slint`) | `AppState::vm.current` (slice 1) |
| `observing` (`channels.slint`, `members.slint`) | `SidebarView::observing` (slice 1: the user's card says Observing); here also `Emptiness`, the words of a list with nothing in it: the tree's ("No server yet.", "Loading the channels…", "Connect to see the channels.") and the panel's ("Loading who is here…", "Connect to see who is here.", and "Nobody matches." for a search that leaves nobody of a server that has people); a server whose voice is connecting is loading |
| `server_title`, `server_icon`, `server_stats` (`channels.slint`, the server card) | slice 1: the sidebar's server card (`ServerItem`'s name and icon, `SidebarView::stats`, "9 online · 9 channels") |
| `voice_connected`, `voice_connecting` (`channels.slint`, the server card and its Connect) | slice 1: `SidebarView::voice_connected` and `voice_connecting`, the voice card ("Voice Connected", "Connecting…") |
| `server_banner` (`channels.slint`, the server card's picture) | `SidebarView::server_banner`, behind the sidebar's server card under the same veil as the tree's rows (slice 3) |
| `Nav.right_panel_width`, `Nav.right_panel_open` (the frame, `desktop.slint`, not the two files) | `ui.members_width`, read at start (no resize handle yet), and the panel is there while a server is on screen (the pins and topics drawers that share it come with the chat) |
`show_voice_view` (the voice page, slice 3) and `client_audio_changed` (the volume
dialog) are the other server callbacks of the Bridge that these panes meet;
neither file uses them.
What differs from the Slint tree and panel:
the speaking bars stand still (nothing here may draw the window with the clock);
the lists scroll with the wheel and have no scrollbar; a click on a channel
selects it where Slint opens its chat; the card has the volume and the mute of a
person and none of the buttons of the dialogs' slices; the members
panel has no resize handle; the fill spacer's line is drawn with the channel's
own characters, as the rows give it.
### The voice page and the call bar
Slice 3 of plan section 6 step 3: the voice channel page of the Slint front end
(`screens/voice.slint`, with the `Participant` of `voice-parts.slint`) and its
call bar, the sidebar's server card with its banner behind it, the release guard
of Hold to talk, the global push-to-talk key and the volume of a person, on the
same `voelin-ui-vm` rows (`TreeView::members`) and logic as the Slint front end.
| The larger stage | The smaller stage |
|---|---|
| ![the voice page, dark](ui/gpui-voice-dark.png) | ![the voice page on the smaller stage, dark](ui/gpui-voice-compact-dark.png) |
| ![the voice page, light](ui/gpui-voice-light.png) | ![the voice page on the smaller stage, light](ui/gpui-voice-compact-light.png) |
The pictures are the shell at 1440 by 960 under `scripts/gpui-shot.sh` (the
recipe above: `VOELIN_DEMO_UI=1` with `VOELIN_OPEN=voice` and `voice:compact`, a
display of its own, the state under the checkout's `.scratch/`): the larger
stage on the release build of `7140718` (Xvfb `:511` and `:512` of 3840 by 2160
with openbox, Mesa 26.2.5's lavapipe) and the smaller stage re-shot on the
release build of `15a1b60` after centring its row (Xvfb `:621` and `:622` of
3840 by 2160 with openbox, Mesa 26.3.0's lavapipe, both `llvmpipe (LLVM 21.1.8,
256 bits)` through Vulkan). The first sample
server's Chill Zone: Kairo talks (the green ring and the bars in the corner of
the avatar, "Speaking"), Lumen streams (the blue ring, "Streaming" or LIVE), dex's
microphone is off (the mark in the corner), the channel's banner is behind the
header, and the server's own banner behind the server card of the sidebar. Two
more pictures are from the live run against the TeamSpeak 3 development server
([below](#seen-against-the-servers)): the voice page with a second client
that talks (a real `Event::Talking`), and the card of that person with the
volume rows.
| A real talker (TeamSpeak 3 server) | The volume of a person |
|---|---|
| ![the voice page on a TeamSpeak 3 server, dark](ui/gpui-voice-live-dark.png) | ![a person's card with the volume, dark](ui/gpui-voice-card-dark.png) |
What is on screen:
- **The page** (`voice.rs`, `VoicePage`, a cached pane of its own). It is the main
area while the page is asked for and voice is connected (the Slint front end's
`Nav.voice-view && Bridge.voice-connected`): the server page's Voice channel
button asks for it (`ShowVoiceView { on: true }`, through `logic::show_voice_view`,
which also puts the people of our channel first in the members panel) and
the page's Chat only button gives the area back to the server page, where the
chat will be. A connection that drops takes the page away and a reconnect brings
it back, as in Slint (the flag is kept); Leave asks for the page off and leaves
voice (`LeaveVoice`: `show_voice_view(false)`, then the engine's
`DisconnectVoice`). `MainView` puts the page *instead of* the server page (they
are siblings, never nested: a cached view inside a view that renders again is
rendered again), so `panes.main` is not rendered while the page is up.
- **The header**: the channel's name, its topic, "5 in voice / 50 total" (the
limit when the channel has one) and, behind them, the channel's banner under
the same surface veil as the tree's rows (`widgets::banner_scrim`; the text
reads in the text colour instead of the secondary one over a picture). Copy
invite link (`Invite`), Smaller stage / Larger stage (`ToggleVoiceCompact`,
kept in `ui.voice_compact`, which both front ends read) and Chat only.
- **The people**, from `TreeView::members` as the model's `TreeEvent::Voice` (the
tree model builds the three lists once and tells the page its rows when they
differ, so the page builds nothing of its own): large avatars (80 pixels) in a
wrapping row, centred; a ring that is green while they talk and blue while they
stream (3 pixels, else 2 in the border colour), the mark in the corner of the
avatar (the speaking bars, else the headphones off, else the microphone off), the
name (ours in the accent colour) with the crown of an admin, and "Speaking",
"Streaming" or "Away" with the bars or the monitor mark. A click opens the
person's card (`OpenMember`). The smaller stage is one row of 54 pixel avatars
(a flex-row scroll container whose inner row carries `.flex_none().mx_auto()`),
centred horizontally while the people fit and scrolling sideways from the left
edge without clipping when they outgrow the page, ringed only while they talk
or stream, with the name and the crown, and LIVE under a streamer. A window
under 800 pixels tall has the smaller stage whatever the setting says and the
button is off, with the reason as its tooltip (`Nav.short`): `MainView` tells
the page when the window crosses 800 pixels, since a cached pane does not see
a resize.
- **The call bar**: Mute and Deafen (44 pixel round buttons, red while on:
`SetInputMuted`, `SetOutputMuted`), Share when the server can stream and the
voice settings (`OpenShare`, `OpenVoiceSettings`: logged, their pages are
the stream slices' and the settings slice's), and Leave. `IconButton` keys its
GPUI element ID by both its base ID and its label (`ElementId::NamedChild`,
keeping `.debug_selector` on the base ID), so toggle buttons (`call-mic`,
`call-sound`, `member-mute`, `user-mic`, `user-sound`, `voice-stage`) drop
stale hover/tooltip state and render the updated tooltip as soon as their
label changes. The streams of the Slint page and its channel chat come with
their slices; the page says so where the chat will be.
- **The voice card and the modes.** Hold to talk is for the push-to-talk mode of
the audio settings; for voice activity and for an open microphone the card says
the mode in words instead of showing a button. `SettingChanged` for `audio`,
`client_playback` and `ui.voice_compact` is read again, as the Slint front end's
`setting_changed` does, so the modes, the volumes and the stage follow the
config file and the commands.
- **The volume of a person**: the member card (a click on a person on the voice
page or in the members panel) has the Slint card's Volume rows, the percentage, a
mute for us and a slider (0 to 200 percent in steps of 5), off for a person the
server gave no unique id. They are `SetMemberVolume` and `SetMemberMuted`, which
go through `voelin_ui_vm::settings_page::logic::{open_client,
client_playback_changed}` (the logic the Slint volume dialog calls: the engine's
`SetClientVolume` and `SetClientMuted`, the `client_playback` key by the person's
unique id, the tree's mark of who is muted). The dialog of `open_client` itself,
which the tree's click on a person asks for, stays the dialogs slice's.
- **The server card's banner**: `server_banner` behind the card of the sidebar, as
`ServerHeader` of `channels.slint` has it (the picture covers the card and is
cropped to its inside, the veil lies over it, the stats read in the text
colour). GPUI clips to rectangles, so the picture's corners are square, as the
tree's banner rows'.
**The release guard of Hold to talk and the global hotkey** (the risk slice 2
recorded, hardened in the voice fix round). `AppState` tracks the window button
(`button_held`), the global hotkey (`hotkey_held`), and window teardown
(`shutting_down`) independently, with `stop_transmitting_if_unheld`,
`release_button_hold`, and `release_hotkey_hold`: holding both at once keeps
transmit active until both release without duplicate start or stop commands.
Every path that can orphan a hold is guarded:
- *Voice that drops:* checked per event inside `AppState::handle_events` (not
only across a whole 64-event batch, so a drop and reconnect inside one batch
cannot mask it). Whenever a session leaves `Connected`, any button or hotkey
hold on it ends, and `SetTransmitting(false)` is emitted once if either was
held or the engine still reports `transmitting` (the engine's answer and a
reconnect are not answered). `Sidebar`'s signal observer clears its own
`holding` flag whenever voice disconnects, transmit leaves push-to-talk, the
shown server changes, or `AppState::button_held` no longer matches (it only
sets its own field and never mutates root state).
- *Leaving push-to-talk, switching servers, or removing a server:*
`setting_changed` releases `button_held` when `audio.transmit` leaves
`PushToTalk` (while `!audio_dirty`); `select_server` releases `button_held`
when the held server leaves the screen (without touching `hotkey_held`, so the
global key still releases the server it started on); `delete_bookmark` clears
any hold on the removed session before closing it.
- *Window focus loss and shutdown:* `MainView`'s `observe_window_activation`
unconditionally releases `Sidebar` and calls `AppState::push_to_talk(false)`
when the window becomes inactive (a no-op when `button_held` is `None`;
`hotkey_held` is untouched so the global key keeps working while another
window has focus). `AppState::shutdown` sets `shutting_down`, drops `ptt`, and
releases both holds before sending `CloseSession`, ignoring any late press
that arrives through `Later` after close begins.
Each guard has deterministic tests (`hold_to_talk_is_released_when_voice_drops`,
`hold_to_talk_is_released_when_the_window_loses_the_focus`,
`leaving_push_to_talk_releases_a_held_button`,
`a_drop_and_reconnect_in_one_batch_releases_a_held_button_and_hotkey`,
`holding_the_button_and_the_hotkey_together_stops_only_when_both_let_go`,
`switching_servers_releases_a_held_button_but_keeps_the_global_hotkey`,
`focus_loss_releases_app_button_hold_unconditionally`,
`a_second_hotkey_press_on_another_server_releases_the_first`,
`removing_a_server_clears_active_transmit_holds`,
`closing_releases_a_held_transmit_and_ignores_late_presses`), and each guard was
mutated to confirm its test goes red.
**The global push-to-talk key** (`hotkey.rs`). `voelin_platform::HotkeyManager`
(the desktop's portal on Wayland, XInput2 on X11) runs in a task spawned on the
engine's runtime: the portal backend calls `tokio::spawn` when it is made, which
panics where no tokio runtime is current, and a GPUI foreground task has none
("For the next slices" said so). `run()` starts it once the window is open when
there is an engine, no sample servers and the settings (`ui`: `global_ptt`, on by
default, and `ptt_key`, `Ctrl+Shift+T`) ask for it; the state does not start it by
itself, so that a test of the state with a real engine never asks the desktop for
a shortcut (the first version of the commit did, and the test scheduler found it:
the status line came back from a tokio thread). Its presses and releases come to
GPUI's thread through `Later`: a press transmits into the session on screen while
it has voice, a repeated press on a different connected server ends the previous
session's transmit before starting the new one, and the release ends the session
the press began in, whichever is on screen then. The event loop (`run_loop`,
tested over private `EventStream` / `Registrar` traits without a portal or
display) fails closed on both termination paths, calling `transmit(false)` before
exiting when the command channel closes and before reporting status when the
desktop removes the shortcut mid-hold. How the key stands ("Active: Ctrl+Shift+T
(X11)", why it could not be registered) is in the log and `AppState::ptt_status`;
changing the key at run time (`AppState::set_global_ptt`) is the settings slice's.
The loop is the Slint front end's `GlobalPtt` repeated, as `HostedEngine` is.
#### The properties and callbacks of the voice page
The plan counts 6 properties and 6 callbacks. The properties the page reads, and
the callbacks of `bind/servers.rs` (and of `Nav`, whose functions call it) that its
controls have, each with what takes it here; the first six rows of each table are
the plan's six.
| Slint property (used by) | Here |
|---|---|
| `members` (`voice.slint`) | `TreeModel::voice`, `VoicePage::people` |
| `own_channel` (`voice.slint`, the voice card) | `VoiceHead::channel` |
| `own_channel_topic` (`voice.slint`) | `VoiceHead::topic` |
| `own_channel_banner` (`voice.slint`) | `VoiceHead::banner`, the veil of `banner_scrim` |
| `own_channel_limit` (`voice.slint`) | `VoiceHead::limit` ("5 in voice / 50 total") |
| `server_banner` (`channels.slint`) | `SidebarView::server_banner`, behind the server card |
| `input_muted`, `output_muted`, `voice_connected` (`VoiceButtons`) | `VoiceHead`, the call bar's buttons |
| `audio.transmit` (`VoiceCard`) | `SidebarView::transmit`: Hold to talk, or the mode in words |
| `transmitting` (`VoiceCard`, `UserCard`) | `SidebarView::transmitting` (the button, the ring of our avatar) |
| `Nav.voice_view`, `Nav.voice_compact`, `Nav.short` | `vm.voice_view` (`logic::show_voice_view`), `AppState::voice_compact` (`ui.voice_compact`), `VoicePage::short` |
| `streams`, `messages`, `streams_available`, `can_share` | the stream slices' and the chat's; the call bar shows Share when `streams_available` |
| Slint callback (used by) | Action | What it does |
|---|---|---|
| `show_voice_view` (`Nav.show-voice`) | `ShowVoiceView { on }` | `logic::show_voice_view`: the page asked for or not |
| `disconnect_voice` (the call bar's Leave, with `Nav.show-voice(false)`) | `LeaveVoice` | the page off, then `Command::DisconnectVoice` |
| `set_input_muted`, `set_output_muted` (`VoiceButtons`) | `SetInputMuted`, `SetOutputMuted` | the shell's, from the call bar too |
| `invite` (the header's Copy invite link) | `Invite` | the shell's |
| `open_member` (`Participant`) | `OpenMember` | slice 2's: the card |
| `voice_compact_changed` (`Nav.toggle-voice-compact`) | `ToggleVoiceCompact` | `ui.voice_compact` kept (not with the sample servers) |
| `push_to_talk` (`HoldToTalk`) | `PushToTalk` | the shell's, with the two guards above |
| `Nav.open-settings(voice)`, the share menu | `OpenVoiceSettings`, `OpenShare` | logged: the settings slice and the stream slices |
| `member_volume`, `member_action("mute")` (the card) | `SetMemberVolume`, `SetMemberMuted` | `client_playback_changed` |
What differs from the Slint page: no members button (the panel is there while a
server is on screen), no streams and no chat under the call bar (their slices), no
Share menu (logged), the speaking bars stand still, the page does not open by
itself when voice connects (Slint's chat is its default; here the server page has
the Voice channel button, and `VOELIN_OPEN=voice` asks for it at start), and the
smaller stage is the desktop's row of small avatars (the phone's compact layout is
dropped with the phone layouts).
#### What the voice page costs
`VOELIN_METER=1`, release build of `7140718`, 1440 by 960 on Mesa 26.2.5's lavapipe
through Vulkan on Xvfb `:531` and `:532` with openbox, the first sample server on
screen with the voice page open (`VOELIN_OPEN=voice`: the larger stage, nine
people on the server, five in Chill Zone), the machine's other jobs at a load
average of 10.1 before the first run, 3.7 between the two and 2.4 after (the one-minute figure); the first 15 seconds of 75 left out; CPU in percent of one
core, whose resolution is the 1 % of a clock tick; renders per second as the meter
counts them:
| | CPU, mean (max) | Of it `llvmpipe` | GPUI's thread | Resident memory | Window frames a second | Rendered a second: rail, top bar, sidebar, tree, main, members, voice page |
|---|---|---|---|---|---|---|
| Idle, the voice page of the first sample server on screen | 0.3 % (2 %) | none | 0.1 % (1 %) | 223.2 MiB | 0.0 | 0, 0, 0, 0, 0, 0, 0 |
| A sample person starts or stops talking 10 times a second (`VOELIN_DEMO_TALK=10`) | 123.9 % (127 %) | 117.4 % | 3.6 % (6 %) | 227.9 MiB | 10.0 | 0, 0, 10.0, 10.0, 0, 10.0, 10.0 |
60 samples each. The same two runs on the release build before the last three
small commits (`65b60f2`; Xvfb `:431` and `:432`, load average 25.3 before and 21.0
after): idle 0.5 % (2 %), 220.2 MiB, no pane rendered; talking 109.9 % (122 %) in
all, `llvmpipe` 102.1 %, GPUI's thread 6.4 % (11 %), 226.3 MiB, 9.95 events and
frames a second, the sidebar, the tree, the members panel and the voice page
rendered 9.97 times a second each (59 samples: the loaded machine left a second
out). The software device's share moves with the machine's load (102 to 117 %
here); the thread's, which is the app's, did not.
A window nobody touches is not drawn, with the voice page on screen as before.
Someone who starts or stops talking is one engine event, one frame and one render
of the sidebar (every frame renders it), the tree, the members panel and the voice
page, and none of the rail, the top bar and the main area; the model builds the
rows once for the three lists. The page's own cost is within the spread the load
of the machine makes (the tree slice's figures at the same rate were 102 to 106 %
in all and 3.1 to 5.0 % for GPUI's thread, 4.2 % on the minors round's); `llvmpipe`
draws the whole window again for every frame whichever pane asked for it, which is
the 90 ms of CPU a frame of this software device and what a GPU takes over.
#### Seen against the servers
Release build of `7140718`, the two development servers of
`dev/docker-compose.yml` used read-only (nothing created, deleted or reset; for
each, one connect of the app and one of a second client), a display of its own for
each run (Xvfb `:533` and `:534` of 3840 by 2160 with openbox, Mesa 26.2.5's
lavapipe, `llvmpipe (LLVM 21.1.8, 256 bits)` through Vulkan as the log's "Selected
GPU adapter" says, 1440 by 960), the state under the checkout's `.scratch/`, no
Wayland, no session bus, no XDG directory of the desktop, `ALSA_CONFIG_PATH` empty
(no sound card), driven with `xdotool` and read back with `xwd`. *TeamSpeak 3*
(3.13.8, `127.0.0.1:9987`): the form's Save and connect (the nickname `gpui-voice`)
shows the server page "Connected with voice", and ServerQuery's `clientlist -voice`
has the client in Default Channel; the Voice channel button opens the page with
one person; a second client, `voelinctl connect 127.0.0.1:9987 --nick
voelinctl-talker voice send --tone 440 --seconds 25`, joins and talks: the page
shows two people and the talker's ring, the bars in the corner of their avatar
and "Speaking" (the server's `client_flag_talking=1`, the page's marks from the
engine's `Talking` events), the same in the tree and the panel, which lead with
"In Voice — 2". The call bar's mute: the server says `client_input_muted=1`;
deafen: `client_output_muted=1` too; both clicked back: 0 and 0. Hold to talk held
with the pointer says "Talking…" and rings our avatar, as does `Ctrl+Shift+T` held
with `xdotool` (the log's line from the hotkey task: "Active: Ctrl+Shift+T
(X11)"); there is no microphone, so no audio goes out and the server's
`client_flag_talking` stays 0 for our client: the held key and button are seen in
the window, and the engine got `SetTransmitting`. The smaller stage, and the card
of the talker with the volume at 100 %. Leave: the page goes, and `clientlist`
does not have the client; Alt+F4 ended the app with exit status 0 and `clientlist`
after the close had no ghost of the app's client either. *TeamSpeak 6*
(6.0.0-beta13.1, `127.0.0.1:9988`), the same steps up to Leave (the smaller stage
and the card were not repeated) with Share in the call bar (the server can
stream: the click is logged) and no ServerQuery (it is SSH): the same page, marks,
hold, key and close, exit status 0; the pictures here are the TeamSpeak 3 run's.
### The theme
Two layers (docs/design/gpui-spikes.md, "The theme against Theme tokens"):
1. **`VoelinTheme`**, a GPUI global with every token of
`crates/voelin-ui/ui/theme.slint` (the source of truth while Slint lives):
the 43 colours for light and dark, the backdrop gradient, the radii, the
spacing, the eight type sizes and four weights, the control, row and shell
sizes (the sidebar's `264 * max(1, scale)`, the top bar's `max(44, control +
8)`), the two durations, at the text size factor. The shell's own elements
(the server rail, presence, meters) read it. `theme/slint_parity.rs` reads
`theme.slint` at test time and compares every declaration of its `Theme`
global with `theme/tokens.rs` by name, with the file's own arithmetic, at
four text sizes; a colour, length, weight or duration on one side only, a
changed value or a kind of declaration it does not know fails the test, and
so does a brush other than `backdrop` or a string other than `mode` and
`font-family` in the Slint file (those three it compares by name against
the one gradient and the one family of `tokens.rs`, which it cannot
enumerate: a second brush or string only on the Rust side is not seen).
2. **gpui-component's `ThemeColor`**, which its widgets read, written from the
first on every change (`theme/components.rs`): the registered theme of the
mode first, then the mapped colours over it, the font (Inter, `font-body`),
the radii and the base size.
| Voelin token | gpui-component (`ThemeColor` field) |
|---|---|
| `bg-app`, `text` | `background`, `foreground`; `caret`; `window_border` is `border` |
| `surface` | `sidebar`, `title_bar`, `status_bar`, `list`, `list_even`, `table`, `table_even`, `tab_bar` |
| `surface-2` | `secondary`, `muted`, `group_box`, `list_head`, `table_head`, `tab_active`, `accordion` |
| `surface-3` | `accent` (gpui-component's "accent" is a hover background, not the brand colour), `popover`, `list_hover`, `table_hover`, `secondary_hover`, `skeleton` |
| `surface-4` | `secondary_active`, `switch` |
| `scrim` | `overlay` |
| `border`, `border-strong` | `border`, `sidebar_border`, `title_bar_border`; `input`, `scrollbar_thumb` |
| `glow` | `ring` |
| `accent`, `accent-hover`, `accent-pressed`, `on-accent` | `primary`, `primary_hover`, `primary_active`, `primary_foreground` (`accent` also `sidebar_primary`, `slider_bar`, `progress_bar`, `drag_border`, `list_active_border`; `on-accent` also `slider_thumb`, `switch_thumb`) |
| `accent-soft` | `list_active`, `table_active`, `selection`, `drop_target` |
| `accent-text` | `link`, `link_hover`, `link_active` (one colour for the three) |
| `danger`, `success`, `warning`, `info` | the same names with `_hover` and `_active` (mixed 14 % toward white in dark, black in light; 18 % toward black) and `_foreground`: white or the window's ink, whichever contrasts more |
| `text-secondary`, `text-muted` | `table_head_foreground`, `tab_foreground`; `muted_foreground`, `scrollbar_thumb_hover` |
| `danger`, `success`, `warning`, `info` with `danger-soft`, `success-soft`, `warning-soft`, `accent-soft` | also the base palette `red`, `green`, `yellow`, `blue` and their `_light` variants; `chart_1` to `chart_5` are `accent`, `success`, `warning`, `danger`, `info` |
| the `button_*` fields | written from `secondary`, `primary`, `danger`, `success`, `warning` and `info` (a theme file leaves them to fall back to these; without it they would keep the default theme's blue) |
| not mapped | `bg-rail`, the backdrop gradient, `scrim-light`, `border-popup`, `live`, `live-soft`, `idle`, `dnd`, `offline`, `gold`, `meter-*`, `text-disabled`, `icon`, `name-text`: read from `VoelinTheme` by the shell. GPUI's gradient has two colour stops and the Slint backdrop three, so `Backdrop::to_gpui` draws the first and the last |
The mode (`Choice`) is `ui.theme`: `system` follows the window's appearance
and its changes (`observe_window_appearance`), `light` and `dark` do not.
Where the platform draws the window's frame (macOS) the mode sets its
appearance; elsewhere that is a no-op. **Inter** (the five files the Slint
front end bundles) goes into GPUI's text system with `add_fonts` and is used by
family name. **Lucide:** `build.rs` embeds the client's 147 icons (Lucide
1.48) and `assets.rs` serves them as gpui-component's `icons/<name>.svg` paths
before gpui-kit-assets' Lucide 1.43 catalogue (1,830 icons), so every widget
draws the icons the client draws and the rest of the catalogue still answers.
### What is next
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** (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. the **channel tree and the members** (done,
[above](#the-channel-tree-and-the-members); about 13 / 6):
`logic::tree_view`'s rows (`TreeItem`, `MemberItem`) in the sidebar and the
members panel, the callbacks `join_channel`, `join_with_password`,
`toggle_collapse`, `search_members` and `open_member` as actions beside the
shell's (`open_client` logged), and the password prompt the transitions ask
for;
3. the **voice page and the call bar** (done,
[above](#the-voice-page-and-the-call-bar); 6 / 6): the people of our channel
(`TreeView::members`, through the tree model) with their marks,
`show_voice_view`, the call bar (mute, deafen, Share and the voice settings
logged, Leave) with the remembered smaller stage, the voice card's modes, the
volume of a person on the member card, the sidebar's server card with the banner
behind it (`server_banner`), the release guard of Hold to talk and the global
push-to-talk key on the engine's runtime;
4. **next:** 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
(design/gpui-spikes.md, "Open choices for step 3"): emoji (the one-line
`gpui-pre-wgpu` patch for colour emoji, or Noto Color Emoji bundled with a
font setup that leaves out DejaVu's emoji range) and links (an `on_click`
per link, or a fix of `InteractiveText`); and a check of Wayland's preedit;
5. the settings pages (about 62 / 53), page by page;
6. the stream viewer and the share dialog (30 / 13): its first step is a run on
a GPU (design/gpui-spikes.md, "What a real GPU changes"), which decides `img()`
against a persistent texture;
7. home, friends, messages, events, the bell and the search (25 / 32,
`bind/social.rs`);
8. the Stream Studio (19 / 36) and its second window;
9. dialogs and overlays.
Phone layouts are dropped (decision 2). Around the slices: system-font emoji
and the removal of `twemoji.bin`; `tr!()` over the gettext catalogue (1,255
entries); the in-window keys as GPUI key bindings and the global ones through
`voelin-platform`, which now holds the portals and GPUI in one binary (ashpd on
`async-io`); and last the removal of Slint (`build.rs`, `ui/`,
`voelin-android`, `LicenseRef-Slint` of `deny.toml` and `about.toml`).
### For the next slices
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.
- **Settled by the tree slice: the panes, the signals and the pictures.**
`Update.refresh` is raised as per-area signals, the rail, the top bar, the
main area, the tree and the members panel are cached panes, and the pictures
the engine writes again are keyed by their file's stamp and the copies of the
old ones dropped (`signals.rs`, `pictures.rs`; [the channel tree and the
members](#the-channel-tree-and-the-members)). A slice that adds a heavy pane
(the chat's list, the stream tiles) gives it an entity of its own, a size of
its own and a signal of its own, embeds it cached as a sibling of the other
panes (a cached view inside a view that renders again is rendered again), and
raises its flag from `Signals::areas`. A new area is one more variant of
`signals::Area`. The voice page (slice 3) is such a pane and needed no new area:
it watches the servers' and the toolbar's signals for its header and call bar,
takes its people from the model's `TreeEvent::Voice`, and `MainView` pushes
what no signal says (the stage chosen, the window too short) into it.
- **No state change from a signal's observer, inside a flush.** The model
listens to three signals (tree, toolbar, member card) and a batch raises
several of them, so it may refresh twice in one flush of GPUI's effects, and
what it emitted the first time is delivered after the second refresh has
run. An observer that changes the state in that window (`select_server`,
say, in the observer of a signal) makes the second refresh a different list
from the one the first operations were made for. The events carry their rows
for that reason, and the panes check in debug builds that the operations lead
from the rows they have to the rows carried (`debug_check`); a probe in the
tests makes exactly this change, from the observer of the toolbar signal
during a Presence flush, and found the old code indexing past the end of the
rows (`a_state_change_inside_a_flush_does_not_apply_old_operations_to_new_rows`).
The rule for a new part is that an observer of a signal reads the state and
sets its own fields, and a change of the root state belongs to an action's
handler or a task of its own, not to a signal's observer. The events that
carry no rows (`Selection`, `Lists`, `Card`) are read from the model at
delivery and end right whatever the order.
- **The model builds everything for every batch it hears of.** A raised batch
builds the whole `tree_view` again: every channel and every person, O(people
+ channels) rows, and for each picture a row refers to the stat of its file
(`ImageSource::file`'s stamp, the review counted two per picture); then
`list::diff` against the rows it had. A talker's start or stop is one row of
change and the whole list built. The batches themselves are one build each
now (the model keeps the generations of its three signals it last built at,
so the signals of one change, three for a picture that arrives, are one
build: `a_picture_that_arrives_builds_the_rows_once`), but what a build costs
is what a server of hundreds of people will pay for each event. A refresh that
only flips `talking` of the rows it has (the talker's row, from the event's
client) or a reuse of the `ImageRef`s of the rows that did not change is still
a later slice's, when a measurement on a large server says it matters; the
9-person sample server does not. The voice page (slice 3) did not need it: its
people are the third list of the same build (`TreeView::members`), not a
second build, and a talker is still one build for the tree, the panel and the
page ([what the voice page costs](#what-the-voice-page-costs)).
- **The rail, the top bar and the main area refresh on the servers flag only.**
Before the tree slice they compared what they would show with what they
showed on every notify of the root; they listen to `Refresh::servers` now
(`signals.rs`, the per-area signals). A transition of `voelin-ui-vm` that
changes what they show and forgets to set `servers` leaves them stale, and
the Slint front end, which redraws by the same flags, is stale with it: the
flags of `Refresh` are the contract between the transitions and both front
ends, and a new transition sets every flag of what it touches. Nothing tests
that for the transitions that exist; a test per front end that plays the
events through `events::handle` and compares the parts with a rebuild from
the state would.
- **The members search's caret blink draws the window twice a second.** While
the search box is open and focused, the widget's caret blinks every 500 ms and
notifies its input, which the members panel and the window draw again: on the
first sample server, 2.00 window frames a second, 2.00 renders of the sidebar
and of the members panel and none of the others, `llvmpipe` at 21 % of a
core and GPUI's thread at 0.6 % (the release build of `f28c02a`, Xvfb `:234`
with openbox and lavapipe, the search opened with a click, 27 samples after
the first 15 of 42, load average 8 to 12). On a GPU that is two frames a second
of a mostly static window; the software device pays 90 ms of CPU for each. The
field of the chat's composer (slice 4) has the same blink; turning it off or
slowing it is the widget's option, if gpui-component has one, else a
property of the field the slice decides.
- **A click renders every pane; a hover only the pane it is over.** In gpui-pre
0.3.10 pressing a clickable element and releasing it call `window.refresh()`
(`elements/div.rs`), which ignores every cache for that frame, so a click on a
row draws the cached panes as well (on the test platform one click was three
frames and two renders of each pane; the
`a_click_renders_every_pane_and_a_hover_only_the_pane_it_is_over` test holds
it). A `hover` style notifies the entity that holds the element, so a pointer
that moves onto another row renders the tree and nothing cached beside it.
What the caches save is the stream of engine events (a talker, a join), not
the user's own clicks.
- **The tree's and the panel's lists have no scrollbar and the panel no resize
handle**; the wheel scrolls (`gpui::ListState`), as the chat's list will have to
as well, with gpui-component's scrollbar if it fits a `ListState`, and
`ui.members_width` is read at start. The voice page's people scroll with the
wheel too (a plain scrolling container: down on the larger stage when the rows
outgrow the page, sideways on the smaller one) and have no scrollbar.
- **Three copies stay in the Slint crate**, because `voelin-ui` is not edited
beyond the identity helper in this round: `connect_into` and the two joins of
`bind/servers.rs` (the shared ones are `sequence::join_channel`,
`join_with_password` and its `connect_into`), the card `refresh_member_card`
builds inline (`tree::member_card`), and `open_member` setting the session's
field (`logic::open_member`). They go with Slint (step 9), or each is a call
of the shared one when the Slint crate is next touched. Until then the
shared versions in `voelin-ui-vm` (`sequence::join_channel`,
`join_with_password` and `connect_into`, `logic::join_channel`,
`join_with_password` and `open_member`, `tree::member_card`) are called by
the GPUI front end alone, and Slint's copies can drift from them: a change
to the rules of a join or of the card is made in both, or the Slint copy
becomes the call first.
- **`SettingChanged` is reloaded for the keys the voice page shows, not yet for
all of the Slint front end's.** `AppState::setting_changed` follows `ui.theme`
and `ui.font_scale`, and since the voice slice `audio` (unless the page has
unsaved edits: `audio_dirty`), `client_playback` and `ui.voice_compact`. The
Slint front end also reloads the crash-reports flag, the stream audio sources
and the decoder keys; and the `ui` value (the hotkey's `global_ptt` and
`ptt_key` are read at start only here); the settings slice (5) and the stream
slices add those with the pages and the parts that use them.
- **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. A key that
belongs to an overlay needs the overlay on that path. The root's handle takes
the focus on every mouse down inside the window (GPUI transfers it to the
element under the pointer that has a handle, the root being under all of
them), and the overlay is a child of the root, not an ancestor of the root's
handle: a click on the overlay that no handle inside it takes leaves the
focus on the root, and the overlay's key context is off the path. The
password prompt therefore holds a focus handle of its own on its scrim (the
card is on it), and Escape is a key binding of its key context
(`shell::bind_keys`, called beside `gpui_kit::init`), not a listener on the
field's `Escape`: with the field focused its Escape passes the key on and the
binding closes the prompt, with anything else in the prompt focused the
binding is the only one there.
- **Settled by the voice slice: the hotkey runs on the engine's runtime.** 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, so `hotkey.rs` spawns the task on the engine's
runtime, as the Slint front end's `GlobalPtt::start(runtime, ...)` does, and
`run()` starts it (`AppState::start_global_ptt`), never the state itself: a
test of the state with a real engine would ask the desktop for a shortcut. A
new part that talks to the desktop (a portal, a hotkey) is started by `run()`
and not by `AppState::new` for the same reason.
- **`PortalCapture::stop` closes the portal session only inside a tokio
runtime** (`voelin-media`, `capture/portal.rs`: `Handle::try_current()`;
elsewhere the session closes only with the connection). Stop a capture inside
the engine's runtime, not on GPUI's thread.
- **gpui-component's `ThemeRegistry` observer overwrites `VoelinTheme`'s
mapping:** any change of the registry (loading JSON themes, `watch_dir`) runs
`Theme::change(mode, None, cx)` on the active theme, which puts the registered
theme's colours over the `ThemeColor` the second layer wrote. A slice that
offers JSON themes or watches a theme directory re-applies `VoelinTheme`
after the registry changed.
- **The parity test, `build.rs` and `assets.rs` read `crates/voelin-ui/ui`**
(`theme.slint` through `include_str!`, the icons directory, and `assets.rs`'s
`include_bytes!` of `logo.svg`), and `fonts.rs` the Inter files there: they
move with step 9, when Slint goes (the icons, the logo and the fonts to this
crate, `tokens.rs` as the source of truth, the parity test removed).
- **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
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. What the window manager
does give back is the maximized state, which the window now asks for once it
is shown ([The window's place](#the-desktop-shell), the paragraph with the
run under openbox). That request relies on `Window::is_maximized` being
current at the first frame: on a window manager that does honour GPUI's
request before the map (openbox does not) and whose `_NET_WM_STATE` change
has not been read yet, `zoom_window`, which toggles on X11, would undo it.
None is known; if one turns up, ask for the maximize only at the first
`_NET_WM_STATE` change after the map instead.
- **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
reads `bg-rail` from `VoelinTheme`), one scrim stands for three (`scrim`,
`scrim-light` and `overlay` are three values in `theme.slint`; gpui-component's
`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 TeamSpeak 3 development server bans an address that connects in a
burst** (tooling, not the app). `dev/docker-compose.yml` allowlists the
private ranges so that the addresses clients reach it from skip the
anti-flood bans "that rapid test connections would otherwise trigger"; a
client that is not in them, or a script that connects and closes many times
in a few seconds, gets banned by it for a while, and its connects are refused
until the ban ends (ServerQuery's `banlist` shows it, `banclear` lifts it,
which is for whoever owns the server). A live run of the front end connects
once, and runs that follow one another are spaced; the servers are used
read-only by a run, never reset (`docker compose down` or `-v` is not part of
one).
- **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.
- **What the voice slice leaves to the slices that meet it.**
- *The chat's slice puts the way to the voice page where the chat is.* Today the
server page has the Voice channel button and the voice page's Chat only goes
back to it; with the chat, the button goes to the chat's header as in Slint
and the page's lower part is the channel's chat (the page says so where it
will be). `show_voice_view(true)` already opens the channel's chat tab in the
state (`open_chat`, with `focus`), whose reading marks wait for the front
end's answer to `Host::chat_shown` (`ShellHost` says `false` until a page
shows a chat), so the chat slice answers that from its own state.
- *The streams of the Slint page and the Share menu* are the stream slices':
the call bar's Share is logged (`OpenShare`) and shows when the server can
stream (`streams_available`), and the stream cards go between the people and
the call bar.
- *The person's volume writes `client_playback` at every step of a drag* (the
Slint card does too: `member_volume` stores each change). A settings page
that shows the volumes, or a profile that shows the writes, may want the
write on release (`SliderEvent::Release`) and the engine's command at every
step. The volume dialog the tree's click on a person asks for (`OpenClient`)
is still logged: the dialogs slice's.
- *The hotkey's key is read at start.* `AppState::set_global_ptt` is the entry
for the settings page that changes it, and the `ui` value is not reloaded on
`SettingChanged` (above).
- *A test of a pane that follows the window's height resizes the window first*:
GPUI's test platform has a window of 1024 by 768, which is under the 800
pixels of the voice page's smaller stage (`voice_tests.rs`, `tall`).
- *Two X11 test binaries need an Xvfb with no window manager* (`voelin-media`'s
`x11_capture` and `voelin-platform`'s `x11`: CI has "xvfb only"): on
`spikes/gpui/headless.sh`'s display, with openbox, they fail (the first reads
the wrong pixels of its test window, the second hears no release of the key),
and they pass on the same display with `headless.sh -n`.
- **Three risks of the shell the gate found by reading, left to the slices that
meet them** (none reproduced here, none is a defect of a path the shell's
tests exercise; the fourth, Hold to talk staying on if voice drops while the
button is held, was settled by the voice slice, [above](#the-voice-page-and-the-call-bar)):
- *The server on screen is not remembered across restarts.* `AppState::new`
takes the first saved server (`bookmarks.first()`), whichever the user had
on screen; the Slint app does the same and keeps only the last voice channel
(`ui.last_voice`, for its Home page). Remembering the server needs a
value of its own in the settings (a key, or a field beside `ui.window`).
- *A click on a server of the rail, or Remove, closes an open server form
without asking*, and what was typed in it is gone (`MainView::select_server`
and `delete_server` drop `form`). The dialogs slice (9) turns the form into
a dialog; it keeps the draft or asks.
- *A tiling compositor's tile is stored as the window size* (and, on X11
under a tiling window manager, as its position): `ui.window` takes what the
window reports without asking whether it is tiled or floating, so the next
run under a floating window manager opens at the tile's size.
## Limits
- No drop shadows or blur (the software renderer draws none): glows are
translucent rings, the backdrop is a gradient rectangle.
- Avatars are the clients' pictures from the engine's cache
(`AvatarReady`), or initials on a colour from the name; group icons come
from `IconReady`.
- The members panel lists the people online: TeamSpeak tells a client
nothing about offline members, so the mockup's "Offline" section and a
server-wide member count are left out.
- The quality picker shows only when the streamer lists its simulcast
layers, which only a Voelin streamer does (`a=x-voelin-layers`, see
[media.md](media.md)); for the official client's streams the player
shows the decoded picture's height.
- The stream's own window is desktop only (Android has one window). It shows
no toasts and has no chat; status messages go to the main window. Keeping
it on top is a hint to the desktop: Wayland lets no app do it (winit
ignores it there; the compositor's window menu may offer it).
- A jump to a pinned message scrolls to where an average row would be
(rows differ in height), and only to messages already loaded. So does
the unread bar's Jump, and the bar shows while that estimate of the New
line is above the view.
- What is read stays on this device: TeamSpeak has no read receipts. The
window's focus is known on the desktop (winit); on Android a chat on
screen counts as read.
- The window keeps its native decorations (no custom title bar).
- The Stream Studio streams to the voice channel we are in (a TeamSpeak 6
stream belongs to its channel): its destination picks among the servers,
not among their channels. Image paths (image sources, backgrounds) are
typed, there is no file chooser. The background effect replaces what is
around the person the engine's segmentation model finds (an oval where
the model does not load). The
studio cannot be detached on Android (one window). Its own window shows
no toasts; status messages go to the main window.
- Home, friends and messages show what the user's servers tell: there is
no global network behind TeamSpeak, so the design's Discover, other
communities with member counts, the games friends play and the upgrade
panels are left out, and a friend shows as online only on servers we
are on or look into.
- Direct messages need a voice connection to the peer's server; the
design's calls, groups, requests, voice messages and reactions in
private chats have no TeamSpeak counterpart.
- On the phone the settings are a list on the You tab and a section
picker inside them, not the design's list beside the page (too narrow
for most sections at a phone's width).