diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-01 15:48:22 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-01 15:48:22 +0300 |
| commit | 207be3c771d281baae6e5fa0fb74be9a056e97a2 (patch) | |
| tree | d7b037ecdf629224a048c841d11659efdc23507d /src/app/config_io.rs | |
| parent | 8a6d697308162874a236c84aac0b0f8c7ac01f83 (diff) | |
refactor: render the shell in the client (#3487)
* feat: add opt-in client-rendered shell
* feat: add client-owned shell mouse controls
* feat: complete client-owned shell chrome
* feat: add client-owned shell settings and notifications
* feat: run client shell custom commands
* feat: render popup terminals in client shell
* feat: add client-owned scrollback and copy mode
* fix: preserve client worktree trust defaults
* feat: render startup diagnostics in client shell
* feat: render onboarding in client shell
* feat: render product announcements in client shell
* feat: render release notes in client shell
* feat: render mobile switcher in client shell
* feat: render kitty graphics in client shell
* fix: preserve client shell lifecycle coherence
* refactor: route client shell commands through endpoint connections
* refactor: make the client-rendered shell the default
* refactor: remove monolithic launch mode
* refactor: complete client-rendered shell cutover
* perf: retain client pane surface updates
* perf: scale retained pane surface updates
* perf: remove remote pane input latency
* test: make client shell checks platform-independent
* fix: prevent client timer starvation
* test: fix client shell platform gates
* test: accept retained surfaces in cross-area checks
* test: make client mode assertions platform-neutral
* fix: badge only outdated integrations
Diffstat (limited to 'src/app/config_io.rs')
| -rw-r--r-- | src/app/config_io.rs | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/src/app/config_io.rs b/src/app/config_io.rs deleted file mode 100644 index 9f7445b9..00000000 --- a/src/app/config_io.rs +++ /dev/null @@ -1,128 +0,0 @@ -use super::App; - -impl App { - pub(super) fn update_config_file<F>(&mut self, error_context: &str, update: F) -> bool - where - F: FnOnce(&str) -> String, - { - #[cfg(test)] - if std::env::var_os(crate::config::CONFIG_PATH_ENV_VAR).is_none() { - return false; - } - - let path = crate::config::config_path(); - if let Some(parent) = path.parent() { - if let Err(err) = std::fs::create_dir_all(parent) { - crate::logging::config_write_failed(&path, error_context, &err.to_string()); - self.state.config_diagnostic = - Some(format!("failed to save {error_context}: {err}")); - self.config_diagnostic_deadline = - Some(std::time::Instant::now() + std::time::Duration::from_secs(5)); - return false; - } - } - - let content = std::fs::read_to_string(&path).unwrap_or_default(); - let new_content = update(&content); - if let Err(err) = std::fs::write(&path, new_content) { - crate::logging::config_write_failed(&path, error_context, &err.to_string()); - self.state.config_diagnostic = Some(format!("failed to save {error_context}: {err}")); - self.config_diagnostic_deadline = - Some(std::time::Instant::now() + std::time::Duration::from_secs(5)); - return false; - } - - true - } - - pub(super) fn mark_onboarding_complete(&mut self) { - self.update_config_file("onboarding setting", |content| { - crate::config::upsert_top_level_bool(content, "onboarding", false) - }); - } - - pub(super) fn save_theme(&mut self, name: &str) { - if self.update_config_file("theme", |content| { - let content = crate::config::upsert_section_value( - content, - "theme", - "name", - &format!("\"{name}\""), - ); - crate::config::upsert_section_bool(&content, "theme", "auto_switch", false) - }) { - self.apply_config_from_disk(false); - } - } - - pub(super) fn save_status_indicators(&mut self, style: crate::config::StatusIndicatorStyle) { - if self.update_config_file("status indicators", |content| { - crate::config::upsert_section_value( - content, - "ui", - "status_indicators", - &format!("\"{}\"", style.as_str()), - ) - }) { - self.apply_config_from_disk(false); - } - } - - pub(super) fn save_sound(&mut self, enabled: bool) { - if self.update_config_file("sound setting", |content| { - crate::config::upsert_section_bool(content, "ui.sound", "enabled", enabled) - }) { - self.apply_config_from_disk(false); - } - } - - pub(super) fn save_toast_delivery(&mut self, delivery: crate::config::ToastDelivery) { - let value = match delivery { - crate::config::ToastDelivery::Off => "\"off\"", - crate::config::ToastDelivery::Herdr => "\"herdr\"", - crate::config::ToastDelivery::Terminal => "\"terminal\"", - crate::config::ToastDelivery::System => "\"system\"", - }; - if self.update_config_file("toast setting", |content| { - let content = - crate::config::upsert_section_value(content, "ui.toast", "delivery", value); - crate::config::remove_section_key(&content, "ui.toast", "enabled") - }) { - self.apply_config_from_disk(false); - } - } - - pub(super) fn save_agent_border_labels(&mut self, enabled: bool) { - if self.update_config_file("agent border labels", |content| { - crate::config::upsert_section_bool( - content, - "ui", - "show_agent_labels_on_pane_borders", - enabled, - ) - }) { - self.apply_config_from_disk(false); - } - } - - pub(super) fn save_agent_panel_sort(&mut self, sort: crate::app::state::AgentPanelSort) { - let value = match sort { - crate::app::state::AgentPanelSort::Spaces => { - crate::config::AgentPanelSortConfig::Spaces.as_str() - } - crate::app::state::AgentPanelSort::Priority => { - crate::config::AgentPanelSortConfig::Priority.as_str() - } - }; - if self.update_config_file("agent panel sort", |content| { - crate::config::upsert_section_value( - content, - "ui", - "agent_panel_sort", - &format!("\"{value}\""), - ) - }) { - self.apply_config_from_disk(false); - } - } -} |
