From 5805ebbb8a8b74805ebaa4f4140617d017ae7bb2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 15:04:05 +0000 Subject: [PATCH] wip: tsc-ui settings tabs and About via TSC_OPEN Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G --- crates/tsc-ui/src/app.rs | 12 +++++++++--- crates/tsc-ui/ui/app.slint | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/tsc-ui/src/app.rs b/crates/tsc-ui/src/app.rs index a0d90f0..1628efa 100644 --- a/crates/tsc-ui/src/app.rs +++ b/crates/tsc-ui/src/app.rs @@ -196,8 +196,8 @@ pub fn run(options: RunOptions) -> Result<()> { // TSC_AUTOCONNECT=voice|observe connects the first bookmark on start, // TSC_SCREENSHOT= saves the window after TSC_SCREENSHOT_DELAY seconds and exits, // TSC_DEMO_STREAM=1 shows a local test stream in the viewer, - // TSC_OPEN=share|settings opens that dialog on start, TSC_AUTOWATCH=1 watches the - // first stream that shows up. + // TSC_OPEN=share|settings[:]|about opens that on start, TSC_AUTOWATCH=1 + // watches the first stream that shows up. let dir: PathBuf = match (options.data_dir, std::env::var_os("TSC_DATA_DIR")) { (Some(dir), _) => dir, (None, Some(dir)) => dir.into(), @@ -309,8 +309,14 @@ pub fn run(options: RunOptions) -> Result<()> { } match std::env::var("TSC_OPEN").as_deref() { Ok("share") => ui.invoke_open_share_dialog(), - Ok("settings") => { + Ok("about") => { + with_app(|app| app.load_notices()); + ui.set_show_about(true); + } + Ok(open) if open.starts_with("settings") => { with_app(|app| app.open_settings()); + let tab = open.strip_prefix("settings:").and_then(|t| t.parse().ok()); + ui.set_settings_tab(tab.unwrap_or(0)); ui.set_settings_open(true); } _ => {} diff --git a/crates/tsc-ui/ui/app.slint b/crates/tsc-ui/ui/app.slint index 51a26a9..962f998 100644 --- a/crates/tsc-ui/ui/app.slint +++ b/crates/tsc-ui/ui/app.slint @@ -1010,6 +1010,7 @@ component LevelMeter inherits Rectangle { } component SettingsDialog inherits Dialog { + in-out property tab; callback done(); card-width: 640px; card-height: 660px; @@ -1022,6 +1023,7 @@ component SettingsDialog inherits Dialog { } TabWidget { vertical-stretch: 1; + current-index <=> tab; Tab { title: @tr("Audio"); ScrollView { @@ -1454,7 +1456,8 @@ export component MainWindow inherits Window { default-font-size: 13px; property editing: false; - property show-about: false; + in-out property show-about: false; + in-out property settings-tab: 0; in-out property sharing-dialog: false; in-out property settings-open: false; property client-open: false; @@ -1668,6 +1671,7 @@ export component MainWindow inherits Window { } if settings-open: SettingsDialog { + tab <=> settings-tab; done => { settings-open = false; Bridge.close-settings();