@ondeinference / cli / commits / 6189909

Refactor match arms and artifact sorting for clarity

keypair34 committed Apr 23, 2026 at 06:49 UTC 618990904aeadea7f27f8449168e9d2bdac8640f
2 files changed +9 -9
src/app.rs
+8 -8
@@ -1126,10 +1126,10 @@ fn handle_key_model_detail(
1126 (Up, _) | (Char('k'), KeyModifiers::NONE) => {
1127 app.adapter_cursor = app.adapter_cursor.saturating_sub(1);
1128 }
1129 - (Down, _) | (Char('j'), KeyModifiers::NONE) => {
1130 - if !app.adapter_list.is_empty() && app.adapter_cursor + 1 < app.adapter_list.len() {
1131 - app.adapter_cursor += 1;
1132 - }
1129 + (Down, _) | (Char('j'), KeyModifiers::NONE)
1130 + if !app.adapter_list.is_empty() && app.adapter_cursor + 1 < app.adapter_list.len() =>
1131 + {
1132 + app.adapter_cursor += 1;
1133 }
1134 // Enter on a GGUF artifact — open GGUF detail screen
1135 (Enter, _)
@@ -1769,10 +1769,10 @@ fn handle_key_clone_repo(
1769 (Up, _) | (Char('k'), KeyModifiers::NONE) => {
1770 app.clone_base_cursor = app.clone_base_cursor.saturating_sub(1);
1771 }
1772 - (Down, _) | (Char('j'), KeyModifiers::NONE) => {
1773 - if app.clone_base_cursor + 1 < crate::hf_clone::BASE_MODELS.len() {
1774 - app.clone_base_cursor += 1;
1775 - }
1772 + (Down, _) | (Char('j'), KeyModifiers::NONE)
1773 + if app.clone_base_cursor + 1 < crate::hf_clone::BASE_MODELS.len() =>
1774 + {
1775 + app.clone_base_cursor += 1;
1776 }
1777 (Enter, _) => {
1778 // User selected a base model — download it then go to fine-tune
src/project.rs
+1 -1
@@ -241,7 +241,7 @@ pub fn scan_project_artifacts(project: &OndeProject) -> Vec<ProjectArtifact> {
241 }
242
243 // Newest first
244 - artifacts.sort_by(|a, b| b.modified_ts.cmp(&a.modified_ts));
244 + artifacts.sort_by_key(|a| std::cmp::Reverse(a.modified_ts));
245 artifacts
246 }
247