122b2d29fad2a75b908e99018fb934dec89c7fca
15
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
122b2d29fa |
voelin-gpui: the tree marks who talks again, the ring on the avatar and the bars on the row
The gate ruled for parity: the tree cleared `talking` on every row to keep its pane from being drawn with each start and stop of someone's voice, and the Slint tree (channels.slint) has the speaking ring on the avatar and the bars on the row. The model keeps the flag now and client_row draws the ring (Avatar::speaking) and the bars, 14 pixels as SpeakingBars is, after the badges and before the LIVE mark, as the Slint row orders them. The cost was measured with the meter at 10 starts and stops a second (the sample server, release build, lavapipe on Xvfb :231): the tree pane is rendered once for each, 9.97 a second for 9.97 events, as the members panel is, and the rail, the top bar and the main area not at all; 102 % of a core in all, 5.0 % of it GPUI's thread, which is what the run before the change had (3.1 % to 5.0 %). docs/ui.md replaces the paragraph that said the tree carries no talking with the figure; the tests that counted the tree as not drawn count it as drawn once (a talker changes one row and draws the tree once; the tree and the members panel and no other pane), and the sample server's tree marks Kairo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
6b01e25391 |
voelin-gpui: the tree and members events carry the rows their operations lead to
TreeEvent::Rows and ::People carried the row operations only, and the panes
applied them to the model's rows read when the event was delivered. A model
that refreshes twice in one flush (it listens to the tree, toolbar and member
card signals, and a batch raises several) holds the second rows by the time a
pane hears of the first operations, so an observer that changes the state
inside the flush made the first operations index the second rows: the gate's
probe, select_server from the observer of the toolbar signal during a
Presence flush, panicked in ChannelTree::apply on the shrink.
The events now carry the rows (Rows(Changes, Arc<Vec<TreeItem>>), People the
same) and the panes apply the operations to the rows they have and keep the
carried ones, so the events lead from the rows a pane started with to the
model's last whatever the order of the flush. apply checks the counts in
debug builds (debug_check), and "For the next slices" has the rule: a signal's
observer reads the state and sets its own fields, a change of the root state
is an action's or a task's. The probe is a test
(a_state_change_inside_a_flush_does_not_apply_old_operations_to_new_rows); it
panicked on the code before ("index out of bounds: the len is 0 but the index
is 3", channels.rs) and passes now.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
||
|
|
bad5312bfd |
voelin-gpui: the password prompt ignores an empty field and Escape closes it
The Slint dialog (ChannelPasswordDialog) turns Join off and ignores Enter while the field is empty, keeping the dialog open, and closes on Escape. The prompt here took itself away before join_with_password refused an empty password, so Join or Enter on an empty field closed it without a join, and Escape did nothing (the field's own Escape passes the key on). The submit now reads the field first and leaves the prompt open when it is empty; Join is disabled while it is (the field's changes redraw the prompt); the prompt handles the Escape the field passes on and cancels. The prompt's test covers Join and Enter on an empty field, Escape (nothing sent, the channel no longer the one to join), and a typed password entered with Enter. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
f8cf6a3561 |
voelin-gpui: a channel's banner is drawn under the surface veil, as the Slint tree's
A channel row drew its banner picture at full strength under the name, so Theme.text could sit on a picture of its own colour (dark text on the sample server's dark banners in the light theme, light text on a bright TS6 banner in the dark one). banner-picture.slint lays the surface colour over the picture, 74 % opaque on the left and 66 % on the right; the row now does the same, over the picture and under the tint of our own channel. A test keeps the veil: the text of both themes has more than 4.5 to 1 against the weakest end over a black and over a white picture, and the gradient is the surface colour at those two opacities; another finds the veil on the sample server's banner rows and on no other. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
aa640cf2b0 |
voelin-gpui: VOELIN_DEMO_SERVER, the logged Move to my channel, and what a click costs
- VOELIN_DEMO_SERVER=<0..2> puts another sample server on screen: the second is observed and the third is not connected, both with empty trees, which is how the pictures of an empty server are made. - The person's context menu offers Move to my channel; the engine has no command to move another client, so the action is logged. - A test that holds what the caches cannot save: pressing and releasing a clickable element refresh the window, so a click renders every pane, and a hover renders only the pane the pointer is over. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
26302bcdde |
voelin-gpui: the members panel and the member card, the sample server's pictures and a talker
Slice 2, second half. The right panel of a server on screen (as wide as ui.members_width) is everyone on the server in sections from voelin-ui-vm's rows (server_members: those streaming first, then each server group), with "Members - N", a search (search_members), and per person the avatar with its presence dot and speaking ring, the name with the admin, priority, commander and recording marks and their myTeamSpeak badges, what they do, the role, LIVE, the mute marks and the hand of a person who needs talk power. It is a cached pane over a virtual list that applies the model's row operations, and the pane a talker redraws: nothing else of the window is told. A click on a person opens their card over the panel (tree::member_card: name, status, description, groups, badges, talk power, country) with a scrim a click outside closes; it follows the person while open and goes when they leave. Its buttons (volume, message, poke, friends, block) are the slices of those dialogs. Development: VOELIN_DEMO_UI now also delivers the first sample server's avatars, icons, banners and badges as files of a folder of the state's own (removed with it), and VOELIN_DEMO_TALK=10 makes a sample person start and stop talking that many times a second through the app's events: what the meter measures while someone talks. Tests: the sections and the search, a talker redraws the members panel and no other pane, the card (open, follows, closes three ways, goes with the person), an avatar written again shows under a new key and the old copy goes from the asset cache, the sample pictures and the talker. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
b1f673fce3 |
voelin-gpui: the channel tree, with a password prompt and what it remembers
Slice 2, first half: the sidebar's placeholder becomes the selected server's channel tree from voelin-ui-vm's rows (tree_view): nested channels with their spacers, icons, banners, lock and counts, and the people in them with their avatar, badges and marks. A TreeModel entity builds the rows once for both panes on the tree, toolbar and member-card signals and tells what differs (list::diff, the row operations the Slint front end applies to its VecModel); ChannelTree is a cached pane over a virtual list that applies them, so a person who joins is a row inserted and the scroll stays. The rows carry no `talking`: a talker redraws the members panel, not the tree (docs/ui.md says so). A click selects a channel, a double-click joins it (sequence::join_channel: the move, the prompt for a locked channel's password, a connect into it without voice), the chevron folds it, a right-click offers Join, fold and Edit channel (logged: the channel editor is another slice), a click on a person is logged (their volume dialog is another slice). The password prompt (Update::password) is a card over the window, asking again when the server refuses the password. The folds and the selection are kept per server in ui.tree and found again by the next run. The shell's cached panes lay out their root at the size the place gives them (size_full), which the main area needed. Tests: the sample server's rows, folding and its settings, the round trip through a closed run, double-click and action join, the password prompt and its refusal, a move (the exact row operations) and a mute (one row), a talker leaves the tree alone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
b133412700 |
voelin-gpui: Update.refresh as per-area signals, the shell's panes cached
The "for the next slices" design of the shell's review. The root state turns the flags of an update into entities with a generation, one per area (servers, toolbar, tree, member card; crate::signals), raised once per batch of engine events and once per transition, and the rail, the top bar, the sidebar and the main area listen to their areas instead of asking the root whether anything changed for them. The rail, the top bar and the main area are embedded with Entity::cached and a size of their own, so gpui-pre renders them again only when they were notified, and the meter counts the renders of each pane (rail, topbar, sidebar, tree, main, members) beside the window's frames. voelin-ui-vm: Refresh::merge, for the flags of a batch. Tests: a burst raises each area once per batch; a change of the voice card renders the sidebar with every frame and none of the cached panes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
9ab56ec973 |
voelin-gpui: the maximize guard covers the first two reports only
A window opened to be maximized dropped every windowed report until it was seen maximized, so a resize the user made before the window manager answered (or under one that never maximizes, a tiling one) was never kept. The guard is now a budget of OPENING_REPORTS = 2 windowed reports, the place the window opened with and the configure an X11 window manager may send at the map; a maximized report ends it, and the reports after it are the user's. Tests on the GPUI test platform: the root state keeps the third report, the shell keeps a resize that follows the two. The sentence in docs/ui.md says so. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
302524a144 |
voelin-gpui: a window left maximized is maximized again, and stays remembered so
GPUI asks for a maximized window before it maps it, and an X11 window manager manages a window only from its map (openbox loses the request), so a window the last run left maximized opened at its restored size, and the next close overwrote maximized:true with false. MainView now zooms the window at its first frame when it was opened to be maximized and is not by then (zoom toggles on X11, so a maximized one is left alone). The root state keeps what such a window reports as not the user's until the window has been seen maximized, so a run that ends first, or one whose window manager never maximizes, leaves maximized:true as it found it; a maximized window is kept with the size it returns to (X11 reports the screen's). GPUI's test platform has no zoom, so the tests count the request and play the window manager's answer; the X11 behaviour was seen under openbox on a private Xvfb and is recorded in docs/ui.md. CHANGELOG notes it. Also wraps the module comment of app.rs that the previous commit left long. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
7c0f385f2f |
docs: a part's notify draws the whole window, not just the part
The records said the shell's parts draw only when what they show changed. In gpui-pre 0.3.10 a child view embedded with .child(entity) is rendered on every frame (only Entity::cached and AnyView::cached reuse a subtree), so a part that is told tells the window, and the window draws every part. Correct the shell section of docs/ui.md, the status paragraph of the spikes report and the module comments of the shell and the root state, and add to "For the next slices" the gate's notes: heavy panes cached and Update.refresh turned into per-area signals, Update.reloaded ignored and img() caching by path, SettingChanged for audio and playback not reloaded. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
6b4341ab8c |
voelin-gpui: the desktop shell, the server rail, the sidebar, the top bar and the main area
Slice 1 of plan section 6 step 3 (docs/ui.md, "The GPUI front end"). The window
is the shell of ui/shells/desktop.slint, as entities that observe the root
state and tell the window only when what they show changed (they compare their
view of the state, so an engine event about a talker, a tick or a setting that
is not the theme's draws nothing):
- shell/rail.rs: the saved servers as avatars with their tints, initials,
presence dots, unread and live marks, the selection pill and ring, the plus
that adds a server and the settings button; a second click edits a server,
as the Slint rail's double click does.
- shell/sidebar.rs: the server on screen with its stats, the place of the
channel tree (slice 2), the voice card (disconnect, copy an invite, hold to
talk) while voice is connecting or connected, and the user card with the
microphone and sound buttons.
- shell/topbar.rs: the page's title, the search box and the settings button;
the last two are logged until their slices exist.
- shell/main_panel.rs: "No server selected" with the way to add one, or the
server on screen with Connect, Disconnect and Edit.
- shell/form.rs: the server form (address, name, nickname, password; Save,
Save and connect, Cancel, and a Remove that asks twice) in the place of the
main area until the dialogs slice.
- shell/toast.rs: the status line as a toast for a few seconds.
The eleven callbacks of bind/servers.rs that the shell has are GPUI actions
(shell/actions.rs: select, connect, disconnect, mute the microphone, mute the
sound, push to talk, edit, save, save and connect, delete, invite): a click
dispatches one, the window's root view handles it by asking the root state.
The window takes its title from the server on screen ("Voelin - Nightfall"),
keeps a focus of its own so that actions always find their handlers, tells the
root state where it is (ui.window), and opens where it was left (the size
always; the position where a screen still shows it and the window manager
honours one). The logo is served by the assets.
scripts/gpui-shot.sh finds the window by its title's prefix now that the title
follows the server.
Tests on GPUI's test platform draw the window and click it: a server added
appears in the rail, a click selects it and titles the window, a connect
reaches the engine, an engine event updates the rail and the cards, the form
adds, edits and removes, the toast goes, the window's place round-trips, an
idle window is not told, the sample servers fill the shell.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
||
|
|
109e1d1839 |
voelin-gpui: the cost meter as a development switch (VOELIN_METER=1), logged once a second
meter.rs is spike_common::meter of the GPUI spikes (spikes/gpui/common/src/meter.rs, docs/design/gpui-spikes.md) without the measuring run's summary and exit: once a second, on a thread of its own, a log line (target voelin_gpui::meter, level info) with the process's CPU in percent of one core, the resident memory, the CPU of each group of threads (a thread's name without its trailing number: `llvmpipe-12` is `llvmpipe`, which tells the software renderer's share, work a GPU would take, from GPUI's thread, the engine's runtime and the codecs; the busiest first, groups under 0.5 % left out), the app's own counters per second and the voice connections as a gauge: cpu 11.9% rss 250.4 MiB | threads llvmpipe 5.9 voelin-gpui 5.0 | engine_events 0.0/s ticks 1.0/s renders 1.0/s later_jobs 0.0/s | connections 0 The counters (`Counters`: engine events handled, ticks, renders, jobs run through `Later`, connections up) are shared with the root state and the main view, which count in `handle_event`, `tick`, the later task and `render`; the numbers come from /proc/self (a note and a warning say so where there is none; rustix's `param` for the page size and the clock tick, Linux only, no new package: the lock gains the edge). The line is a pure function with a test, as are the thread grouping and the stat parser (a name with spaces and parentheses), and one test reads this process and checks it has threads and memory. The root state's tests now also check the counters (events, the connection gauge, three ticks, a job from another thread). `VOELIN_METER=1` starts it (dev.rs parses it with the other switches). Running the debug binary on the swatch page on Xvfb :97 logs the lines above (about 12 % of a core when idle, the software renderer 6 to 11 % of it, one frame a second); the window closes with exit code 0. The default log filter now leaves out GPUI's "failed to load font .SystemUIFont" warning, which every start printed (gpui-component asks for the platform UI font before the theme names Inter; the text system falls back). Checked on Rust 1.95.0: fmt, clippy -D warnings --no-deps (all targets), `cargo test -p voelin-gpui` (30 tests), cargo deny, `scripts/notices.sh --check`. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
2690b8a802 |
voelin-gpui: VoelinTheme (every token of theme.slint, light and dark) written into gpui-component, Inter, the client's Lucide icons, the swatch page
Two layers, as the spikes' report settled: 1. `VoelinTheme`, a GPUI global (theme/tokens.rs): the 43 colour tokens of ui/theme.slint for light and dark (generated from the Slint file by a script, then checked by the test below), the backdrop gradient, and `Metrics`: the radii, spacing, type sizes, weights, control and shell sizes and the two durations at a text size factor (font-scale: the sidebar's `264 * max(1, scale)` and the top bar's `max(44, control + 8)` included). 2. gpui-component's `ThemeColor`, written on every change (theme/components.rs): the base of the report's table (background, foreground, border, input, ring, overlay; primary with hover, active and foreground from the client's accent; secondary and muted from surface-2 and its raised steps; gpui-component's "accent", which is a hover background, from surface-3; popover; list, table, sidebar, title and status bar, tabs, switch, slider, scrollbar, link, selection; danger, success, warning and info with a hover and active made by mixing and a text that is white or the window's ink, whichever contrasts more) and the 28 `button_*` fields a theme file would derive from them (without them the buttons keep the default theme's blue). The mixing, the WCAG contrast and `readable` are `Rgba` methods with tests. The window's background is bg-app; the backdrop and bg-rail stay in `VoelinTheme` (gpui-component has no rail, and GPUI's gradient has two stops against Slint's three: the swatch draws the first and the last and says so). The mode (`Choice`: system, light, dark) follows the window's appearance in `system` (`observe_window_appearance` calls `set_system_appearance`; a light or dark choice ignores the window) and sets the platform's window appearance where the platform draws the frame (macOS; a no-op elsewhere). The text size factor rewrites the metrics, the theme's font size (font-body) and radii. theme/slint_parity.rs reads ui/theme.slint at test time (`include_str!`) and compares every declaration of the `Theme` global with tokens.rs by name: the colours (dark and light), every length with the file's own arithmetic (a small evaluator of `*`, `+`, `max()` and token references) at four text sizes, the weights, durations, the font family and the backdrop's stops, and fails on a name on one side only or a declaration kind it does not know. A mutation check (accent, radius-md and the top bar's formula changed in tokens.rs) failed the tests with the names of the tokens, then was reverted. fonts.rs adds the five Inter TTFs of the Slint front end (`include_bytes!`) to GPUI's text system; the theme names the family. build.rs turns the 147 Lucide 1.48 SVGs of crates/voelin-ui/ui/assets/icons into a sorted table of `include_bytes!` (std only, no new dependency) that assets.rs serves as gpui-component's `icons/<name>.svg` before gpui-kit-assets' Lucide 1.43 catalogue (1,830 paths, which answers the rest and, as it does, an error for a path it lacks); a test checks that `mic.svg` is the client's, differs from the catalogue's, and that other icons fall through. Development switches (dev.rs): `VOELIN_OPEN=swatch`, `VOELIN_DEV_THEME= dark|light|system`, `VOELIN_FONT_SCALE`, `VOELIN_WINDOW_SIZE` (the Slint front end's names where they exist). swatch.rs is the page: the 43 colours in the groups of docs/ui.md's "Theme tokens" table with name and value (a test checks each token is in exactly one group), the backdrop, radii, spacing, the type scale, buttons, switches and checkboxes of gpui-component and 16 icons; it scrolls when the window is smaller. scripts/gpui-shot.sh makes the screenshot headless the way scripts/shots.sh does for Slint (xvfb-run, or GPUI_SHOT_HEADLESS=1 under headless.sh on NixOS; Wayland, the session bus and the XDG directories out of the environment), then closes the window with Alt+F4 and reports how the app ended. docs/ui/gpui-swatch-dark.png and -light.png are its output (Xvfb :97, openbox, lavapipe via wgpu's Vulkan backend, the debug binary, 1440x960, truecolour: a 256-colour reduction would change the tokens' values; the Slint pictures live in docs/screenshots/, the task asked for docs/ui/). Checked on Rust 1.95.0: fmt, clippy -D warnings --no-deps (all targets, the build script included), `cargo test -p voelin-gpui` 26 tests, cargo deny, `scripts/notices.sh --check`. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
27a13fcc7c |
voelin-gpui: the root Entity<AppState>, the engine's events through a foreground task, the one-second tick, later()
crates/voelin-gpui/src/app.rs holds the root entity: the toolkit-free voelin_ui_vm state (`AppState<Vec<ChatLine>>`) and `Social`, with `events::handle` as the one dispatch of an engine event (the entry point both front ends use; its Update's engine commands are sent, its warnings logged, the rest belongs to the slices that draw it). Three loops, spawned by `AppState::new` and ended when the entity is released: - the engine's events: a foreground task awaits the tokio receiver of the hosted engine (no reactor needed, as the plan says), `this.update` and `cx.notify()`: spike 3's hotkey task; - the tick: a loop of `background_executor().timer(1 s)`; - `Later`, for other threads: GPUI's `AsyncApp` holds an Rc-based weak handle and is not Send (read in gpui-pre's async_context.rs), so a thread that wants to touch the entity holds a Send handle that queues a boxed closure; a third foreground task, which owns the cloned AsyncApp, runs it with the entity. This is the Slint front end's `later(|app| ...)`. engine.rs repeats the ~25 lines of voelin-ui's `HostedEngine::start` (the engine on a tokio runtime, its events forwarded into an unbounded channel): that type lives in the Slint crate (crates/voelin-ui/src/app.rs), which this crate cannot depend on and this task does not touch. dev.rs reads VOELIN_WINDOW_SIZE. lib.rs `run()` logs through tracing (`VOELIN_LOG`, else `RUST_LOG`, else a filter that shows GPUI's adapter line), starts the engine's runtime, opens the window on the entity and, on close, tells the engine to close the sessions and ends the app. view.rs shows the one line of state the task asked for: version, voice connections up, engine events handled, seconds up; each part moves by one of the loops. Seven tests, none needing a display (GPUI's test platform): an injected engine event (a voice state) reaches the entity and its status line, the entity notifies its observers, the tick runs once per advanced second, a job from another thread runs on the entity, and a real engine (HostedEngine on a tokio runtime) delivers a real event (a setting changed by a command) to the entity through the same task; the window-size switch parses and refuses nonsense. The real-engine test calls `allow_parking`, as GPUI's test scheduler calls a wake from a tokio thread a non-deterministic test otherwise. The tests use `gpui-pre` (renamed `gpui`) with its `test-support` as a dev-dependency, pinned `=0.3.10` beside gpui-kit's own pin: gpui-kit's `test-support` feature names the optional `gpui-fast` backend in weak features, which makes cargo lock gpui-fast and its tree and pins taffy to 0.15.0 for every build (reproduced in a scratch project: 793 packages without the feature, 820 with it). The lock gains only gpui-pre's own test-support crates (proptest and its few, futures-concurrency, postage); THIRD_PARTY_NOTICES.md does not move (dev-dependencies are out of it) and cargo deny passes. Run on Xvfb :97 (headless.sh) with the debug binary: the window opens in 0.1 s, shows "Voelin 0.0.1-alpha · 0 connections · 1 engine event · 2 s up" and, four seconds later, "... · 6 s up" (the one engine event is the real engine's own at start); Alt+F4 ends the app with exit code 0 in 132 ms. Checked on Rust 1.95.0: fmt and clippy -D warnings (all targets, --no-deps), `cargo test -p voelin-gpui` (3 runs, 7 tests each), cargo deny. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |