Adapt mesh views to phone rotation and toggle the exit from Quick Settings

Use the available width for the Android device table, keeping individual
peers expandable and their full details reachable in both orientations.
Show network selection and settings side by side in landscape and reuse
the VIP editor with a compact toolbar and width-aware backend columns.
Retain the selected network, expanded peer, traffic unit and VIP draft
across rotation.

Show data-channel readiness consistently in the tray and on Android.
Distinguish an establishing channel, a disabled data plane, an offline
peer and a transport failure. Use an animated arc for visible waiting
peers. Explain Phosphor controls on hover, focus and long press, and
provide a masked-by-default reveal button in the shared secret field.

Store the last confirmed exit network and endpoint in Android's private
preferences. A Quick Settings tap disconnects that selection or restores
the exact peer through the existing agent. First use opens the chooser.
On a cold start, wait for an authenticated exit offer outside the command
loop. Check the current selection again before changing the route. Only
changed exit offers wake roster subscribers. Wire formats, software
version and mesh identity storage remain compatible.

On macOS arm64, cargo fmt and strict workspace Clippy passed. The locked
workspace suite passed 598 tests with four opt-in tests ignored. Built the
tray, the ARM64 debug APK and its test APK. All three instrumentation tests
passed on an Android API 37 emulator. Opened the chooser from the actual
Quick Settings tile, rotated the activity and inspected rendered device
lists with ready, waiting, failed and offline peers. Physical phones and
native Linux and Windows builds were not exercised.
This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-25 15:38:10 +02:00
1 parent 50c0ecea45
commit e3e6089d0b
29 files changed
+1688 -324

No files matched your search

+4 -3
View File
@@ -26,8 +26,9 @@ mod status;
pub use events::Event;
pub use status::{
AgentStatus, CandidateStatus, DataPath, HostnameConflict, MemberStatus, NetworkMetrics,
NetworkState, NetworkStatus, OverlayStatus, PeerStatus, RangeConflict,
AgentStatus, CandidateStatus, DATA_CONNECTING, DATA_DISABLED, DataPath, HostnameConflict,
MemberStatus, NetworkMetrics, NetworkState, NetworkStatus, OverlayStatus, PeerStatus,
RangeConflict,
};
use std::collections::HashMap;
@@ -709,7 +710,7 @@ impl Agent {
self.inner.events.subscribe()
}
/// Subscribe to changes affecting the mesh DNS roster or selected exit.
/// Subscribe to changes affecting the mesh DNS roster, exit offers or selected exit.
/// Changes coalesce. Read the current status after subscribing and again on
/// notification. Packet counters and routine control traffic do not wake subscribers.
pub fn watch_roster(&self) -> watch::Receiver<()> {
+11 -3
View File
@@ -2990,7 +2990,10 @@ impl Runtime {
.agent_version
.clone_from(&announcement.agent_version);
session.broadcast = announcement.broadcast;
session.exit_node = announcement.exit_node;
if session.exit_node != announcement.exit_node {
session.exit_node = announcement.exit_node;
self.params.roster_changed.send_replace(());
}
session.capabilities = capabilities.clone();
}
self.remember_hostname(peer, &announcement.hostname);
@@ -3178,7 +3181,12 @@ impl Runtime {
fn data_error(&self, session: &Session) -> Option<String> {
if self.params.carriers.is_empty() {
return Some("data transports disabled locally".into());
return Some(super::DATA_DISABLED.into());
}
// Capabilities arrive in the first authenticated announcement, after
// the session is already visible in status.
if session.hostname.is_none() {
return Some(super::DATA_CONNECTING.into());
}
if self.params.tunnel.is_some() && self.tunnel_protocol(session).is_none() {
return Some(
@@ -3226,7 +3234,7 @@ impl Runtime {
self.data_errors
.get(&session.peer)
.cloned()
.or_else(|| Some("establishing external data transport".into()))
.or_else(|| Some(super::DATA_CONNECTING.into()))
}
fn status(&self) -> NetworkStatus {
+5
View File
@@ -16,6 +16,11 @@ use crate::net::{ConnectionCounters, PathAddr, PathInfo, TransportKind};
use crate::proto::handshake::Role;
use crate::storage::CacheOutcome;
/// Informational data-channel diagnostics shared by the status UI and runtime.
pub const DATA_CONNECTING: &str = "establishing external data transport";
/// Data transport was disabled by local policy.
pub const DATA_DISABLED: &str = "data transports disabled locally";
/// Whether a configured network is running locally.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum NetworkState {