feat(proto): ConfigView wire type

This commit is contained in:
2026-06-14 09:21:22 +07:00
parent 80113da066
commit e990e694b5
2 changed files with 27 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
use serde::{Deserialize, Serialize};
/// Effective (resolved) daemon configuration sent to clients.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigView {
pub default_shell: String,
pub font_family: String,
pub font_size: u16,
pub theme: String,
pub accent: String,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn config_view_round_trips() {
let c = ConfigView {
default_shell: "/bin/zsh".into(), font_family: "JetBrains Mono".into(),
font_size: 13, theme: "dark".into(), accent: "blue".into(),
};
let back: ConfigView = serde_json::from_str(&serde_json::to_string(&c).unwrap()).unwrap();
assert_eq!(back, c);
}
}
+2
View File
@@ -1,4 +1,5 @@
pub mod codec;
pub mod config_view;
pub mod event;
pub mod ids;
pub mod layout;
@@ -6,6 +7,7 @@ pub mod message;
pub mod status;
pub mod workspace;
pub use config_view::ConfigView;
pub use event::{EventKind, EventRecord, MarkReadTarget};
pub use ids::{GroupId, SurfaceId, WorkspaceId};
pub use layout::{LayoutNode, Orient};