added counter for pending diff files
Dependencies
- [2]
BD456SZFadded diff view - [3]
F6YAQWVDadded UI for `pijul change` - [*]
NSE6BLWAinit slint project from https://github.com/slint-ui/slint-rust-template - [*]
I4NM4O3Zmake changelog elements interactable - [*]
XERTHGSYconsolidated `pijul log` UI elements into their own component - [*]
NCRTU7M4cargo init - [*]
4RPYR65Cconnect GUI to pijul to display simple channel list
Change contents
- edit in ui/app-window.slint at line 34
in property <int> files-count; - replacement in ui/app-window.slint at line 38
text: "active diff";text: "\{files-count} files changed"; - edit in ui/app-window.slint at line 105
in-out property <int> count-files-changed; - edit in ui/app-window.slint at line 120
files-count: count-files-changed; - edit in ui/app-window.slint at line 240
in-out property <int> count-files-changed <=> log.count-files-changed; - edit in ui/app-window.slint at line 245
callback request-diff-summary(string); - edit in ui/app-window.slint at line 249
root.request-diff-summary(chs.channels[chs.selected]); - replacement in src/main.rs at line 119
ui.on_request_diff_delta({ui.on_request_diff_summary({ - edit in src/main.rs at line 144
}});ui.on_request_diff_delta({let ui_handle = ui.as_weak();move |ch_name: SharedString| {let ch_name = ch_name.as_str();let ui = ui_handle.unwrap();let exe_path_string = ui.get_exe_path();let exe_path = Path::new(exe_path_string.as_str());let repo_path_string = ui.get_repo_path();let repo_path = Path::new(repo_path_string.as_str());let diff_output = cmds::diff_short(exe_path,repo_path,Some(ch_name).filter(|cn| !cn.is_empty()),);let file_changes = match diff_output {Ok(delta) => delta,Err(e) => {println!("{:?}", e);return;}};ui.set_count_files_changed(i32::try_from(file_changes.len()).unwrap_or(-1)); - edit in src/cmds.rs at line 85[3.2563][9.1342]
}pub fn diff_short(exe: &std::path::Path,repo: &std::path::Path,ch_name_maybe: Option<&str>,) -> Result<serde_json::Map<String, serde_json::Value>, Error> {let mut cmd = Command::new(exe);let cmd = cmd.arg("diff").arg("--no-prompt").arg("--repository").arg(repo).arg("--short").arg("--json");if let Some(ch_name) = ch_name_maybe {cmd.arg("--channel").arg(ch_name);}let output = cmd.output()?;check_exit_status(cmd, output.status)?;// TODO this will fail when diffing binary dataOk(serde_json::from_slice(&output.stdout)?)