faef1325abcdd4ac618060a0ec98d684c8b891f7
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
faef1325ab |
voelin-gpui: the sample pictures only when asked and removed at close; two small fixes
- The sample servers' pictures were written to a folder of the temporary directory by every state that showed them, tests included, and the folder went only with a dropped state, which the test platform and a killed run never do. The pictures are now a switch (Switches::demo_pictures: what VOELIN_DEMO_UI sets, and what a test asks for by name) and the folder is removed when the window closes (AppState::shutdown) as well as with the state. - The tree does not redraw for a change of the people's count, which is the members panel's, and an unfolded channel leaves no empty entry in what the trees remember. 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> |
||
|
|
e66238847d |
voelin-gpui: the store at start, the shell's actions on the root state, quiet loops
The window opens the client's store as the Slint front end's run() does (backend.rs): the database in the platform's data directory (VOELIN_DATA_DIR moves it), the settings service on it with the UI's keys, the secrets (the OS keyring, memory when it refuses), the default identity (made and kept when the store has none), the chat history and the settings handed to the engine. The state starts from the store's bookmarks, the settings' theme and text size (a development switch still wins), and the sample servers of VOELIN_DEMO_UI through the app's own events with nothing sent to the engine or kept. AppState gains the callbacks of bind/servers.rs that the shell has: select a server (and observe it through its gateway or query login, the gateway looked up on the engine's runtime and handed back through Later), connect and disconnect voice, mute the microphone and the sound, hold to talk, copy an invite, and add, edit, save-and-connect and remove a bookmark, all through voelin-ui-vm's logic; perform() carries out an Update as far as this front end has the parts (commands, status, what to keep, the theme settings). It keeps the window's place in ui.window at the tick and at close, and opens the window where it was left if a screen still shows its corner. The engine-event task takes what is queued (BATCH, 64) in one update with one notification and yields to GPUI's executor between steps; the tick counts and notifies nobody, since nothing the shell shows moves with the clock. Tests: one per behaviour on GPUI's test platform (the store's servers, select, save, edit, remove, connect, the other commands, observe, the sample servers, the theme settings, the window's place, the burst and the quiet tick), and a connect through a real engine with no connector, which answers that none serves the address. 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> |