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