From 8650cdbd82f906bab5a605c656781ff9f72b75fa Mon Sep 17 00:00:00 2001 From: Joe Date: Sat, 24 Jan 2026 05:12:46 -0600 Subject: [PATCH] Update button layout order in ConfirmingPage and enhance error handling in change processor - Changed the layout order of the reject button in the ConfirmingPage to improve UI consistency. - Added error handling for file operations in the change processor, logging errors when file removal or writing fails, enhancing robustness and debuggability. --- plugin/src/App/StatusPages/Confirming.lua | 2 +- src/change_processor.rs | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/plugin/src/App/StatusPages/Confirming.lua b/plugin/src/App/StatusPages/Confirming.lua index 3ce6d5b8..1535f045 100644 --- a/plugin/src/App/StatusPages/Confirming.lua +++ b/plugin/src/App/StatusPages/Confirming.lua @@ -95,7 +95,7 @@ function ConfirmingPage:render() text = "Reject", style = "Warning", transparency = self.props.transparency, - layoutOrder = 2, + layoutOrder = 0, onClick = function() self:setState({ showingRejectConfirm = true }) end, diff --git a/src/change_processor.rs b/src/change_processor.rs index 6c5c8224..d8894523 100644 --- a/src/change_processor.rs +++ b/src/change_processor.rs @@ -200,7 +200,16 @@ impl JobThreadContext { if let Some(instance) = tree.get_instance(id) { if let Some(instigating_source) = &instance.metadata().instigating_source { match instigating_source { - InstigatingSource::Path(path) => fs::remove_file(path).unwrap(), + InstigatingSource::Path(path) => { + if let Err(err) = fs::remove_file(path) { + log::error!( + "Failed to remove file {:?} for instance {:?}: {}", + path, + id, + err + ); + } + } InstigatingSource::ProjectNode { .. } => { log::warn!( "Cannot remove instance {:?}, it's from a project file", @@ -244,14 +253,21 @@ impl JobThreadContext { match instigating_source { InstigatingSource::Path(path) => { if let Some(Variant::String(value)) = changed_value { - fs::write(path, value).unwrap(); + if let Err(err) = fs::write(path, value) { + log::error!( + "Failed to write Source to {:?} for instance {:?}: {}", + path, + id, + err + ); + } } else { log::warn!("Cannot change Source to non-string value."); } } InstigatingSource::ProjectNode { .. } => { log::warn!( - "Cannot remove instance {:?}, it's from a project file", + "Cannot update instance {:?}, it's from a project file", id ); }