ui: a call bar on the voice page, and a smaller stage for the chat

The desktop voice view gets mute, deafen, share, the voice settings and
Leave under the people and streams (VoiceButtons gains round and filled);
Voice Settings and Leave leave the header, which gets a Smaller stage /
Larger stage button. The smaller stage, one row of compact people and the
streams as rows, gives the chat about 200 px back and is stored as
ui.voice_compact. Windows under 800 px tall always use it: the larger
stage and the bar left no room for the chat or the composer there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
Claude committed 2026-10-08 04:57:53 +00:00
1 parent 923f119ff6
commit 26c7d9c97c
11 files changed
+165 -35

No files matched your search

+17 -3
View File
@@ -1,6 +1,7 @@
//! Appearance settings (`ui.theme`, `ui.font_scale`, `ui.narrow_breakpoint`,
//! `ui.image_cache_mb`): applied to the Theme and Nav globals and the image
//! cache whenever they change, from the settings page or elsewhere.
//! `ui.image_cache_mb`, `ui.members_width`, `ui.voice_compact`): applied to
//! the Theme and Nav globals and the image cache whenever they change, from
//! the settings page or elsewhere.
use slint::ComponentHandle;
use tracing::warn;
@@ -8,7 +9,8 @@ use tracing::warn;
use crate::app::{App, AppearanceForm, Bridge, Nav, Theme};
use crate::images;
use crate::settings::{
ThemeChoice, UI_FONT_SCALE, UI_IMAGE_CACHE_MB, UI_MEMBERS_WIDTH, UI_NARROW_BREAKPOINT, UI_THEME,
ThemeChoice, UI_FONT_SCALE, UI_IMAGE_CACHE_MB, UI_MEMBERS_WIDTH, UI_NARROW_BREAKPOINT,
UI_THEME, UI_VOICE_COMPACT,
};
impl App {
@@ -29,6 +31,7 @@ impl App {
if nav.get_right_panel_width() != width {
nav.set_right_panel_width(width);
}
nav.set_voice_compact(self.prefs.get(&UI_VOICE_COMPACT));
let bridge = ui.global::<Bridge>();
bridge.set_appearance(AppearanceForm {
theme: theme.as_str().into(),
@@ -71,4 +74,15 @@ impl App {
warn!(%e, "could not store the panel width");
}
}
/// The voice channel view's stage was made smaller or larger: store it
/// (`ui.voice_compact`), so it comes back the same.
pub(crate) fn voice_compact_changed(&mut self, compact: bool) {
if self.prefs.get(&UI_VOICE_COMPACT) == compact {
return;
}
if let Err(e) = self.prefs.set(&UI_VOICE_COMPACT, compact) {
warn!(%e, "could not store the stage size");
}
}
}
+3
View File
@@ -53,6 +53,9 @@ pub(super) fn wire(ui: &MainWindow) {
bridge.on_panel_resized(|width| {
with_app(|app| app.panel_resized(width));
});
bridge.on_voice_compact_changed(|compact| {
with_app(|app| app.voice_compact_changed(compact));
});
bridge.on_appearance_changed(|form| {
with_app(|app| app.appearance_changed(&form));
});
+9 -2
View File
@@ -18,7 +18,8 @@
//! `bookmark:edit` the current one, Advanced open),
//! `emoji` (the picker), `client` (the volume dialog of the first other
//! client once connected), `panel` / `no-panel` (the members panel),
//! `voice` (the voice channel view; on the phone its own screen),
//! `voice` (the voice channel view; on the phone its own screen;
//! `voice:compact` with the smaller stage, not stored),
//! `members` (the phone's members page), `notification` (a tapped voice
//! notification), `shared:<text>` (text shared to the app on Android),
//! `pins`, `topics` (the drawers),
@@ -268,7 +269,13 @@ pub(crate) fn start(ui: &MainWindow, switches: &Switches) -> Running {
"panel" => nav.set_right_panel_open(true),
"no-panel" => nav.set_right_panel_open(false),
"tab" => nav.set_mobile_tab(mobile_tab(arg)),
"voice" => nav.invoke_show_voice(true),
"voice" => {
nav.invoke_show_voice(true);
// The smaller stage, for this run only.
if arg == "compact" {
nav.set_voice_compact(true);
}
}
"pins" => nav.invoke_show_pins(true),
// The phone's members page.
"members" => nav.set_members_open(true),
+30 -2
View File
@@ -100,9 +100,25 @@ pub static UI_MEMBERS_WIDTH: Key<u32> = Key::new(
|| 280,
);
/// `ui.voice_compact`: the voice channel view's smaller stage (a strip of
/// people and stream rows, more room for the chat). Its toggle stores it.
pub static UI_VOICE_COMPACT: Key<bool> = Key::new(
"ui.voice_compact",
Kind::Bool,
"The voice channel view's smaller stage, leaving more room for the chat.",
|| false,
);
/// The UI's keys besides [`UI`] and [`CLIENT_PLAYBACK`], for registering.
pub fn appearance_keys() -> [&'static dyn voelin_core::settings::Setting; 5] {
[&UI_THEME, &UI_FONT_SCALE, &UI_NARROW_BREAKPOINT, &UI_IMAGE_CACHE_MB, &UI_MEMBERS_WIDTH]
pub fn appearance_keys() -> [&'static dyn voelin_core::settings::Setting; 6] {
[
&UI_THEME,
&UI_FONT_SCALE,
&UI_NARROW_BREAKPOINT,
&UI_IMAGE_CACHE_MB,
&UI_MEMBERS_WIDTH,
&UI_VOICE_COMPACT,
]
}
/// What a kind of notification does: nothing, the bell, or the bell and a
@@ -533,6 +549,18 @@ mod tests {
assert_eq!(NotifyLevel::from_index(7), NotifyLevel::Desktop);
}
#[test]
fn voice_compact_key() {
let settings = voelin_core::settings::Settings::in_memory();
for key in appearance_keys() {
settings.register(key);
}
assert_eq!(settings.get_json("ui.voice_compact"), Some(false.into()), "the full stage");
assert!(settings.apply_overrides(["ui.voice_compact=true"]).is_empty());
assert!(settings.get(&UI_VOICE_COMPACT));
assert!(settings.set_json("ui.voice_compact", "small".into()).is_err());
}
#[test]
fn ui_settings_defaults() {
let parsed: UiSettings = serde_json::from_str(r#"{"openh264":true}"#).unwrap();