From e9182fdb4156befc9dbb10e5ac3c0b1cb1853808 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Sun, 29 Mar 2026 16:07:03 +0400 Subject: [PATCH] =?UTF-8?q?v0.0.36:=20web=20call=20UI=20=E2=80=94=20call/a?= =?UTF-8?q?ccept/reject/hangup=20with=20signaling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Web client: - Call bar between header and messages (hidden when idle) - Call button appears when peer is set (not group) - Incoming call: pulsing notification + Accept/Reject buttons - Call states: idle → calling → ringing → active - /call, /accept, /reject, /hangup slash commands - CallSignal sent via WS binary frames (same as messages) - handleCallSignal processes Offer/Answer/Hangup/Reject/Ringing/Busy - Vibration on incoming call (mobile) - create_call_signal WASM import wired up Co-Authored-By: Claude Opus 4.6 (1M context) --- warzone/Cargo.lock | 10 +- warzone/Cargo.toml | 2 +- warzone/crates/warzone-protocol/Cargo.toml | 2 +- .../crates/warzone-server/src/routes/web.rs | 223 +++++++++++++++++- 4 files changed, 227 insertions(+), 10 deletions(-) diff --git a/warzone/Cargo.lock b/warzone/Cargo.lock index 75d31aa..81b0ffc 100644 --- a/warzone/Cargo.lock +++ b/warzone/Cargo.lock @@ -2956,7 +2956,7 @@ dependencies = [ [[package]] name = "warzone-client" -version = "0.0.35" +version = "0.0.36" dependencies = [ "anyhow", "argon2", @@ -2989,7 +2989,7 @@ dependencies = [ [[package]] name = "warzone-mule" -version = "0.0.35" +version = "0.0.36" dependencies = [ "anyhow", "clap", @@ -2998,7 +2998,7 @@ dependencies = [ [[package]] name = "warzone-protocol" -version = "0.0.35" +version = "0.0.36" dependencies = [ "base64", "bincode", @@ -3023,7 +3023,7 @@ dependencies = [ [[package]] name = "warzone-server" -version = "0.0.35" +version = "0.0.36" dependencies = [ "anyhow", "axum", @@ -3053,7 +3053,7 @@ dependencies = [ [[package]] name = "warzone-wasm" -version = "0.0.35" +version = "0.0.36" dependencies = [ "base64", "bincode", diff --git a/warzone/Cargo.toml b/warzone/Cargo.toml index ef6f039..a88a123 100644 --- a/warzone/Cargo.toml +++ b/warzone/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "0.0.35" +version = "0.0.36" edition = "2021" license = "MIT" rust-version = "1.75" diff --git a/warzone/crates/warzone-protocol/Cargo.toml b/warzone/crates/warzone-protocol/Cargo.toml index 9ebbc55..67a3aea 100644 --- a/warzone/crates/warzone-protocol/Cargo.toml +++ b/warzone/crates/warzone-protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "warzone-protocol" -version = "0.0.35" +version = "0.0.36" edition = "2021" license = "MIT" description = "Core crypto & wire protocol for featherChat (Warzone messenger)" diff --git a/warzone/crates/warzone-server/src/routes/web.rs b/warzone/crates/warzone-server/src/routes/web.rs index d2bb8c8..c1afbc2 100644 --- a/warzone/crates/warzone-server/src/routes/web.rs +++ b/warzone/crates/warzone-server/src/routes/web.rs @@ -50,7 +50,7 @@ async fn pwa_manifest() -> impl IntoResponse { async fn service_worker() -> impl IntoResponse { ([(header::CONTENT_TYPE, "application/javascript")], r##" -const CACHE = 'wz-v17'; +const CACHE = 'wz-v18'; const SHELL = ['/', '/wasm/warzone_wasm.js', '/wasm/warzone_wasm_bg.wasm', '/icon.svg', '/manifest.json']; self.addEventListener('install', e => { @@ -189,6 +189,21 @@ const WEB_HTML: &str = r##" .addr { color: #4fc3f7; cursor: pointer; text-decoration: underline; } .addr:hover { color: #81d4fa; } + /* Call UI */ + #call-bar { display: none; padding: 6px 10px; background: #1a0a2e; border-bottom: 1px solid #4a1a5c; + align-items: center; gap: 8px; font-size: 0.85em; } + #call-bar.active { display: flex; } + #call-bar .call-status { flex: 1; color: #ce93d8; } + .call-btn { padding: 4px 12px; border: none; border-radius: 4px; cursor: pointer; font-family: inherit; font-size: 0.8em; } + .call-btn-green { background: #2d5016; color: #4ade80; } + .call-btn-green:hover { background: #3d6020; } + .call-btn-red { background: #5c1a1a; color: #ff6b6b; } + .call-btn-red:hover { background: #6c2a2a; } + .call-btn-blue { background: #1a1a5c; color: #4fc3f7; } + .call-btn-blue:hover { background: #2a2a6c; } + .incoming-call { animation: pulse 1.5s infinite; } + @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } } + @media (max-width: 500px) { .msg { font-size: 0.8em; } #chat-header input { width: 180px; } @@ -230,6 +245,13 @@ const WEB_HTML: &str = r##" +
+ No active call + + + + +
@@ -239,7 +261,7 @@ const WEB_HTML: &str = r##"