practicode
Advanced tools
+1
-1
@@ -456,3 +456,3 @@ # This file is automatically @generated by Cargo. | ||
| name = "practicode" | ||
| version = "0.1.13" | ||
| version = "0.1.14" | ||
| dependencies = [ | ||
@@ -459,0 +459,0 @@ "anyhow", |
+1
-1
| [package] | ||
| name = "practicode" | ||
| version = "0.1.13" | ||
| version = "0.1.14" | ||
| edition = "2024" | ||
@@ -5,0 +5,0 @@ description = "Local-first coding-test practice in a Rust terminal UI with optional AI help." |
+1
-1
| { | ||
| "name": "practicode", | ||
| "version": "0.1.13", | ||
| "version": "0.1.14", | ||
| "description": "Local-first coding-test practice in a Rust terminal UI with optional AI help.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+27
-1
| use super::*; | ||
| const UPDATE_CHECKING_TEXT: &str = "Checking for updates..."; | ||
| impl PracticodeApp { | ||
@@ -85,2 +87,3 @@ pub(super) fn start_ai_prompt(&mut self, prompt: &str) -> Result<()> { | ||
| let result = self.update_rx.as_ref().and_then(|rx| rx.try_recv().ok()); | ||
| let showing_update_check = self.output == UPDATE_CHECKING_TEXT; | ||
| if let Some(result) = result { | ||
@@ -94,2 +97,5 @@ self.update_rx = None; | ||
| } | ||
| if showing_update_check { | ||
| self.show_update_notice(); | ||
| } | ||
| } | ||
@@ -292,3 +298,3 @@ } | ||
| } else if self.update_rx.is_some() { | ||
| self.write_text_output("Checking for updates..."); | ||
| self.write_text_output(UPDATE_CHECKING_TEXT); | ||
| } else if matches!(self.update_check, Some(UpdateCheck::Disabled)) { | ||
@@ -319,1 +325,21 @@ self.write_text_output(ui_text(&lang, "update_check_disabled")); | ||
| } | ||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
| #[test] | ||
| fn update_check_refreshes_visible_checking_notice() { | ||
| let root = crate::process::unique_temp_path("practicode-update-test", "dir"); | ||
| std::fs::create_dir_all(&root).unwrap(); | ||
| let mut app = PracticodeApp::new(root).unwrap(); | ||
| let (tx, rx) = std::sync::mpsc::channel(); | ||
| tx.send(UpdateCheck::Disabled).unwrap(); | ||
| app.update_rx = Some(rx); | ||
| app.write_text_output(UPDATE_CHECKING_TEXT); | ||
| app.check_update(); | ||
| assert_eq!(app.output, ui_text("en", "update_check_disabled")); | ||
| } | ||
| } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
1185911
0.07%0
-100%