docs: the channel tree and the members panel, its pictures, figures and records
docs/ui.md: a section for slice 2 (what is on screen, the per-area signals and cached panes with the three rules GPUI taught, what a change costs, seen against the TeamSpeak 3 and 6 development servers, the callbacks and the properties as tables, what differs from the Slint tree and panel), the switches VOELIN_DEMO_SERVER and VOELIN_DEMO_TALK and the per-pane counters of the meter, what is shared with the Slint front end, "What is next" (the voice page and the call bar are next) and "For the next slices" without what this slice did (cached panes and signals, the pictures), with the click and hover cost, the missing scrollbar and the three copies that stay in the Slint crate. The four pictures are the shell at 1440 by 960 under scripts/gpui-shot.sh on a display of its own. The CHANGELOG and the spikes report's status say what landed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa640cf2b0
commit
68a1694d7b
7 files changed
+325
-73
No files matched your search
+18
-5
@@ -31,11 +31,24 @@ User-visible changes of the apps and the `tsgw` gateway. The format follows
|
||||
sound, hold to talk and copy an invite link, as in the Slint app; the window's
|
||||
title names the server on screen, and its size and whether it was maximized
|
||||
are kept for the next run (setting `ui.window`; on X11 the window is
|
||||
maximized once it is shown, not before the window manager has it). The
|
||||
channel tree, the chat and the other pages are the next slices; the search
|
||||
and the settings buttons only log that. `VOELIN_DEMO_UI=1` shows the Slint
|
||||
app's sample servers without sending or keeping anything (docs/ui.md, "The
|
||||
desktop shell").
|
||||
maximized once it is shown, not before the window manager has it, and a
|
||||
resize made before it answers is kept). The chat and the other pages are the
|
||||
next slices; the search and the settings buttons only log that.
|
||||
`VOELIN_DEMO_UI=1` shows the Slint app's sample servers without sending or
|
||||
keeping anything (docs/ui.md, "The desktop shell").
|
||||
- The GPUI front end's channel tree and members panel. The server on screen's
|
||||
channels nest in the sidebar with their spacers, icons, banners, locks and
|
||||
counts, and the people in them with their badges and marks; a click selects
|
||||
a channel, a double-click joins it (a locked one asks for its password), the
|
||||
chevron folds it, a right-click offers the same, and what is folded and
|
||||
selected is kept for each server (setting `ui.tree`). The panel on the right
|
||||
lists everyone on the server in sections, with a search; a click on a person
|
||||
opens their card. A person who starts or stops talking redraws the members
|
||||
panel and nothing else of the window (the tree does not mark who talks), and
|
||||
the pictures the engine writes again show at once. `VOELIN_METER=1` counts
|
||||
the renders of each pane; `VOELIN_DEMO_SERVER` and `VOELIN_DEMO_TALK` pick
|
||||
the sample server and make a sample person talk (docs/ui.md, "The channel
|
||||
tree and the members").
|
||||
- Log files: each run logs to `<state>/voelin/logs/voelin.log`, the previous
|
||||
four runs are kept; `VOELIN_LOG` sets what is logged. Settings → Advanced
|
||||
opens the folder.
|
||||
|
||||
@@ -53,7 +53,15 @@ frame), a window left maximized is maximized again on X11, the pictures are
|
||||
1440 by 960, the connect test sends no DNS query, the sequences both front ends
|
||||
ran are shared in `voelin-ui-vm`, and the `ui.window` row is in the settings
|
||||
table; the gate's four risks of the shell are in docs/ui.md, "For the next
|
||||
slices".
|
||||
slices". Slice 2, the channel tree and the members panel, landed on
|
||||
`phase5/gpui-tree` (2026-10-28): `Update.refresh` as per-area signals and the
|
||||
shell's panes cached (the design the shell's review left for it), the pictures
|
||||
the engine writes again shown and the old copies dropped, the tree over a
|
||||
virtual list that applies the row operations of `voelin-ui-vm`'s `list::diff`,
|
||||
the members panel, the member card and the password prompt, with the folds and
|
||||
the selection kept per server; what a change costs, figure by figure, is in
|
||||
docs/ui.md, "The channel tree and the members". The next slice is the voice
|
||||
page and the call bar.
|
||||
|
||||
| Spike | The plan's no-go | Seen (software rendering, see Setup) | Verdict |
|
||||
|---|---|---|---|
|
||||
|
||||
+298
-67
@@ -986,12 +986,20 @@ crates/voelin-gpui/
|
||||
default identity; what the engine is handed (history, settings)
|
||||
app.rs AppState, the root Entity: the voelin-ui-vm state and Social, the
|
||||
backend, the three loops (events in batches, a quiet tick, Later)
|
||||
and the callbacks of the Slint `bind/servers.rs` that the shell has
|
||||
(over `voelin_ui_vm::servers::sequence`, which Slint calls too)
|
||||
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)
|
||||
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 title, the window's place
|
||||
shell/ the desktop shell (below): rail.rs, sidebar.rs, topbar.rs,
|
||||
main_panel.rs, form.rs, toast.rs, actions.rs, widgets.rs
|
||||
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), 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
|
||||
@@ -1007,9 +1015,12 @@ crates/voelin-gpui/
|
||||
the engine's commands go out, the status line is set (the toast shows it),
|
||||
what is to be kept goes to the store and the settings (a bookmark, the UI's
|
||||
settings, the audio settings, the clients' volumes), a changed `ui.theme` or
|
||||
`ui.font_scale` reaches the theme, the warnings are logged; the rest (what to
|
||||
redraw, the notices, the pictures to decode, the streams' capture and
|
||||
decoder) is for the slices that have those parts. Three loops start with it
|
||||
`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
|
||||
@@ -1022,9 +1033,10 @@ crates/voelin-gpui/
|
||||
thread (or the gateway lookup on the engine's runtime) holds a `Later` and
|
||||
calls `later.run(|app, cx| ...)`, a queue a third foreground task drains with
|
||||
the entity, as `later(|app| ...)` does in Slint. The root notifies on every
|
||||
batch and every move of the user's; the views compare what they would show
|
||||
with what they showed and tell the window only when it differs
|
||||
([The desktop shell](#the-desktop-shell)).
|
||||
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
|
||||
@@ -1037,8 +1049,13 @@ crates/voelin-gpui/
|
||||
shell on a drawn window that the tests click (a server added is in
|
||||
the rail, a click selects it and titles the window, an engine event updates the
|
||||
rail and the cards, the form adds and removes, the toast goes, an idle window is
|
||||
not told), a connect through a real engine that has no connector (it answers
|
||||
that none serves the address, which reaches the status line), the store on a
|
||||
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 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 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
|
||||
@@ -1097,11 +1114,13 @@ 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_DEMO_UI=1` | the Slint front end's sample servers (`voelin_ui_vm::dev::logic`) in place of the stored ones, through the app's own events (the first is connected, the second observed); nothing is sent to the engine or kept in the store, the window's place included, and the servers cannot be changed |
|
||||
| `VOELIN_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 with 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; `Later` jobs) and the voice connections up |
|
||||
| `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` and `members`; `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
|
||||
@@ -1156,17 +1175,18 @@ the picture was taken as `nova`).
|
||||

|
||||
|
||||
What is on screen, each part an entity of `crates/voelin-gpui/src/shell/` that
|
||||
observes the root state, makes its view of it (`voelin_ui_vm::servers::logic`:
|
||||
`rail`, `toolbar`) and tells the window only when the view differs from the one
|
||||
it showed (`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). A part
|
||||
that is told tells the window, and **the window draws every part**: in gpui-pre
|
||||
0.3.10 a child view embedded with `.child(entity)` is rendered again on every
|
||||
frame (only `Entity::cached` and `AnyView::cached`, which need a definite size,
|
||||
reuse a subtree until its entity is notified), so the parts' comparison saves the
|
||||
frames of a window nobody changes, not the work inside a frame ("For the next
|
||||
slices" says what the heavy panes do about it).
|
||||
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
|
||||
@@ -1178,15 +1198,15 @@ slices" says what the heavy panes do about it).
|
||||
"Voelin"), the search box and the settings button, which log that their
|
||||
slices are to come (`OpenSearch`, `OpenSettings`).
|
||||
- **The sidebar** (`sidebar.rs`): the server on screen (name, "9 online · 9
|
||||
channels" once its presence is known, else its address), the place of the
|
||||
channel tree (slice 2), the voice card while voice is connecting or connected
|
||||
channels" once its presence is known, else its address), the channel tree
|
||||
(slice 2), the voice card while voice is connecting or connected
|
||||
(the channel we are in, copy an invite, disconnect, and Hold to talk when the
|
||||
transmit mode is push-to-talk) and the user's card (nickname, Online,
|
||||
Observing or Offline, the microphone and sound buttons, which work with
|
||||
voice).
|
||||
- **The main area** (`main_panel.rs`): "No server selected" with an Add a server
|
||||
button, or the server on screen (name, address, its state) with Connect or
|
||||
Disconnect and Edit, until the pages of the next slices come.
|
||||
Disconnect and Edit, until the voice page and the chat come.
|
||||
- **The server form** (`form.rs`), in the place of the main area until the
|
||||
dialogs slice: address (all a server needs), name (empty: the server's own),
|
||||
nickname (the default identity's, else the system user's) and the server's
|
||||
@@ -1219,12 +1239,12 @@ front end](#shared-with-the-slint-front-end)):
|
||||
| `delete_bookmark` | `DeleteServer { id }` | `CloseSession`, the secrets and the store, `logic::forget_server` |
|
||||
| `invite` | `Invite` | `logic::invite_link`, the link on the clipboard, the status line's note |
|
||||
|
||||
The others of that file are the next slices': `search_members`,
|
||||
`show_voice_view`, `join_channel`, `join_with_password`, `toggle_collapse`,
|
||||
`open_client` and `client_audio_changed` (the channel tree, the members, the
|
||||
voice page), and `copied`, which the Slint toast of a copy needs and `Invite`
|
||||
does for itself. `AddServer`, `CancelServerForm`, `OpenSearch` and
|
||||
`OpenSettings` are the shell's own.
|
||||
The 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), `client_audio_changed` the dialogs', 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
|
||||
|
||||
@@ -1234,8 +1254,9 @@ 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` and
|
||||
`default_nickname`. Each is a transition over the state, the `Cx` and a
|
||||
`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
|
||||
@@ -1251,7 +1272,16 @@ wrappers, so its call sites are unchanged):
|
||||
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 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
|
||||
@@ -1370,6 +1400,195 @@ 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 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).
|
||||
|
||||
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. A person's row has
|
||||
their avatar, 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. 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.
|
||||
|
||||
#### 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 must not draw
|
||||
the tree. 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. 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 a
|
||||
change that moves none of the rows of a pane emits nothing to it.
|
||||
- **The tree carries no `talking`.** Its rows are built with the flag cleared,
|
||||
so someone who starts or stops talking changes the members panel (and the
|
||||
sidebar's own card when it is us) and not the tree: its pane is not rendered
|
||||
(the `a_talker_does_not_draw_the_tree_again` test counts it). The Slint tree
|
||||
draws speaking bars on the row, which would redraw the tree with every start
|
||||
and stop of someone's voice; this front end leaves them to the members panel.
|
||||
|
||||
#### What a change costs
|
||||
|
||||
`VOELIN_METER=1`, release build of the commit that made the panes, 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 21 to 43; 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; 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) | 219.5 MiB | 0.0 | 0, 0, 0, 0, 0, 0 |
|
||||
| A sample person starts or stops talking 10 times a second (`VOELIN_DEMO_TALK=10`) | 105.4 % (112 %) | 100.9 % | 3.4 % | 224.1 MiB | 10.0 | 0, 0, 10.0, 0, 0, 10.0 |
|
||||
|
||||
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 is the only pane that is rendered for it, 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 are
|
||||
not rendered at all in the 600 events of the run. GPUI's own thread spends
|
||||
3.4 % of a core on the 10 frames a second. The rest is the software device:
|
||||
`llvmpipe` draws the whole 1440 by 960 window again for every frame, about 100
|
||||
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. (The Slint tree draws speaking bars
|
||||
on its rows; with them the tree pane would be rendered for each of those frames
|
||||
too, which is why this one does not: not measured.)
|
||||
|
||||
**Seen against a server** (the TeamSpeak 3 development server of
|
||||
`dev/docker-compose.yml`, 3.13.8, release build of the commit that made the
|
||||
panes, an Xvfb of its own with openbox, 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).
|
||||
|
||||
#### The callbacks and the properties
|
||||
|
||||
The Slint front end's `Bridge` has what the two panes read; the plan counts
|
||||
"about 13 properties and 6 callbacks" for them, and these are they. 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 | Action | What it does |
|
||||
|---|---|---|
|
||||
| `join_channel` | `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` | `SubmitChannelPassword`, `CancelChannelPassword` | the prompt's Join, `sequence::join_with_password` with what its field holds; its Cancel |
|
||||
| `toggle_collapse` | `ToggleChannel { channel }` | `logic::toggle_collapse`, kept for the server in `ui.tree` |
|
||||
| `search_members` | `SearchMembers { text }` | `logic::search_members` |
|
||||
| `open_member` (of `members.rs`) | `OpenMember { client }` | `logic::open_member` (-1 closes the card) |
|
||||
| `open_client` | `OpenClient { client }` | logged: the volume dialog comes with the dialogs slice |
|
||||
| (a click on a channel opens its chat) | `SelectChannel { channel }` | selects it, kept in `ui.tree`; the chat comes with the chat slice |
|
||||
| (no Slint counterpart: the context menus) | `EditChannel`, `MoveClient` | logged: the channel editor, and a command for moving a client |
|
||||
|
||||
| Slint property | Here |
|
||||
|---|---|
|
||||
| `tree` | `TreeModel::rows`, the `talking` flag cleared |
|
||||
| `server_members`, `member_total` | `TreeModel::people`, `TreeModel::total` ("Members — N") |
|
||||
| `member_card` | `TreeModel::card` (`voelin_ui_vm::tree::member_card`), shown by `MemberCardView` |
|
||||
| `members` (the people in our channel) | built by `tree_view` and not shown: the voice page (slice 3) draws it |
|
||||
| `current_server`, `observing` | `AppState::vm.current`, and `Emptiness`, the words of a list with nothing in it ("No server yet.", "Loading the channels…", "Connect to see the channels.") |
|
||||
| `Nav.right-panel-width`, `Nav.right-panel-open` | `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), `client_audio_changed` (the volume dialog)
|
||||
and the card's buttons (`member_action`, `member_volume`: the volume and mute of
|
||||
a person, a message, a poke, friends, blocking) are the slices after this one's.
|
||||
|
||||
What differs from the Slint tree and panel, beside the tree's talkers above:
|
||||
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 no buttons; 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 theme
|
||||
|
||||
Two layers (docs/design/gpui-spikes.md, "The theme against Theme tokens"):
|
||||
@@ -1431,13 +1650,15 @@ 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. **next: the channel tree and the members** (about 13 / 6): the sidebar's
|
||||
placeholder becomes `logic::tree_view`'s rows (`TreeItem`, `MemberItem`), the
|
||||
callbacks `join_channel`, `join_with_password`, `toggle_collapse`,
|
||||
`search_members`, `show_voice_view`, `open_client` and `client_audio_changed`
|
||||
become actions beside the shell's, and the password prompt the transitions ask
|
||||
for (`Update::password`, which the root state only logs today) gets its dialog;
|
||||
3. the voice page and the call bar (6 / 6);
|
||||
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. **next: the voice page and the call bar** (6 / 6): the people of our
|
||||
channel (`TreeView::members`, built and not shown yet), `show_voice_view`,
|
||||
the voice card's controls, and the release guard of Hold to talk (below);
|
||||
4. chat, the composer and emoji (about 19 / 18, and the `Emoji` global 3 / 3):
|
||||
first the two open choices of the report that it touches
|
||||
(design/gpui-spikes.md, "Open choices for step 3"): emoji (the one-line
|
||||
@@ -1465,28 +1686,38 @@ entries); the in-window keys as GPUI key bindings and the global ones through
|
||||
What the foundation's review and the Opus gate (2026-10-27) found and left to
|
||||
the slices that meet it; none of it is a defect of what exists today.
|
||||
|
||||
- **A part's notify draws the whole window, and `Update.refresh` is not used
|
||||
yet.** The root notifies on every batch and each part compares the whole view
|
||||
it would show with the one it showed; a part that differs tells the window,
|
||||
and the window renders every uncached child view (gpui-pre 0.3.10: only
|
||||
`Entity::cached` and `AnyView::cached` skip one). With a rail, a sidebar and a
|
||||
top bar that costs little; the channel tree and the members of slice 2 (and
|
||||
later the chat's list and the stream tiles) are heavy, and one talker's
|
||||
indicator must not render the rail and the chat. Slice 2 embeds the heavy panes
|
||||
with `Entity::cached` (a definite size is needed: the pane's bounds come from
|
||||
its place in the layout) and turns `Update.refresh` (`voelin_ui_vm::host::
|
||||
Refresh`: `servers`, `toolbar`, `tree`, `chat`, ...; `perform` drops it today)
|
||||
into per-area signals, a generation or a flag per pane that its entity
|
||||
observes, so that a change of the tree or the members notifies those panes and
|
||||
not the rail and the chat.
|
||||
- **`Update.reloaded` is ignored, and `img()` caches by path.** `perform` drops
|
||||
`Update.reloaded` (the pictures the engine wrote again, whose decoded copies a
|
||||
front end drops). GPUI's `img()` caches what it decoded per source in the
|
||||
asset cache, so a picture rewritten into the same cache file (a server icon or
|
||||
an avatar that changed) stays stale on screen. The slice that shows engine
|
||||
pictures (slice 2: avatars, the tree's icons) drops the decoded copy for each
|
||||
path of `reloaded` (`ImageSource::remove_asset`, and `drop_image` for what the
|
||||
atlas holds) or keys the image by something that changes with the file.
|
||||
- **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`.
|
||||
- **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 voice page's and the
|
||||
chat's lists will have to as well, with gpui-component's scrollbar if it fits
|
||||
a `ListState`, and `ui.members_width` is read at start.
|
||||
- **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.
|
||||
- **`SettingChanged` for the audio and the playback keys is not reloaded.**
|
||||
`AppState::setting_changed` follows `ui.theme` and `ui.font_scale` only; the
|
||||
Slint front end also reloads `audio` (unless the page has unsaved edits) and
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 145 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
Reference in new issue
Block a user