Files
zesdex/src/app/state/diff.rs
T
asepharyana cc03bd79b6 Implement chat and markdown views, enhance status bar, and add workflow panel
- Added `chat.rs` for rendering chat messages with timestamps and roles.
- Introduced `markdown.rs` for rendering markdown content with styling.
- Created `status.rs` to display the application status bar with session and message counts.
- Developed `workflow.rs` to show the current workflow status, including tool calls and active jobs.
- Established a `theme.rs` for centralized color management across the UI.
- Updated `mod.rs` to include new modules and manage rendering logic.
2026-07-11 13:16:10 +07:00

41 lines
857 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StateDiff {
changes: Vec<Change>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Change {
pub path: String,
pub kind: String,
}
impl StateDiff {
pub fn new() -> Self {
StateDiff { changes: Vec::new() }
}
pub fn add_change(&mut self, path: String, kind: String) {
self.changes.push(Change { path, kind });
}
pub fn is_empty(&self) -> bool {
self.changes.is_empty()
}
pub fn clear(&mut self) {
self.changes.clear();
}
}
pub fn compute_diff(before: &serde_json::Value, after: &serde_json::Value) -> Vec<Change> {
if before == after {
return Vec::new();
}
vec![Change {
path: ".".to_string(),
kind: "modified".to_string(),
}]
}