docs: replace long dashes, document icons, emoji and avatar rules

Update the status of the client UX defects handled by the interface work.
This commit is contained in:
Loki 2026-10-25 10:26:02 +01:00
parent 220af2d6a4
commit ca3465daa5
Signed by: boba
GPG key ID: 253067914055423B
19 changed files with 311 additions and 303 deletions

View file

@ -12,36 +12,36 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- `vnox-e2e-voice` now needs `--fingerprint HEX` or `--trust-first-use`.
- Design and trust model: VNOX-Server `docs/02-protocol/tls.md`.
### Added — Phase 2 guild member list + identity export/import + channel rate limit (fourth batch)
### Added - Phase 2 guild member list + identity export/import + channel rate limit (fourth batch)
#### Phase 2 guild member list with kick / role-assign UI (Phase E4)
- **New PacketIds:** `GuildMemberListFetch` (0x010E), `GuildMemberList` (0x010F), `GuildRoleAssign` (0x0110), `GuildRoleUnassign` (0x0111), `GuildRoleListFetch` (0x0112), `GuildRoleList` (0x0113).
- **New storage methods:**
- `Storage::list_guild_members(guild_id)` — returns each member's nickname, joined_at, highest-role color + name (via SQL subqueries on `member_roles`/`roles`).
- `Storage::assign_role(guild_id, user_id, role_id)` — idempotent insert into `member_roles`.
- `Storage::list_guild_members(guild_id)` - returns each member's nickname, joined_at, highest-role color + name (via SQL subqueries on `member_roles`/`roles`).
- `Storage::assign_role(guild_id, user_id, role_id)` - idempotent insert into `member_roles`.
- `Storage::remove_role_from_user(guild_id, user_id, role_id)`.
- `Storage::list_guild_roles(guild_id)` — full role rows with permissions + position.
- `Storage::list_guild_roles(guild_id)` - full role rows with permissions + position.
- **New gateway handlers:** `handle_member_list_fetch`, `handle_role_assign`, `handle_role_unassign`, `handle_role_list_fetch`.
- Role assign/unassign require `MANAGE_ROLES` permission (or owner bypass) and append to the audit log.
- **Client wiring:** `NetCommand::{GuildMemberListFetch, GuildRoleAssign, GuildRoleUnassign, GuildRoleListFetch}` + `NetEvent::{GuildMemberList, GuildRoleList}` + dispatch + UI handling.
- **👥 button in guild bar** — opens the guild members modal (disabled when no guild is selected). On open, fetches both member list and role list in parallel.
- **👥 button in guild bar** - opens the guild members modal (disabled when no guild is selected). On open, fetches both member list and role list in parallel.
- **Guild members modal:**
- Member rows with role-colored avatar ring + nickname + role name + truncated user ID.
- 👑 crown indicator for the guild owner.
- 👢 kick button (hidden for owner) — calls `GuildMemberKick` and auto-refreshes the list after 200 ms.
- "+ role" combo — lists all guild roles; clicking a role name calls `GuildRoleAssign`.
- 👢 kick button (hidden for owner) - calls `GuildMemberKick` and auto-refreshes the list after 200 ms.
- "+ role" combo - lists all guild roles; clicking a role name calls `GuildRoleAssign`.
- ↻ refresh button.
- "N members" header with close button.
#### Phase 2 server-side channel rate limit (Phase E6)
- `handle_channel_create` now consumes a token from the per-session rate limiter (same bucket as chat/DM messages).
- When exceeded, replies `ErrorPayload{ RateLimited }` with message "slow down — too many channel operations".
- When exceeded, replies `ErrorPayload{ RateLimited }` with message "slow down - too many channel operations".
- Bumps `rate_limited_events_total` counter.
- Default channels ("general", "voice") remain protected from deletion (already in place from previous batch).
#### Phase 2 identity export / import to keyfile (Phase E7)
- **`identity::export_keyfile(identity, passphrase)`** — serializes the identity to JSON, seals it with the same Argon2id + ChaCha20-Poly1305 scheme as the on-disk vault, returns the keyfile JSON string. Passphrase is optional (empty = plain JSON).
- **`identity::import_keyfile(keyfile_json, passphrase)`** — opens a keyfile and returns the deserialized identity (without persisting — caller calls `save()` separately).
- **`identity::export_keyfile(identity, passphrase)`** - serializes the identity to JSON, seals it with the same Argon2id + ChaCha20-Poly1305 scheme as the on-disk vault, returns the keyfile JSON string. Passphrase is optional (empty = plain JSON).
- **`identity::import_keyfile(keyfile_json, passphrase)`** - opens a keyfile and returns the deserialized identity (without persisting - caller calls `save()` separately).
- **Export keyfile modal** in Settings → Identity:
- Optional passphrase + confirm field (with mismatch check).
- "Generate keyfile" button produces the JSON output.
@ -51,48 +51,48 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- **Import keyfile modal:**
- Multiline paste area for the keyfile JSON.
- Optional passphrase field.
- "Import & Replace Identity" button — calls `import_keyfile` + `save(identity, None)`.
- "Import & Replace Identity" button - calls `import_keyfile` + `save(identity, None)`.
- Warning that the current identity will be replaced; restart required.
- New `UiState` fields: `export_keyfile_open`, `export_keyfile_pass`, `export_keyfile_confirm`, `export_keyfile_output`, `export_keyfile_error`, `import_keyfile_open`, `import_keyfile_input`, `import_keyfile_pass`, `import_keyfile_error`.
### Build verification
- `cargo clippy --workspace` — 0 warnings.
- `cargo test --workspace` — 41/41 tests pass.
- `cargo clippy --workspace` - 0 warnings.
- `cargo test --workspace` - 41/41 tests pass.
### Added — Phase 2 server-side channels + identity vault UI + audit log (third batch, kept for history)
### Added - Phase 2 server-side channels + identity vault UI + audit log (third batch, kept for history)
#### Phase 2 server-side channel management
- **`ChannelCreate` packet (0x0033)** — register a new channel in the gateway's channel store.
- **`ChannelCreate` packet (0x0033)** - register a new channel in the gateway's channel store.
- Validates `kind` ("text" or "voice"); rejects empty `channel_id`.
- Returns `ChannelState` to the creator and broadcasts `ChannelCreate` to all other sessions.
- Returns `ErrorPayload{ ChannelNotFound }` (reused code) if a channel with the same id exists.
- **`ChannelDelete` packet (0x0034)** — remove a channel from the store.
- **`ChannelDelete` packet (0x0034)** - remove a channel from the store.
- Protects default channels ("general", "voice") with `PermissionDenied`.
- Broadcasts `ChannelDelete` to all sessions; client removes it from sidebar and clears cached messages.
- **`ChannelList` packet (0x0035)** — fetch all known channels. Client replaces its local list with the server-authoritative one (preserving member lists for channels already joined).
- **`ChannelList` packet (0x0035)** - fetch all known channels. Client replaces its local list with the server-authoritative one (preserving member lists for channels already joined).
- New `channels::create` / `channels::delete` / `channels::list` ops on the gateway.
- Client wiring: `NetCommand::{ChannelCreate, ChannelDelete, ChannelList}` + `NetEvent::{ChannelCreated, ChannelDeleted, ChannelListEvent}` + dispatch + UI handling.
- **Channel create popup** now sends `ChannelCreate` to the gateway instead of adding locally — sidebar updates come back through the broadcast.
- **Channel delete context menu** — right-click any non-default channel in the sidebar to delete it.
- **Channel create popup** now sends `ChannelCreate` to the gateway instead of adding locally - sidebar updates come back through the broadcast.
- **Channel delete context menu** - right-click any non-default channel in the sidebar to delete it.
#### Phase 2 identity vault UI
- **Set-passphrase modal** in Settings → Identity:
- Two passphrase fields with match check + min-8-char warning.
- Calls `identity::save(identity, Some(passphrase))` to encrypt the keypair at rest with Argon2id + ChaCha20-Poly1305.
- Shows error messages on save failure.
- **Remove-passphrase modal** — type `REMOVE` to confirm; calls `identity::save(identity, None)` to revert to plain JSON.
- **Vault status block** — shows current encryption state (🔒 encrypted / 🔓 plain) with explanatory text.
- **Copy pubkey button** — copies the hex pubkey to clipboard via `egui::Context::copy_text`.
- **Remove-passphrase modal** - type `REMOVE` to confirm; calls `identity::save(identity, None)` to revert to plain JSON.
- **Vault status block** - shows current encryption state (🔒 encrypted / 🔓 plain) with explanatory text.
- **Copy pubkey button** - copies the hex pubkey to clipboard via `egui::Context::copy_text`.
- New `UiState` fields: `vault_set_open`, `vault_remove_open`, `vault_passphrase_input`, `vault_passphrase_confirm`, `vault_error`.
#### Phase 2 audit log viewer
- **`GuildAuditLogFetch` packet (0x010C)** — admin-only endpoint; requires `MANAGE_GUILD` permission (or owner).
- **`GuildAuditLogFetch` packet (0x010C)** - admin-only endpoint; requires `MANAGE_GUILD` permission (or owner).
- Returns last 50 audit log entries (clamped 1..=200) via `GuildAuditLogPayload`.
- New storage method `Storage::get_audit_log(guild_id, limit)` — newest first.
- New storage method `Storage::get_audit_log(guild_id, limit)` - newest first.
- Client wiring: `NetCommand::GuildAuditLogFetch`, `NetEvent::GuildAuditLog`, dispatch, `UiState.audit_log_entries`.
- **📋 button in guild bar** — opens the audit log modal for the active guild (disabled when no guild is selected).
- **Audit log modal** — scrollable list of entries with:
- **📋 button in guild bar** - opens the audit log modal for the active guild (disabled when no guild is selected).
- **Audit log modal** - scrollable list of entries with:
- Action-specific icons (🏗 create, 🗑 delete, 👢 kick, 🏷 role, 🔗 invite, ✓ accept).
- Actor ID (truncated to 8 hex chars), target ID, reason (italic).
- Relative timestamp ("2m ago", "3h ago", "5d ago").
@ -104,25 +104,25 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Build verification (third batch)
- `cargo clippy --workspace` — 0 warnings.
- `cargo test --workspace` — 41/41 tests pass.
- `cargo clippy --workspace` - 0 warnings.
- `cargo test --workspace` - 41/41 tests pass.
### Added — Phase 2 hardening + Phase 1.3 polish (second batch, kept for history)
### Added - Phase 2 hardening + Phase 1.3 polish (second batch, kept for history)
#### Phase 2 server hardening
- **Admin HTTP server (axum) on gateway.** Default bind `0.0.0.0:7601`, configurable via `[gateway] admin_bind`.
- `GET /health` — JSON `{status, uptime_seconds, node, address, private_mode}` for orchestrator liveness probes.
- `GET /version` — `{name, version, lnex_version}`.
- `GET /metrics` — Prometheus text exposition format v0.0.4 with counters/gauges for messages, DMs, voice packets, connections, auth failures, rate-limited events, errors, guilds, friends requests, sessions, channels, uptime.
- `GET /health` - JSON `{status, uptime_seconds, node, address, private_mode}` for orchestrator liveness probes.
- `GET /version` - `{name, version, lnex_version}`.
- `GET /metrics` - Prometheus text exposition format v0.0.4 with counters/gauges for messages, DMs, voice packets, connections, auth failures, rate-limited events, errors, guilds, friends requests, sessions, channels, uptime.
- **Per-session token-bucket rate limiting** on chat and DM messages.
- Configurable via `[gateway] message_rate_per_sec` (default 5) and `message_rate_burst` (default 10).
- When a session exceeds the limit, server replies `ErrorPayload{ code: RateLimited }` and bumps `rate_limited_events_total` counter.
- Idle buckets are pruned on session disconnect via `RateLimiter::remove()`.
- **Prometheus metrics module** (`gateway/src/admin/metrics.rs`) with lock-free atomic counters shared across all session tasks.
- **`ensure_column` idempotent migration helper** — adds new SQLite columns on existing databases without dropping data. Used to add `messages.reply_to` for the reply feature.
- **`ensure_column` idempotent migration helper** - adds new SQLite columns on existing databases without dropping data. Used to add `messages.reply_to` for the reply feature.
#### Phase 2 identity security
- **Encrypted identity vault** (`client/src/identity_vault.rs`) — Argon2id passphrase + ChaCha20-Poly1305 AEAD.
- **Encrypted identity vault** (`client/src/identity_vault.rs`) - Argon2id passphrase + ChaCha20-Poly1305 AEAD.
- Vault format: `{version, scheme, salt, nonce, ciphertext, plaintext}` (JSON).
- When passphrase is set, identity is encrypted at rest with Argon2id (m=64 MiB, t=3, p=4) for KDF + ChaCha20-Poly1305 AEAD.
- When passphrase is empty, falls back to plain JSON (legacy behavior preserved).
@ -132,11 +132,11 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
#### Phase 1.3 chat UX
- **Message context menu** (right-click on any message row):
- Quick-reactions row (👍 ❤️ 😂 🎉 👀 🤔) — toggles reaction on click.
- Reply — sets `replying_to` state, preview bar shown above chat input.
- Copy text — copies message content to clipboard via `egui::Context::copy_text`.
- Edit (own messages only) — fills chat input with current content, switches to edit mode.
- Delete (own messages only) — sends MessageDelete to gateway.
- Quick-reactions row (👍 ❤️ 😂 🎉 👀 🤔) - toggles reaction on click.
- Reply - sets `replying_to` state, preview bar shown above chat input.
- Copy text - copies message content to clipboard via `egui::Context::copy_text`.
- Edit (own messages only) - fills chat input with current content, switches to edit mode.
- Delete (own messages only) - sends MessageDelete to gateway.
- **Reply feature** end-to-end:
- Wire protocol: `ChatMessagePayload.reply_to: Option<String>` (optional message_id).
- DB schema: `messages.reply_to TEXT` column (added via `ensure_column` migration).
@ -160,10 +160,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Auto-fetches block list on first open of the Blocked tab.
#### Phase 1.3 per-user speaking attribution
- **Voice packet protocol extended** — plaintext now includes `[sender_id:32]` (raw Ed25519 pubkey) between channel_id and opus data.
- **Voice packet protocol extended** - plaintext now includes `[sender_id:32]` (raw Ed25519 pubkey) between channel_id and opus data.
- `voice::build_packet()` accepts `sender_pubkey: &[u8; 32]`.
- `voice::spawn_recv()` parses sender_id and emits hex-encoded `sender_id` in `NetEvent::VoicePacket`.
- Legacy packets (no sender_id) gracefully handled — empty `sender_id` string.
- Legacy packets (no sender_id) gracefully handled - empty `sender_id` string.
- Unit test `build_packet_header_layout` updated to verify sender_id roundtrip.
- **Per-user speaking indicator in voice panel**:
- `last_remote_speaker_id` field on `UiState`, updated on every received voice packet.
@ -172,7 +172,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Speaker ID decays after 500 ms of silence (driven by `remote_speaking(500)`).
#### Phase 1.3 channel creation UI
- **"Create a Channel" popup** — accessible from the channel list header via the "+" button.
- **"Create a Channel" popup** - accessible from the channel list header via the "+" button.
- Input: channel name (free text).
- Type selector: Text (`#`) or Voice (`🔊`).
- Creates the channel in the local `s.channels` list so it appears in the sidebar immediately.
@ -180,20 +180,20 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Fixed
- **NetEvent dispatch bug (from previous commit):** `GuildMemberKicked`, `InviteCreated/Accepted/Deleted`, `RoleCreated/Deleted` were silently dropped — now routed to `social::handle`.
- **NetEvent dispatch bug (from previous commit):** `GuildMemberKicked`, `InviteCreated/Accepted/Deleted`, `RoleCreated/Deleted` were silently dropped - now routed to `social::handle`.
- **`FriendAccepted` handler (from previous commit):** now uses `user_id` and adds the friend to the list.
- **PID collision:** `PID_FRIEND_EVENT` was 0x0155, conflicting with server `BlockUser=0x0155`. Renumbered: `BlockUser=0x0155`, `UnblockUser=0x0156`, `BlockList=0x0157`, `FriendEvent=0x0158`.
- **PresenceUpdate wire format mismatch:** client was sending `{custom_status, activity}` but server expected `{activity_type, activity_text}`. Now the client serializes `activity_type`/`activity_text`/`custom_status` correctly, matching the gateway's `PresenceUpdatePayload`.
### Documentation
- `docs/00-status.md` and `docs/06-roadmap.md` updated in previous commit — Phase 1.1/1.2/1.3 marked DONE where implemented.
- `docs/00-status.md` and `docs/06-roadmap.md` updated in previous commit - Phase 1.1/1.2/1.3 marked DONE where implemented.
- `CHANGELOG.md` expanded with all new entries.
### Build verification (second batch)
- `cargo clippy --workspace` — 0 warnings.
- `cargo test --workspace` — 41/41 tests pass (22 in client lib incl. new rate_limit + vault tests, 10 in gateway, 9 in voice-node).
- `cargo clippy --workspace` - 0 warnings.
- `cargo test --workspace` - 41/41 tests pass (22 in client lib incl. new rate_limit + vault tests, 10 in gateway, 9 in voice-node).
## [0.1.0] - 2025-05-21

View file

@ -4,7 +4,7 @@ exclude = ["patches/*"]
[package]
name = "vnox-client"
description = "VNOX native desktop client — Slint, chat and voice"
description = "VNOX native desktop client - Slint, chat and voice"
version = "0.1.0"
edition = "2024"
license = "GPL-3.0"

View file

@ -1,4 +1,4 @@
# VNOX — Client
# VNOX - Client
> Native desktop client for VNOX. Voice, text, no cloud.
@ -10,12 +10,12 @@
## What is this?
The official desktop client for [VNOX](https://github.com/loki5512344/Vnox) — a self-hosted voice and text communication platform. Connects to a VNOX server over the LNEx protocol.
The official desktop client for [VNOX](https://github.com/loki5512344/Vnox) - a self-hosted voice and text communication platform. Connects to a VNOX server over the LNEx protocol.
- Connects to gateway via **TCP** (text, auth, channels, guilds, DMs)
- Connects to voice node via **UDP** (encrypted Opus voice packets)
- Opus audio encoding/decoding with adaptive jitter buffer
- Native UI built with **Slint** — no Electron, no web views
- Native UI built with **Slint** - no Electron, no web views
---
@ -73,13 +73,13 @@ See [docs/00-status.md](docs/00-status.md) for a full breakdown.
Linux builds also need audio/protocol prerequisites and FreeType/fontconfig development libraries (`libfreetype6-dev libfontconfig1-dev` on Ubuntu); native file selection uses the desktop portal.
```bash
# Terminal 1 — gateway
# Terminal 1 - gateway
cargo run -p vnox-gateway -- --config dev/config.toml
# Terminal 2 — voice node
# Terminal 2 - voice node
cargo run -p vnox-voice-node -- --config dev/config.toml
# Terminal 3 — client
# Terminal 3 - client
cargo run -p vnox-client
```
@ -87,7 +87,7 @@ The client connects to `127.0.0.1:7600` by default. You can change the address i
### Opus on Windows
`audiopus_sys` builds libopus from source via CMake. CMake 4.x policy flag is already set in `.cargo/config.toml` — no manual steps needed.
`audiopus_sys` builds libopus from source via CMake. CMake 4.x policy flag is already set in `.cargo/config.toml` - no manual steps needed.
---
@ -129,5 +129,5 @@ src/
## License
Client code: **GPL-3.0** — see [LICENSE](LICENSE)
Client code: **GPL-3.0** - see [LICENSE](LICENSE)
LNEx protocol specification: **CC0** (public domain)

View file

@ -14,6 +14,6 @@ and has direct access to audio hardware without browser sandboxing.
## Clients
- [desktop.md](desktop.md) — primary client, Windows / macOS / Linux
- [mobile.md](mobile.md) — Phase 3, stack TBD
- [overlay.md](overlay.md) — in-game HUD, Phase 2
- [desktop.md](desktop.md) - primary client, Windows / macOS / Linux
- [mobile.md](mobile.md) - Phase 3, stack TBD
- [overlay.md](overlay.md) - in-game HUD, Phase 2

View file

@ -1,4 +1,4 @@
# VNOX Client — Design System
# VNOX Client - Design System
> Based on Hi-Fi Minimalism v2.0
> Adapted for: native desktop voice/chat client (Rust + egui + wgpu)
@ -25,32 +25,32 @@ gamer RGB · Discord clone · neon cyberpunk · glassmorphism · corporate SaaS
## Color Tokens
```css
/* Backgrounds — layered, never pure black */
/* Backgrounds - layered, never pure black */
--bg-base: #0d0d0d; /* root, titlebar */
--bg-surface: #151515; /* panels, sidebars (was #111111 — lifted for panel contrast) */
--bg-elevated: #1d1d1d; /* inputs, cards (was #141414 — lifted for depth) */
--bg-surface: #151515; /* panels, sidebars (was #111111 - lifted for panel contrast) */
--bg-elevated: #1d1d1d; /* inputs, cards (was #141414 - lifted for depth) */
--bg-interactive: #2a2a2a; /* hover targets, dropdowns */
/* Borders — lifted significantly for visual hierarchy */
/* Borders - lifted significantly for visual hierarchy */
--border-subtle: #1c1c1c; /* was #171717 */
--border-default: #262626; /* was #1e1e1e — now actually visible */
--border-default: #262626; /* was #1e1e1e - now actually visible */
--border-strong: #2e2e2e;
--border-accent: rgba(255, 107, 53, 0.20);
/* Accent — warm orange */
/* Accent - warm orange */
--accent: #ff6b35;
--accent-hover: #ff844f;
--accent-active: #e85d04;
--accent-10: rgba(255, 107, 53, 0.08);
--accent-20: rgba(255, 107, 53, 0.15);
/* Text — warm, never pure white */
/* Text - warm, never pure white */
--text-primary: #f4c89a; /* main content (added) */
--text-secondary: #c88b5a; /* names, labels */
--text-muted: #8a6a52; /* secondary info */
--text-dim: #6a4a2a; /* hints, timestamps */
--text-ghost: #5a422c; /* section labels, separators (was #3d2e20 — lifted) */
--text-invisible: #443222; /* near-invisible, decorative (was #2d1e12 — lifted) */
--text-ghost: #5a422c; /* section labels, separators (was #3d2e20 - lifted) */
--text-invisible: #443222; /* near-invisible, decorative (was #2d1e12 - lifted) */
/* Semantic */
--success: #7cb87a; /* online, connected, low latency */
@ -67,7 +67,7 @@ gamer RGB · Discord clone · neon cyberpunk · glassmorphism · corporate SaaS
## Typography
Клиент использует **только monospace**. Это намеренно — усиливает ощущение инструмента.
Клиент использует **только monospace**. Это намеренно - усиливает ощущение инструмента.
```
Primary font: IBM Plex Mono
@ -98,13 +98,13 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase
### Title bar (34px)
- Background: `--bg-strip` (`theme::BG_STRIP`); **без отдельной painter-linии** под всю ширину — переход «titlebar ↔ контент» только за счёт контраста `--bg-strip` vs `--bg-base`. Раньше 1px `hline` воспринимался как случайная полоска «под логотипом» из-за состыковки с левым rail.
- Background: `--bg-strip` (`theme::BG_STRIP`); **без отдельной painter-linии** под всю ширину - переход «titlebar ↔ контент» только за счёт контраста `--bg-strip` vs `--bg-base`. Раньше 1px `hline` воспринимался как случайная полоска «под логотипом» из-за состыковки с левым rail.
- Сетка из **трёх равных колонок**:
- **левая** — **`[ prefs ]`** + **`VNOX`** (wordmark `--text-primary`, слева направо после prefs);
- **центр** — статус ноды: **`●`** + **`NODE: …`** (`OFFLINE` / `CONNECTING` / имя ноды), **по центру средней колонки** (= визуальный центр окна);
- **правая** — **transport‑подсказка** справа: `transport: idle` · `transport: connecting…` · `transport: quic/v1`.
- Вход в настройки: **`[ prefs ]`** — явная консольная кнопка (без нестабильных Unicode‑иконок); при открытых настройках тот же текст, цвет **accent**. Дубль: кнопка **open prefs** в нижней левой колонке, **только пока offline**.
- Нативный заголовок ОС (**taskbar / список окон**) — короткий **`Vnox`**, чтобы не дублировать тот же wordmark **`VNOX`** внутри клиента.
- **левая** - **`[ prefs ]`** + **`VNOX`** (wordmark `--text-primary`, слева направо после prefs);
- **центр** - статус ноды: **`●`** + **`NODE: …`** (`OFFLINE` / `CONNECTING` / имя ноды), **по центру средней колонки** (= визуальный центр окна);
- **правая** - **transport‑подсказка** справа: `transport: idle` · `transport: connecting…` · `transport: quic/v1`.
- Вход в настройки: **`[ prefs ]`** - явная консольная кнопка (без нестабильных Unicode‑иконок); при открытых настройках тот же текст, цвет **accent**. Дубль: кнопка **open prefs** в нижней левой колонке, **только пока offline**.
- Нативный заголовок ОС (**taskbar / список окон**) - короткий **`Vnox`**, чтобы не дублировать тот же wordmark **`VNOX`** внутри клиента.
### Структура окна
@ -128,10 +128,10 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase
- Ширина **52px**, фон `--bg-strip`, как верхний titlebar для визуальной связности.
- Заголовок колонки: **SERVERS** (8px, `--text-ghost`, центрируется по ширине rail).
- Плитки **30×30px**, скругление 5px, **строго центрируются** по горизонтали (без случайной короткой линии‑разделителя посередине — она давала эффект «криво» в узком rail).
- Плитки **30×30px**, скругление 5px, **строго центрируются** по горизонтали (без случайной короткой линии‑разделителя посередине - она давала эффект «криво» в узком rail).
- **Idle** (нет активной закладки): рамка 1px `--border-faint`, подпись `···` во внутреннем поле, tooltip объясняет «подключайся через Connect».
- **Активная нода**: 2 символа аббревиатуры, `--accent` левый акцент 2px внутри плитки, `--accent-10` фон.
- **«+»**: только одна вторичная плита внизу; tooltip — «bookmark позже».
- **«+»**: только одна вторичная плита внизу; tooltip - «bookmark позже».
### Node switcher (legacy note)
@ -139,7 +139,7 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase
### Channel list (208px)
- Node info (верх): имя ноды 12px semibold + `lnex://nc.<short_id>` 9px `--text-ghost` при коннекте; офлайн — одна строка **not connected**
- Node info (верх): имя ноды 12px semibold + `lnex://nc.<short_id>` 9px `--text-ghost` при коннекте; офлайн - одна строка **not connected**
- Section labels: 9px uppercase, `--text-ghost`, letter-spacing 0.12em
- Channel item: 4px 12px padding, gap 6px (icon + name)
- Default: `--text-ghost`
@ -152,7 +152,7 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase
```
[ open prefs ] (только пока offline)
— voice ~ channel 00:42
- voice ~ channel 00:42
[x] microphone [x] hear others
[YU] you
@ -160,10 +160,10 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase
```
- **Не показывать** фиктивный RTT (например «12ms»), если нет реального измерения.
- **Не дублировать** протокольную строку вида `LNEx v1 · udp` под ником — перегружает и налезает на аватар/текст; протокол раскрывается в Connect / docs.
- Настройки **не** прячем в ряд мелких иконок у ника: основной вход — **`[ prefs ]`** в title bar; офлайн — компактная кнопка **open prefs**.
- **Не дублировать** протокольную строку вида `LNEx v1 · udp` под ником - перегружает и налезает на аватар/текст; протокол раскрывается в Connect / docs.
- Настройки **не** прячем в ряд мелких иконок у ника: основной вход - **`[ prefs ]`** в title bar; офлайн - компактная кнопка **open prefs**.
- В голосе: чекбоксы **microphone** / **hear others** (без эмодзи/символов, которые на части шрифтов дают «квадратики»).
- Avatar: 32×32px, radius 6px, disabled button (только визуал), self — `--accent-10` + border.
- Avatar: 32×32px, radius 6px, disabled button (только визуал), self - `--accent-10` + border.
### Main area
@ -228,9 +228,9 @@ thumb: 10px circle, --accent, subtle glow
```
Size variants:
sm — 24×24px, border-radius 5px (identity bar)
md — 26×26px, border-radius 6px (member list)
lg — 36×36px, border-radius 8px (identity card in settings)
sm - 24×24px, border-radius 5px (identity bar)
md - 26×26px, border-radius 6px (member list)
lg - 36×36px, border-radius 8px (identity card in settings)
Default: bg --bg-elevated, border --border-default, color --text-muted
Self: bg --accent-10, border --border-accent, color --accent
@ -246,7 +246,7 @@ display: flex + ::before/::after lines in --border-subtle
Examples:
● connected · nightcore.lnex · LNEx v1
— today —
- today -
```
---
@ -288,7 +288,7 @@ dot 5px --accent, box-shadow 0 0 6px rgba(255,107,53,0.5)
```
┌─────────────────────────────────────────────────────┐
│ titlebar — [prefs]* │ VNOX │ … │
│ titlebar - [prefs]* │ VNOX │ … │
│ открыть настройки: клик [prefs]; обратный маршрут │
│ тот же, пока приложение показывает settings screen │
├──────────────────────────────────────────────────────┤
@ -328,12 +328,12 @@ dot 5px --accent, box-shadow 0 0 6px rgba(255,107,53,0.5)
## Motion
```
duration-instant: 80ms — toggle, dot
duration-fast: 120ms — hover color change
duration-base: 150ms — toggle thumb, panel transitions
duration-slow: 250ms — page switch in settings
duration-instant: 80ms - toggle, dot
duration-fast: 120ms - hover color change
duration-base: 150ms - toggle thumb, panel transitions
duration-slow: 250ms - page switch in settings
ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего
ease: cubic-bezier(0.0, 0.0, 0.2, 1) - ease-out для всего
```
Никаких scale transforms на hover. Только:
@ -352,7 +352,7 @@ ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего
| Отдельная 1px линия на всю ширину только под titlebar (стек с rail = «случайная полоска») | Отделение только контрастом `--bg-strip` / `--bg-base`; линии локально там, где группируешь контент |
| Круглые аватары | Квадратные с border-radius 5–8px |
| Sidebar с серверами как у Discord (72px, круглые) | Узкий rail **52px**, квадратные плитки **30×30**, аббревиатура, заголовок **SERVERS** |
| Панель участников справа как у Discord | Нет отдельной панели, участники — в боковом списке |
| Панель участников справа как у Discord | Нет отдельной панели, участники - в боковом списке |
| Neon glow на элементах | Subtle glow max 0.18 opacity |
| Pure black backgrounds | Минимум #0a0a0a |
| Pure white text | Максимум #f4c89a |
@ -364,7 +364,7 @@ ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего
## Noise Texture
Лёгкий шум поверх всего интерфейса — добавляет аналоговое ощущение.
Лёгкий шум поверх всего интерфейса - добавляет аналоговое ощущение.
```css
.root::after {
@ -389,12 +389,20 @@ ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего
Палитра допустимых цветов (тёплая, совместимая с системой):
```
#c88b5a — warm amber (default / self)
#6a9ecf — steel blue
#7cb87a — warm green
#c49a6c — sand
#b07cc6 — muted purple
#d4876a — terracotta
#c88b5a - warm amber (default / self)
#6a9ecf - steel blue
#7cb87a - warm green
#c49a6c - sand
#b07cc6 - muted purple
#d4876a - terracotta
```
Не используются: яркие/neon цвета, холодные синие, чистый белый/красный.
## Icons, avatars and emoji in the Slint client
- Icons are Lucide SVG files in `src/ui/slint/assets/icons/`, drawn by `Symbol` and tinted with the theme colours. Do not draw icons from text characters or hand written paths. Licenses are listed in `docs/THIRD_PARTY.md`.
- Icon-only buttons set `text` as their accessible label and tooltip (`ActionButton { icon: "mic"; text: "Mute microphone"; }`). Use `labeled: true` to show the text next to the icon and `primary: true` for the one accent coloured action of a view.
- Every avatar in the app is an `AvatarView` (user panel, messages, members, voice cards, friends, settings). Pass the surface colour behind it as `mask`.
- A `FocusScope` placed above a `TouchArea` must set `focus-on-click: false`, otherwise it swallows the first click and controls only react from the second one. The `ui_smoke` test sends real pointer events to guard this.
- Emoji come from bundled Noto Emoji images (`src/ui/emoji/`), because Slint draws emoji characters in text with a monochrome fallback glyph. The picker and reaction chips use the images.

View file

@ -85,9 +85,9 @@ Full specification: `docs/04-clients/design-system.md`
Key decisions:
- monospace font throughout (IBM Plex Mono)
- warm dark palette (`#0d0d0d` base, `#ff6b35` accent)
- no round server icons — square with abbreviation, 40px sidebar
- no round server icons - square with abbreviation, 40px sidebar
- latency indicator bottom-left, next to identity
- no separate member list panel — voice users shown inline in channel list
- no separate member list panel - voice users shown inline in channel list
---

View file

@ -1,6 +1,6 @@
# Mobile Client
> Status: Phase 3 — not yet started.
> Status: Phase 3 - not yet started.
> This document tracks intentions and open questions.
---
@ -14,7 +14,7 @@ Not a PWA. Not a wrapper around the desktop client.
### UI framework
egui on mobile is not practical today — touch input support is limited,
egui on mobile is not practical today - touch input support is limited,
and the immediate mode model doesn't map well to mobile interaction patterns.
Candidates under consideration:

View file

@ -1,6 +1,6 @@
# Overlay
> Status: Phase 2 — design draft.
> Status: Phase 2 - design draft.
The VNOX overlay renders a HUD on top of running games and applications,
showing voice channel state without alt-tabbing.
@ -50,7 +50,7 @@ For games that support it, the overlay can receive additional data:
### Positional voice (Phase 4)
Games that expose player position data can send it to VNOX,
enabling positional audio — players hear each other based on
enabling positional audio - players hear each other based on
in-game distance and direction.
Integration methods:

View file

@ -1,4 +1,4 @@
# Admin Panel — Design
# Admin Panel - Design
> Target: Phase 1.1 (core) → Phase 1.2 (guilds, roles) → Phase 2 (plugins, bot permissions)
@ -6,11 +6,11 @@
| Layer | Config file (TOML) | Admin panel (GUI) |
|-------|-------------------|-------------------|
| **Infrastructure** | `bind`, `ports`, `data_dir`, TLS certs | — |
| **Infrastructure** | `bind`, `ports`, `data_dir`, TLS certs | - |
| **Node identity** | `name`, `address` | Display only |
| **Storage** | `backend`, `sqlite_path`, `retention` | — |
| **Storage** | `backend`, `sqlite_path`, `retention` | - |
| **Security** | federation gate, rate limits, session timeout | Ban list, mute, kick |
| **Runtime state** | — | Channels, roles, members, invites, audit log |
| **Runtime state** | - | Channels, roles, members, invites, audit log |
| **Plugins** | Plugin enable/disable | Permission keys, commands |
**Rule of thumb:** If it needs a server restart → TOML. If it can apply live → GUI.
@ -24,22 +24,22 @@ Designed for both built-in actions and plugin/bot commands (inspired by LuckPerm
### Built-in permission keys
```
vnox.admin.manage_channels — create, edit, delete channels
vnox.admin.manage_roles — create, edit, delete roles
vnox.admin.manage_members — kick, ban, mute, timeout
vnox.admin.manage_invites — create, delete invites
vnox.admin.manage_guild — edit guild name, icon, settings
vnox.admin.view_audit_log — read audit log
vnox.admin.manage_channels - create, edit, delete channels
vnox.admin.manage_roles - create, edit, delete roles
vnox.admin.manage_members - kick, ban, mute, timeout
vnox.admin.manage_invites - create, delete invites
vnox.admin.manage_guild - edit guild name, icon, settings
vnox.admin.view_audit_log - read audit log
vnox.channel.read — view channel
vnox.channel.send — send messages
vnox.channel.voice_connect — join voice channel
vnox.channel.voice_speak — speak in voice (push-to-talk)
vnox.channel.voice_mute_members — server-mute others
vnox.channel.read - view channel
vnox.channel.send - send messages
vnox.channel.voice_connect - join voice channel
vnox.channel.voice_speak - speak in voice (push-to-talk)
vnox.channel.voice_mute_members - server-mute others
vnox.dm.send — send direct messages
vnox.friend.request — send friend requests
vnox.presence.view — see online status
vnox.dm.send - send direct messages
vnox.friend.request - send friend requests
vnox.presence.view - see online status
```
### Custom permission keys (plugin/bot commands)
@ -47,24 +47,24 @@ vnox.presence.view — see online status
Plugins register their permissions at load time via the RPC API:
```
mybot.command.greet — /greet command
mybot.command.play — /play music
mybot.command.ban_override — override sub-command
mybot.command.greet - /greet command
mybot.command.play - /play music
mybot.command.ban_override - override sub-command
```
**Wildcard support:**
```
vnox.admin.* — all admin permissions
vnox.channel.* — all channel permissions
mybot.* — all commands from mybot
* — everything (owner only)
vnox.admin.* - all admin permissions
vnox.channel.* - all channel permissions
mybot.* - all commands from mybot
* - everything (owner only)
```
### How it works
```
┌──────────────────────────────────────────────────┐
│ Role Editor — "Moderator" │
│ Role Editor - "Moderator" │
├──────────────────────────────────────────────────┤
│ Permission keys: │
│ │
@ -91,14 +91,14 @@ mybot.* — all commands from mybot
```
**Resolution order (highest priority wins):**
1. Owner — overrides everything
2. Channel override (user-specific) — allow/deny
3. Channel override (role-specific) — allow/deny
1. Owner - overrides everything
2. Channel override (user-specific) - allow/deny
3. Channel override (role-specific) - allow/deny
4. Role hierarchy (top role has higher priority)
5. @everyone default
6. Server-wide default
Each override is `(allow_mask, deny_mask)` — deny always beats allow at the same level.
Each override is `(allow_mask, deny_mask)` - deny always beats allow at the same level.
### Database
@ -184,10 +184,10 @@ Server Settings → Channels → [+ Add]
Double-click channel or right-click → "Edit Channel".
Same modal pre-filled, plus:
- **Name change** — updates slug
- **Category change** — moves channel
- **Drag position** — reorder inside category
- **Delete** — with confirmation (soft delete in DB)
- **Name change** - updates slug
- **Category change** - moves channel
- **Drag position** - reorder inside category
- **Delete** - with confirmation (soft delete in DB)
### Drag & Drop
@ -363,7 +363,7 @@ PID 0x00A2 GUILD_TRANSFER client → gateway (owner only)
}
```
**ADMIN_UPDATE_CHANNEL (0x0072) — includes position changes via drag & drop:**
**ADMIN_UPDATE_CHANNEL (0x0072) - includes position changes via drag & drop:**
```json
{
"channel_id": "uuid",
@ -390,7 +390,7 @@ Gateway checks:
2. Is user in guild? → 403 if no
3. Does user have vnox.admin.manage_channels?
- Resolve role hierarchy
- Check channel_overrides (none — new channel)
- Check channel_overrides (none - new channel)
- Check wildcards (vnox.admin.*)
- Owner override → 403 if no
│

View file

@ -1,4 +1,4 @@
# Central Hub — опциональный координационный сервер
# Central Hub - опциональный координационный сервер
## Мотивация
@ -6,12 +6,12 @@ VNOX спроектирован как self-hosted платформа: кажд
Но для adoption нужна точка входа для тех, у кого нет своего сервера, и механизм
обнаружения публичных нодов.
Central Hub — опциональный сервер, который **не заменяет** собственный нод
Central Hub - опциональный сервер, который **не заменяет** собственный нод
и **не хостит** голос/чат. Он только координирует.
## Что делает Central Hub
### 1. Discovery / Registry — реестр публичных нодов
### 1. Discovery / Registry - реестр публичных нодов
Владельцы нодов могут опубликовать свой сервер в реестре:
- адрес, название, описание, регион
@ -19,19 +19,19 @@ Central Hub — опциональный сервер, который **не з
- мета: онлайне, кол-во пользователей
Клиент может найти сервер по тегам/названию и подключиться.
Без Central Hub — только прямой ввод адреса или закладки.
Без Central Hub - только прямой ввод адреса или закладки.
### 2. Global identity bridge — аккаунт без своего нода
### 2. Global identity bridge - аккаунт без своего нода
Пользователь регистрирует ключ на Central Hub:
- `user@hub` — глобальный идентификатор
- `user@hub` - глобальный идентификатор
- никнейм, аватар (опционально)
- привязка к одному или нескольким "гостевым" нодам
Позволяет зайти в VNOX без поднятия собственной инфраструктуры.
При этом Central Hub не хранит сообщения, не релеит голос, не управляет каналами.
### 3. Push notification relay — поддержка мобильных
### 3. Push notification relay - поддержка мобильных
Мобильные клиенты не могут держать постоянное TCP/UDP соединение.
Central Hub принимает пуш-уведомления от нодов:
@ -41,7 +41,7 @@ Central Hub принимает пуш-уведомления от нодов:
Без этого мобильный клиент будет получать сообщения только с задержками.
### 4. User directory / friend graph — глобальная социальная сеть
### 4. User directory / friend graph - глобальная социальная сеть
Список друзей и поиск пользователей не привязан к одному ноду:
- `@user` ищется по Central Hub
@ -53,13 +53,13 @@ Central Hub принимает пуш-уведомления от нодов:
- ❌ Не хостит голосовые каналы
- ❌ Не хостит текстовые каналы
- ❌ Не хранит историю сообщений
- ❌ Не управляет сессиями — только направляет
- ❌ Не заменяет self-hosted нод — только дополняет
- ❌ Не управляет сессиями - только направляет
- ❌ Не заменяет self-hosted нод - только дополняет
Hub — это телефонная книга и коммутатор, а не сам телефон.
Hub - это телефонная книга и коммутатор, а не сам телефон.
## Деплой
Central Hub — отдельный бинарник (например, `vnox-hub`).
Central Hub - отдельный бинарник (например, `vnox-hub`).
Работает на HTTP(S) / WebSocket, минимальные требования.
Может быть поднят кем угодно, не обязательно авторами VNOX.

View file

@ -15,7 +15,7 @@ Three related but distinct features:
| **Stickers** | 512×512 max | PNG, GIF, WebP, Lottie† | Per-guild + per-user | Server filesystem |
| **GIF Picker** | External | GIF (Tenor/Giphy API) | Per-server config | Proxy via server |
† Lottie — future, not Phase 2.
† Lottie - future, not Phase 2.
### Difference from unicode reactions
@ -171,7 +171,7 @@ Server sends on guild join. Client caches locally.
}
```
Image bytes are NOT included — client lazy-loads via `EMOJI_DATA` + `EMOJI_DATA_RESP`.
Image bytes are NOT included - client lazy-loads via `EMOJI_DATA` + `EMOJI_DATA_RESP`.
### EMOJI_ADD (0x0071)
@ -205,7 +205,7 @@ Server removes file + DB row, broadcasts `EMOJI_UPDATE` with `deleted: true`.
### EMOJI_DATA / EMOJI_DATA_RESP (0x0078/0x0079)
Lazy-load pattern — client requests image bytes when first rendering an emoji.
Lazy-load pattern - client requests image bytes when first rendering an emoji.
Request:
```json
@ -408,36 +408,36 @@ When two nodes federate:
### GIF proxy
GIF search always goes through the user's home node.
The server proxies to Tenor/Giphy — no federation needed for GIF results (they're just URLs).
The server proxies to Tenor/Giphy - no federation needed for GIF results (they're just URLs).
---
## Migration Path
### Phase 1.3 — Unicode reactions only
### Phase 1.3 - Unicode reactions only
- `message_reactions` table (already designed)
- Unicode emoji picker in client
- No custom emoji, no stickers, no GIF
### Phase 2 — Custom emoji
### Phase 2 - Custom emoji
- Add `guild_emojis` table
- Add packet types 0x0070–0x0073, 0x0078–0x0079
- Client emoji picker with custom tab
- Admin upload/delete UI
- No federation support yet
### Phase 2 — Stickers
### Phase 2 - Stickers
- Add `guild_stickers` + `user_stickers` tables
- Add packet types 0x0074–0x0077
- Sticker panel in client
- New message content_type: "sticker"
### Phase 2 — GIF picker
### Phase 2 - GIF picker
- Add Tenor/Giphy config to gateway
- Add packet types 0x0080–0x0081
- GIF picker widget in client
- Server-side proxy (API key protection)
### Phase 3 — Federation
### Phase 3 - Federation
- Cross-node emoji/sticker sync
- `@node` suffix in references

View file

@ -1,4 +1,4 @@
# Direct Messages — Phase 1.1
# Direct Messages - Phase 1.1
## Goal

View file

@ -1,4 +1,4 @@
# Private Mode — Phase 1.1
# Private Mode - Phase 1.1
## Goal
@ -81,4 +81,4 @@ if !config.federation.enabled {
| `private` | Fully isolated. Like OwnCord. Safe for personal LAN/ home server. |
| `federated` | Can discover, peer, and sync with other VNOX nodes. Like Matrix. |
Default is `private` — opt-in to federation.
Default is `private` - opt-in to federation.

View file

@ -1,4 +1,4 @@
# Slint UI Migration — Phase 1.1
# Slint UI Migration - Phase 1.1
## Current state
@ -18,23 +18,23 @@ Desktop client uses **egui** (immediate-mode GUI). Functional but:
| Chat app fit | ❌ feel | ✅ modern | ✅ modern |
| Learning curve | Low | Medium | Medium |
**Recommendation:** Slint — declarative DSL makes UI easier to iterate,
**Recommendation:** Slint - declarative DSL makes UI easier to iterate,
built-in design system produces professional look out of the box.
## Migration strategy
### Stage 1 — Side-by-side (week 1)
### Stage 1 - Side-by-side (week 1)
- Embed Slint canvas alongside existing egui panels
- Rewrite sidebar (server list + channel list) in Slint first
- Keep chat area in egui
- Verify data flow works between both frameworks
### Stage 2 — Chat panel (week 2)
### Stage 2 - Chat panel (week 2)
- Rewrite channel chat (text messages + input bar) in Slint
- Rewrite voice panel in Slint
- Remove egui chat dependency
### Stage 3 — Settings & polish (week 3)
### Stage 3 - Settings & polish (week 3)
- Rewrite settings window in Slint
- Add dark/light theme toggle
- Add accent color picker
@ -102,7 +102,7 @@ client/src/ui/
## Open questions
- Slint's rendering backend (gl/winit/software) — test on all target platforms
- Slint's rendering backend (gl/winit/software) - test on all target platforms
- Slint's text input / rich text support for chat messages (emoji, markdown?)
- Whether to remove egui entirely or keep for specific panels (e.g. overlay)
- Licensing: Slint is LGPL (compatible with GPL-3.0 for now, but check for future)

View file

@ -1,4 +1,4 @@
# Video, Camera & Screen Share — Design Audit
# Video, Camera & Screen Share - Design Audit
> Audits `docs/05-features/video.md` against the current codebase and roadmap.
> Each gap has: problem, recommendation, priority, target file.
@ -12,19 +12,19 @@ But critical details are missing for actual implementation. This audit fills tho
---
## 1. Video-node — Integration with existing architecture
## 1. Video-node - Integration with existing architecture
### Gap 1.1 — Video-node lifecycle
### Gap 1.1 - Video-node lifecycle
**Problem:** `video.md` says "separate binary or embedded in voice-node" but doesn't decide. Voice-node has just been refactored with jitter buffer — video needs the same relay pattern.
**Problem:** `video.md` says "separate binary or embedded in voice-node" but doesn't decide. Voice-node has just been refactored with jitter buffer - video needs the same relay pattern.
**Recommendation:** Separate binary (`vnox-video-node`). Video frames are fundamentally different from voice packets (keyframes, fragmentation, higher bandwidth). Keeping them separate avoids coupling and allows independent scaling.
**Priority:** P0 — must decide before writing a line of code.
**Priority:** P0 - must decide before writing a line of code.
**Target:** `video.md` — add "Deployment" section.
**Target:** `video.md` - add "Deployment" section.
### Gap 1.2 — Channel membership signalling
### Gap 1.2 - Channel membership signalling
**Problem:** Video-node needs to know which users are in which channel. Currently this is managed by gateway. How does video-node learn membership?
@ -40,27 +40,27 @@ But critical details are missing for actual implementation. This audit fills tho
}
```
**Priority:** P0 — video relay can't work without knowing recipients.
**Priority:** P0 - video relay can't work without knowing recipients.
**Target:** `video.md` — add "Gateway integration" section.
**Target:** `video.md` - add "Gateway integration" section.
### Gap 1.3 — No encryption spec
### Gap 1.3 - No encryption spec
**Problem:** Voice packets are encrypted with ChaCha20-Poly1305. Video packets are not addressed — are they encrypted? With what keys?
**Problem:** Voice packets are encrypted with ChaCha20-Poly1305. Video packets are not addressed - are they encrypted? With what keys?
**Recommendation:** Same ChaCha20-Poly1305 AEAD as voice. Each video session gets ephemeral keys derived via the same X25519 ECDH + HKDF-SHA256 path used for voice. Video-node does NOT decrypt (transparent relay, same as voice-node).
The session key exchange happens during `HELLO` handshake — add a `video_key` field alongside the existing `voice_key`.
The session key exchange happens during `HELLO` handshake - add a `video_key` field alongside the existing `voice_key`.
**Priority:** P0 — security regression if video is plaintext.
**Priority:** P0 - security regression if video is plaintext.
**Target:** `video.md` — add "Encryption" section; `docs/02-protocol/security.md` — add video encryption note.
**Target:** `video.md` - add "Encryption" section; `docs/02-protocol/security.md` - add video encryption note.
---
## 2. Camera Capture — Missing details
## 2. Camera Capture - Missing details
### Gap 2.1 — nokhwa API surface and fallback
### Gap 2.1 - nokhwa API surface and fallback
**Problem:** `video.md` mentions `nokhwa` but not the concrete API or what happens on platforms where it doesn't work (Linux v4l2 permissions, Wayland).
@ -86,11 +86,11 @@ pub struct StreamConfig {
Make `nokhwa` a feature gate (same pattern as `rnnoise` for voice).
**Priority:** P0 — blocks camera implementation.
**Priority:** P0 - blocks camera implementation.
**Target:** New file: `client/src/video/capture.rs` (spec in `video.md`).
### Gap 2.2 — Device hotplug / switch
### Gap 2.2 - Device hotplug / switch
**Problem:** No mention of what happens when camera is unplugged/replugged or user switches camera mid-call.
@ -106,11 +106,11 @@ enum CaptureEvent {
Client handles `DeviceLost` by showing placeholder tile. User can select new device in settings without leaving call.
**Priority:** P1 — quality of life, not MVP blocker.
**Priority:** P1 - quality of life, not MVP blocker.
**Target:** `video.md` — add "Device lifecycle" to capture section.
**Target:** `video.md` - add "Device lifecycle" to capture section.
### Gap 2.3 — Resolution / FPS negotiation
### Gap 2.3 - Resolution / FPS negotiation
**Problem:** `video.md` says "720p default, 30 fps" but doesn't say how clients agree on parameters. Different clients have different cameras.
@ -124,15 +124,15 @@ max_fps = 30
max_bitrate_kbps = 2500
```
**Priority:** P1 — needed before multi-user video testing.
**Priority:** P1 - needed before multi-user video testing.
**Target:** `video.md` — add "Capability negotiation" section.
**Target:** `video.md` - add "Capability negotiation" section.
---
## 3. Screen Share — Almost entirely missing
## 3. Screen Share - Almost entirely missing
### Gap 3.1 — Screen capture crate
### Gap 3.1 - Screen capture crate
**Problem:** `video.md` mentions "Screen sharing (desktop capture)" as one bullet in Phase 2, no detail.
@ -140,18 +140,18 @@ max_bitrate_kbps = 2500
| Platform | Crate | Notes |
|----------|-------|-------|
| Windows | `windows-capture` or DXGI via `winapi` | DXGI Desktop Duplication API — best perf |
| Windows | `windows-capture` or DXGI via `winapi` | DXGI Desktop Duplication API - best perf |
| Linux X11 | `x11cap` or raw XSHM | X11 only, no Wayland |
| Linux Wayland | `pipewire` via `pw-video` or xdg-desktop-portal | Portal is the standard path |
| macOS | `screencapturekit` via objc bindings or `CGDisplay` | ScreenCaptureKit requires macOS 13+ |
Abstract behind same `VideoSource` trait as camera. Two implementations: `CameraSource`, `ScreenSource`.
**Priority:** P1 — needed for Phase 2 screen share.
**Priority:** P1 - needed for Phase 2 screen share.
**Target:** New doc: `docs/05-features/screen-share.md` or extend `video.md` Phase 2.
### Gap 3.2 — Window/display selection UI
### Gap 3.2 - Window/display selection UI
**Problem:** User needs to pick which screen or window to share. No UI spec.
@ -176,13 +176,13 @@ Abstract behind same `VideoSource` trait as camera. Two implementations: `Camera
└─────────────────────────────────────────┘
```
**Priority:** P1 — UX blocker for screen share.
**Priority:** P1 - UX blocker for screen share.
**Target:** `video.md` — add "Screen share UI" section.
**Target:** `video.md` - add "Screen share UI" section.
### Gap 3.3 — System audio capture with screen
### Gap 3.3 - System audio capture with screen
**Problem:** "Share system audio" checkbox in the mockup — how? No mention in video.md.
**Problem:** "Share system audio" checkbox in the mockup - how? No mention in video.md.
**Recommendation:**
- Windows: WASAPI loopback (`cpal` supports it with `loopback` config)
@ -191,11 +191,11 @@ Abstract behind same `VideoSource` trait as camera. Two implementations: `Camera
Feature-gate it: `--features screen-audio`. Not all platforms support it cleanly.
**Priority:** P2 — nice to have, not MVP.
**Priority:** P2 - nice to have, not MVP.
**Target:** `video.md` Phase 2 — add "System audio" bullet.
**Target:** `video.md` Phase 2 - add "System audio" bullet.
### Gap 3.4 — Screen share FPS strategy
### Gap 3.4 - Screen share FPS strategy
**Problem:** Screen share has different FPS needs than camera. Coding: 15fps is fine. Gaming: 60fps needed.
@ -203,15 +203,15 @@ Feature-gate it: `--features screen-audio`. Not all platforms support it cleanly
Default: 15fps for screen share, 30fps for camera.
**Priority:** P2 — optimization, not MVP.
**Priority:** P2 - optimization, not MVP.
**Target:** `video.md` — add to Phase 2.
**Target:** `video.md` - add to Phase 2.
---
## 4. Interaction Model — Video + Voice
## 4. Interaction Model - Video + Voice
### Gap 4.1 — Video tied to voice channel
### Gap 4.1 - Video tied to voice channel
**Problem:** `video.md` implies video is in the same channel as voice. What if users want video-only (no voice) or voice-only (no video)?
@ -226,25 +226,25 @@ Channel membership = voice channel membership. Video is additive.
New voice state: `VOICE_STATE` gets a `video: bool` field.
**Priority:** P0 — architectural decision, affects protocol design.
**Priority:** P0 - architectural decision, affects protocol design.
**Target:** `video.md` — add "Interaction model" section; `docs/02-protocol/packets.md` — extend VOICE_STATE.
**Target:** `video.md` - add "Interaction model" section; `docs/02-protocol/packets.md` - extend VOICE_STATE.
### Gap 4.2 — Video without voice
### Gap 4.2 - Video without voice
**Problem:** Some users may want to watch a stream without transmitting audio. Current model requires voice channel join.
**Recommendation:** Phase 1: allow joining voice channel muted+deafened to watch video. Phase 3: separate "watch-only" mode (VIEW permission).
**Priority:** P2 — Phase 1 workaround is acceptable.
**Priority:** P2 - Phase 1 workaround is acceptable.
**Target:** `video.md` — add "Watch-only mode" to Phase 3.
**Target:** `video.md` - add "Watch-only mode" to Phase 3.
---
## 5. Performance & Quality
### Gap 5.1 — Bitrate adaptation
### Gap 5.1 - Bitrate adaptation
**Problem:** No mechanism to adjust video bitrate based on network conditions. Voice has jitter buffer adaptation, video has nothing.
@ -265,11 +265,11 @@ Video-node sends periodic `VIDEO_STATS` with per-receiver loss rates:
}
```
**Priority:** P1 — needed for real-world use.
**Priority:** P1 - needed for real-world use.
**Target:** `video.md` — add "Adaptive bitrate" section.
**Target:** `video.md` - add "Adaptive bitrate" section.
### Gap 5.2 — Simulcast design
### Gap 5.2 - Simulcast design
**Problem:** "Simulcast" is listed as Phase 3 with no design. Different receivers have different bandwidth.
@ -283,13 +283,13 @@ Sender → encode: 1080p (4Mbps) + 720p (1.5Mbps) + 360p (500kbps)
1080p→A 720p→B 360p→C (based on per-receiver stats)
```
Requires VP9 SVC or H.264 simulcast. Complex — Phase 3 is correct.
Requires VP9 SVC or H.264 simulcast. Complex - Phase 3 is correct.
**Priority:** P2 — Phase 3, but design it now to avoid architecture lock-in.
**Priority:** P2 - Phase 3, but design it now to avoid architecture lock-in.
**Target:** `video.md` Phase 3 — expand "Simulcast" bullet.
**Target:** `video.md` Phase 3 - expand "Simulcast" bullet.
### Gap 5.3 — Keyframe interval
### Gap 5.3 - Keyframe interval
**Problem:** New viewers joining mid-stream need a keyframe to start decoding. Video.md doesn't mention keyframe strategy.
@ -301,15 +301,15 @@ Requires VP9 SVC or H.264 simulcast. Complex — Phase 3 is correct.
Add `REQUEST_KEYFRAME` packet for explicit PLI (Picture Loss Indication).
**Priority:** P1 — new viewers can't see video without keyframe.
**Priority:** P1 - new viewers can't see video without keyframe.
**Target:** `video.md` — add "Keyframe handling" section.
**Target:** `video.md` - add "Keyframe handling" section.
---
## 6. Missing Protocol Details
### Gap 6.1 — No packet fragmentation spec
### Gap 6.1 - No packet fragmentation spec
**Problem:** Video frames can be 50-100KB. UDP MTU is ~1400 bytes. Video.md says "Packetize into MTU-friendly chunks" but doesn't define the fragmentation protocol.
@ -325,27 +325,27 @@ Each video frame:
3. Last chunk sets `LAST_FRAG` flag
4. Receiver reassembles before decode
New packet type: `VIDEO_FRAME_FRAGMENT (0x0012)` — separate from unfragmented `VIDEO_FRAME (0x0011)`.
New packet type: `VIDEO_FRAME_FRAGMENT (0x0012)` - separate from unfragmented `VIDEO_FRAME (0x0011)`.
Wait — `VIDEO_FRAME` ID isn't assigned in the packet registry yet. Register:
Wait - `VIDEO_FRAME` ID isn't assigned in the packet registry yet. Register:
```
0x0011 VIDEO_FRAME single (small) video frame, no fragmentation
0x0012 VIDEO_FRAME_FRAG fragment of a larger video frame
```
**Priority:** P0 — video can't work over UDP without fragmentation.
**Priority:** P0 - video can't work over UDP without fragmentation.
**Target:** `video.md` — replace packet format section; `docs/02-protocol/packets.md` — add 0x0011/0x0012 to registry.
**Target:** `video.md` - replace packet format section; `docs/02-protocol/packets.md` - add 0x0011/0x0012 to registry.
### Gap 6.2 — No RTCP-like receiver reports
### Gap 6.2 - No RTCP-like receiver reports
**Problem:** Sender has no feedback about what receivers are experiencing. Voice has implicit feedback (jitter buffer stats), video needs explicit.
**Recommendation:** Minimal receiver report packet:
```json
// 0x0013 VIDEO_RECEIVER_REPORT — client → video-node → sender
// 0x0013 VIDEO_RECEIVER_REPORT - client → video-node → sender
{
"frame_seq": 1042,
"loss_cumulative": 15,
@ -357,21 +357,21 @@ Wait — `VIDEO_FRAME` ID isn't assigned in the packet registry yet. Register:
Client sends every 1 second. Video-node aggregates and forwards to sender.
**Priority:** P1 — needed for ABR and quality adaptation.
**Priority:** P1 - needed for ABR and quality adaptation.
**Target:** `video.md` — add "Receiver reports" section.
**Target:** `video.md` - add "Receiver reports" section.
---
## 7. Guild Integration (Phase 1.2)
### Gap 7.1 — Video permissions already defined
### Gap 7.1 - Video permissions already defined
**Status:** ✅ `STREAM` (bit 18) permission is already in the community model (`docs/07-community-model.md`). Covers both camera and screen share.
No gap here — just implement the check in gateway when processing `VIDEO_SESSION_JOIN`.
No gap here - just implement the check in gateway when processing `VIDEO_SESSION_JOIN`.
### Gap 7.2 — Channel-level video settings
### Gap 7.2 - Channel-level video settings
**Problem:** Guild admins may want to disable video in certain channels (text-only channels, AFK channel).
@ -383,37 +383,37 @@ ALTER TABLE channels ADD COLUMN video_allowed BOOLEAN NOT NULL DEFAULT 1;
Gateway rejects `VIDEO_SESSION_JOIN` if `video_allowed = false`.
**Priority:** P1 — admin control expected by guild owners.
**Priority:** P1 - admin control expected by guild owners.
**Target:** `docs/10-database.md` — add column to channels table; `docs/07-community-model.md` — add `video_allowed` to channel settings.
**Target:** `docs/10-database.md` - add column to channels table; `docs/07-community-model.md` - add `video_allowed` to channel settings.
---
## 8. Mobile Considerations (Phase 3)
### Gap 8.1 — Front/back camera switch
### Gap 8.1 - Front/back camera switch
**Problem:** Mobile video.md doesn't mention camera switching at all.
**Recommendation:** Mobile client sends `CAMERA_SWITCH` event to video-node — no protocol change needed, just local capture change. New frame stream with `camera: front|back` metadata.
**Recommendation:** Mobile client sends `CAMERA_SWITCH` event to video-node - no protocol change needed, just local capture change. New frame stream with `camera: front|back` metadata.
**Priority:** P2 — Phase 3.
**Priority:** P2 - Phase 3.
**Target:** `docs/04-clients/mobile.md` (doesn't exist yet — create in Phase 3).
**Target:** `docs/04-clients/mobile.md` (doesn't exist yet - create in Phase 3).
### Gap 8.2 — Self preview
### Gap 8.2 - Self preview
**Problem:** Desktop video grid has "Self-view (small, picture-in-picture corner)". On mobile the self-view is more important (front camera framing).
**Recommendation:** Mobile layout: self-view full-width at top, other participants in scrollable grid below. Toggle button to swap.
**Priority:** P2 — Phase 3.
**Priority:** P2 - Phase 3.
**Target:** `docs/04-clients/mobile.md`.
---
## Gap Summary — What to Add Before Implementation
## Gap Summary - What to Add Before Implementation
| # | Gap | Priority | Target file |
|---|-----|----------|-------------|
@ -441,13 +441,13 @@ Gateway rejects `VIDEO_SESSION_JOIN` if `video_allowed = false`.
## Recommended Implementation Order
1. **Update `video.md`** — incorporate P0 and P1 gaps from this audit into the design doc
2. **Register packet types** — 0x0011–0x0013 in `packets.md`
3. **Video-node prototype** — separate binary, UDP relay, no encoding/decoding (transparent relay like voice)
4. **Gateway ↔ video-node signalling** — internal TCP control channel for membership
5. **Client camera capture** — `VideoSource` trait + `NokhwaSource` behind feature gate
6. **Fragmentation** — implement FRAGMENTED/LAST_FRAG for video frames
7. **Grid UI** — basic 2×2 grid in client
8. **Encryption** — ChaCha20-Poly1305 for video frames
9. **ABR + receiver reports** — iterate toward production quality
10. **Screen share** — `ScreenSource` implementation + picker UI
1. **Update `video.md`** - incorporate P0 and P1 gaps from this audit into the design doc
2. **Register packet types** - 0x0011–0x0013 in `packets.md`
3. **Video-node prototype** - separate binary, UDP relay, no encoding/decoding (transparent relay like voice)
4. **Gateway ↔ video-node signalling** - internal TCP control channel for membership
5. **Client camera capture** - `VideoSource` trait + `NokhwaSource` behind feature gate
6. **Fragmentation** - implement FRAGMENTED/LAST_FRAG for video frames
7. **Grid UI** - basic 2×2 grid in client
8. **Encryption** - ChaCha20-Poly1305 for video frames
9. **ABR + receiver reports** - iterate toward production quality
10. **Screen share** - `ScreenSource` implementation + picker UI

View file

@ -1,4 +1,4 @@
# Video Chat — Architecture
# Video Chat - Architecture
## Goal
@ -14,9 +14,9 @@ Current (voice only):
└─ Client: mic → Opus → UDP → voice-node → UDP → client → playback
With video:
├─ Gateway: TCP (signaling) — UNCHANGED
├─ Voice-node: UDP (Opus voice) — UNCHANGED
├─ Video-node: UDP (H.264/VP9 relay) — NEW
├─ Gateway: TCP (signaling) - UNCHANGED
├─ Voice-node: UDP (Opus voice) - UNCHANGED
├─ Video-node: UDP (H.264/VP9 relay) - NEW
│ └─ Receives encoded frames, relays to channel members
└─ Client: mic → Opus → UDP → voice-node
webcam → H.264 → UDP → video-node ← UDP → decode → display grid
@ -29,7 +29,7 @@ New optional component, separate binary or embedded in voice-node.
### Responsibilities
- Receive encoded video frames over UDP
- Relay to all other clients in the same voice channel
- No transcoding (relay only — CPU efficient)
- No transcoding (relay only - CPU efficient)
- Max resolution / bitrate per channel configurable
### Packet format
@ -60,10 +60,10 @@ New file: `client/src/video/capture.rs`
### Dependencies
- `nokhwa` — cross-platform camera capture (Rust)
- `ffmpeg-next` or `rav1e` — H.264/VP9 encoding
- `nokhwa` - cross-platform camera capture (Rust)
- `ffmpeg-next` or `rav1e` - H.264/VP9 encoding
## Client UI — Video grid
## Client UI - Video grid
New component: `client/src/ui/video.rs`

View file

@ -41,7 +41,7 @@ RustSec до обновления:5 advisories. После обновления:
Для этого обновлён rfd до0.17.2, parent UI/accessibility callers адаптированы к поддерживаемому zbus6, Wayland CSD использует crossfont0.9. Accessibility, portal и Wayland сохранены. `typed-index-collections` закреплён на совместимом3.2.3, чтобы убрать неиспользуемый optional bincode из resolution; это осознанное исключение из выбора самой новой версии.
Локальные compatibility backports — отдельная обязанность сопровождения, а не релизы upstream. Точные исходные версии, SHA256, лицензии, исходные ревизии и девять компактных diff записаны в `patches/`. Патчи следует удалить после соответствующих upstream релизов. Для Linux нужны FreeType/fontconfig development packages (`libfreetype6-dev libfontconfig1-dev` на Ubuntu).
Локальные compatibility backports - отдельная обязанность сопровождения, а не релизы upstream. Точные исходные версии, SHA256, лицензии, исходные ревизии и девять компактных diff записаны в `patches/`. Патчи следует удалить после соответствующих upstream релизов. Для Linux нужны FreeType/fontconfig development packages (`libfreetype6-dev libfontconfig1-dev` на Ubuntu).
## Совместимость и проверки

View file

@ -6,25 +6,25 @@
| № | Область | Проблема | Поток | Статус |
|---|---------|----------|-------|--------|
| 1 | Список каналов | Текст «general» стоит выше центра строки, не выровнен с иконкой `#` | A | открыто |
| 2 | Участники | У самого пользователя «Не в сети», хотя внизу «В сети»; аватар из двух букв «us» | A, C | открыто |
| 3 | Панель пользователя | Кривые иконки микрофона, наушников и настроек | A | открыто |
| 4 | Поле ввода | Ненужная подсказка «Enter отправить, Shift+Enter новая строка» | A | открыто |
| 5 | Иконки | Шестерёнка выглядит как цветок или снежинка, набор иконок самодельный | A | открыто |
| 6 | Шапка сервера | Кнопка «питание» рядом с названием сервера непонятна | A | открыто |
| 7 | Сообщения | В панели при наведении («Ответить, Править, Удалить») странная иконка слева | A | открыто |
| 8 | Эмодзи | Нет выбора эмодзи для текста сообщения и для реакций на сообщения | A | открыто |
| 1 | Список каналов | Текст «general» стоит выше центра строки, не выровнен с иконкой `#` | A | исправлено (поток A): текст в строках со значком выравнивался по верху, теперь `vertical-alignment: center` и кнопки в шапках центрируются через `VerticalLayout` |
| 2 | Участники | У самого пользователя «Не в сети», хотя внизу «В сети»; аватар из двух букв «us» | A, C | интерфейс исправлен (поток A): собственный пользователь в списке участников всегда «В сети», как в панели; аватар из двух букв остаётся до передачи аватаров по сети (поток C) |
| 3 | Панель пользователя | Кривые иконки микрофона, наушников и настроек | A | исправлено (поток A): иконки Lucide вместо самодельных путей |
| 4 | Поле ввода | Ненужная подсказка «Enter отправить, Shift+Enter новая строка» | A | исправлено (поток A): подсказка под полем ввода удалена, добавлен плейсхолдер «Сообщение» |
| 5 | Иконки | Шестерёнка выглядит как цветок или снежинка, набор иконок самодельный | A | исправлено (поток A): набор Lucide (ISC), шестерёнка `settings`, все юникод-значки заменены |
| 6 | Шапка сервера | Кнопка «питание» рядом с названием сервера непонятна | A | исправлено (поток A): иконка выхода `log-out` с подсказкой «Отключиться от сервера» |
| 7 | Сообщения | В панели при наведении («Ответить, Править, Удалить») странная иконка слева | A | исправлено (поток A): панель действий с иконками (быстрые реакции, реакция, ответ, правка, удаление); пустой квадрат слева был эмодзи без шрифта |
| 8 | Эмодзи | Нет выбора эмодзи для текста сообщения и для реакций на сообщения | A | исправлено (поток A): выбор эмодзи в поле ввода и для реакций, категории и поиск (ru и en), реакции показаны под сообщением и переключаются кликом; картинки Noto Emoji, цветные глифы в тексте этой сборкой не рисуются |
| 9 | Звук | В голосовой комнате нет звуков: вход и выход участников, сообщения, упоминание или пинг, mute и unmute, подключение | B исправлено: звуки событий синтезируются программно, настройки в разделе «Звуки», диагностика ошибок аудио (см. ниже) |
| 10a | Голос | По умолчанию стоит режим рации (PTT), выглядит странно и неудобно; нужен обычный режим по активации голоса | B исправлено: по умолчанию голосовая активность с автоподбором порога |
| 10b | Голосовая комната | Страница слишком серая, текстовые кнопки «Выключить микрофон», «Выключить звук», «Покинуть комнату» неудобны; нужны иконочные кнопки | A | открыто |
| 10b | Голосовая комната | Страница слишком серая, текстовые кнопки «Выключить микрофон», «Выключить звук», «Покинуть комнату» неудобны; нужны иконочные кнопки | A | исправлено (поток A): карточки участников с аватаром и кольцом говорящего, круглые иконочные кнопки с подсказками, выключенные состояния красные |
| 10c | Голосовая комната | Верхняя строка «Подключение к голосовой комнате…» остаётся, хотя внизу «Голос подключён» | B исправлено: единый статус голоса (см. ниже) |
| 10d | Аккаунт | Можно зайти на сервер без аккаунта; регистрация или вход в Central должны быть обязательными | C | открыто |
| 10e | Аватары | Две буквы вместо аватара; при первой регистрации нужен случайный сгенерированный аватар | C | открыто |
| 10f | Отзывчивость | Приложение реагирует медленно; нажатие срабатывает не с одного клика, а со второго | A | открыто |
| 10f | Отзывчивость | Приложение реагирует медленно; нажатие срабатывает не с одного клика, а со второго | A | исправлено (поток A). Причина: `FocusScope` лежал над `TouchArea` и по умолчанию забирал первое нажатие (`focus-on-click`), клик доходил до кнопки только со второго раза; плюс панель действий над сообщением пропадала при наведении на её кнопки. Тест `ui_smoke` шлёт реальные события указателя и падал до исправления. Отдельно остаётся: `refresh_devices` при открытии настроек опрашивает ALSA в потоке интерфейса (поток B) |
| 11a | Настройки звука | В списках устройств вывода и микрофона мусорные ALSA-пункты (Discard all samples, Rate Converter Plugin, JACK, Open Sound System) | B исправлено: фильтр устройств, выбор хранится по идентификатору |
| 11b | Настройки | Те же двойные клики в настройках | A | открыто |
| 12a | Темы | Тема работает странно (чёрная тема: части интерфейса остаются серыми, фон не везде одинаковый) | A | открыто |
| 12b | Аватар | Аватар в панели пользователя обновился, в карточке участника голосовой комнаты остались две буквы | A, C | открыто |
| 11b | Настройки | Те же двойные клики в настройках | A | исправлено (поток A): та же причина, что в 10f |
| 12a | Темы | Тема работает странно (чёрная тема: части интерфейса остаются серыми, фон не везде одинаковый) | A | исправлено (поток A): все экраны проверены в светлой, тёмной, чёрной и своей теме по снимкам `ui_smoke`; захардкоженные цвета убраны, кнопка отправки и состояния берут цвета темы |
| 12b | Аватар | Аватар в панели пользователя обновился, в карточке участника голосовой комнаты остались две буквы | A, C | интерфейс исправлен (поток A): один компонент `AvatarView` в панели, сообщениях, участниках, голосовых карточках и друзьях; свой аватар виден везде, чужие аватары ждут поток C |
| 12c | Аватар | Неясно, доходит ли аватар до других пользователей. Проверить и, если нет, реализовать передачу | C | открыто |
## Принципы исправления

View file

@ -1,4 +1,4 @@
# Slint UI Migration Plan — VNOX Client
# Slint UI Migration Plan - VNOX Client
## Current Architecture (egui)
@ -18,7 +18,7 @@ main.rs
└─ settings::show_window()
```
State: `UiState` — single large struct (131+ lines) with conn, channels, messages, DMs, guilds, friends, audio settings, voice state. Mutated directly in place every frame.
State: `UiState` - single large struct (131+ lines) with conn, channels, messages, DMs, guilds, friends, audio settings, voice state. Mutated directly in place every frame.
UI: 80+ Rust files in `ui/`, all immediate-mode egui. Every widget redrawn every frame.
@ -31,19 +31,19 @@ main.rs
└─ slint::MainWindow::new() → .run()
│
├─ .slint files (declarative UI)
│ ├─ main.slint — window layout
│ ├─ sidebar.slint — guild bar + channel list
│ ├─ chat.slint — message list + input bar
│ ├─ voice.slint — voice channel panel
│ ├─ connect.slint — connect/bookmarks screen
│ ├─ settings.slint — settings dialog
│ └─ theme.slint — color/font/spacing definitions
│ ├─ main.slint - window layout
│ ├─ sidebar.slint - guild bar + channel list
│ ├─ chat.slint - message list + input bar
│ ├─ voice.slint - voice channel panel
│ ├─ connect.slint - connect/bookmarks screen
│ ├─ settings.slint - settings dialog
│ └─ theme.slint - color/font/spacing definitions
│
└─ Rust code (logic only)
├─ app.rs — VnoxApp, init, event wiring
├─ bridge.rs — UiState ↔ Slint property sync
├─ state/ — UiState (unchanged, slimmed)
└─ net/ audio/ — no changes
├─ app.rs - VnoxApp, init, event wiring
├─ bridge.rs - UiState ↔ Slint property sync
├─ state/ - UiState (unchanged, slimmed)
└─ net/ audio/ - no changes
```
Key difference: Slint only re-renders changed properties. UI is declared once in `.slint` files. Rust code pushes state updates via `in-out property` setters.
@ -52,14 +52,14 @@ Key difference: Slint only re-renders changed properties. UI is declared once in
## Migration Phases
### Phase 1 — Infrastructure (day 1)
### Phase 1 - Infrastructure (day 1)
1. Add `slint` crate to `Cargo.toml`:
```toml
slint = { version = "1", features = ["backend-winit", "compat-1-2"] }
```
2. Create `ui/main.slint` — empty window with a placeholder text
2. Create `ui/main.slint` - empty window with a placeholder text
3. Rewrite `main.rs`:
- Remove `eframe::run_native()`
@ -72,9 +72,9 @@ Key difference: Slint only re-renders changed properties. UI is declared once in
---
### Phase 2 — Sidebar (day 2)
### Phase 2 - Sidebar (day 2)
Sidebar is the most isolated component — no complex interaction, just a list of channels + guild bar + user bar.
Sidebar is the most isolated component - no complex interaction, just a list of channels + guild bar + user bar.
```slint
// theme.slint
@ -104,7 +104,7 @@ fn sync_sidebar(window: &MainWindow, state: &UiState) {
---
### Phase 3 — Chat (days 3-4)
### Phase 3 - Chat (days 3-4)
The complex one: text messages, reactions, editing, typing indicators, reply chain, DMs, friends list.
@ -138,7 +138,7 @@ component ChatPanel {
---
### Phase 4 — Connect Screen (day 4)
### Phase 4 - Connect Screen (day 4)
```slint
component ConnectScreen {
@ -154,7 +154,7 @@ component ConnectScreen {
---
### Phase 5 — Settings + Polish (day 5)
### Phase 5 - Settings + Polish (day 5)
Settings dialog with tabs: Audio, Network, Identity, Appearance.
@ -214,10 +214,10 @@ The bridge pattern:
## What stays the same
- **`net/`** — all networking code, `NetHandle`, `NetCommand`, `NetEvent`
- **`audio/`** — capture/playback pipeline, Opus encode/decode, RNNoise
- **`identity.rs`**, **`identity_vault.rs`** — keypair management
- **`jitter/`** — jitter buffer (copied from voice-node)
- **`net/`** - all networking code, `NetHandle`, `NetCommand`, `NetEvent`
- **`audio/`** - capture/playback pipeline, Opus encode/decode, RNNoise
- **`identity.rs`**, **`identity_vault.rs`** - keypair management
- **`jitter/`** - jitter buffer (copied from voice-node)
---