From 911255fece030ee1d7cc69da3f996457fb90797e Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Wed, 3 Jun 2026 20:38:44 -0700 Subject: [PATCH] =?UTF-8?q?style:=20cargo=20fmt=20=E2=80=94=20normalize=20?= =?UTF-8?q?earlier=20hand-committed=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run rustfmt over files landed in earlier commits this session that weren't fmt-checked (heph-quickadd, the heph-tui undo/move wave, the hephd quickadd supervisor). Pure formatting (struct/if-else expansion, line wrapping); no behavior change. Restores `cargo fmt --check` clean for CI. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/heph-quickadd/src/app.rs | 40 +++++++++++++++++++---------- crates/heph-quickadd/src/main.rs | 5 +++- crates/heph-tui/src/app.rs | 15 ++++++++--- crates/heph-tui/src/ui.rs | 3 +-- crates/heph-tui/tests/navigation.rs | 5 +++- crates/hephd/src/main.rs | 4 ++- 6 files changed, 50 insertions(+), 22 deletions(-) diff --git a/crates/heph-quickadd/src/app.rs b/crates/heph-quickadd/src/app.rs index 7bae5d5..b08bf03 100644 --- a/crates/heph-quickadd/src/app.rs +++ b/crates/heph-quickadd/src/app.rs @@ -111,7 +111,10 @@ fn today_local() -> NaiveDate { enum SaveOutcome { Ok, /// The RPC failed — re-show with this text restored and the error shown. - Err { text: String, message: String }, + Err { + text: String, + message: String, + }, } pub struct QuickAdd { @@ -171,7 +174,11 @@ impl QuickAdd { } // Baseline parent pid for orphan detection (macOS supervision only). - let orphan_parent = if supervised { current_parent_pid() } else { None }; + let orphan_parent = if supervised { + current_parent_pid() + } else { + None + }; let (projects_tx, projects_rx) = std::sync::mpsc::channel(); let (save_tx, save_rx) = std::sync::mpsc::channel(); @@ -393,8 +400,7 @@ impl QuickAdd { // Enter always submits — the autocomplete (Tab/↑/↓/click) never // hijacks it, so the muscle-reflex save stays sacred. - let submitted = - resp.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)); + let submitted = resp.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)); // When not autocompleting, the lower area is the live chip preview. if rows == 0 { @@ -425,7 +431,9 @@ impl QuickAdd { BASE_H }; if (target_h - self.win_h_applied).abs() > 0.5 { - ctx.send_viewport_cmd(egui::ViewportCommand::InnerSize(egui::vec2(WIN_W, target_h))); + ctx.send_viewport_cmd(egui::ViewportCommand::InnerSize(egui::vec2( + WIN_W, target_h, + ))); self.win_h_applied = target_h; } } @@ -501,11 +509,7 @@ impl QuickAdd { let selected = i == self.ac_selected; let text = egui::RichText::new(format!("📁 {title}")) .size(LABEL_SIZE) - .color(if selected { - egui::Color32::WHITE - } else { - DIM - }); + .color(if selected { egui::Color32::WHITE } else { DIM }); if ui.selectable_label(selected, text).clicked() { accept = Some(title.clone()); } @@ -514,9 +518,11 @@ impl QuickAdd { if let Some(title) = accept { apply_completion(&mut self.text, hash_idx, query.chars().count(), &title); let new_idx = hash_idx + 1 + title.chars().count() + 1; - if let Some(mut st) = egui::widgets::text_edit::TextEditState::load(ui.ctx(), field_id) { + if let Some(mut st) = egui::widgets::text_edit::TextEditState::load(ui.ctx(), field_id) + { let cc = egui::text::CCursor::new(new_idx); - st.cursor.set_char_range(Some(egui::text::CCursorRange::one(cc))); + st.cursor + .set_char_range(Some(egui::text::CCursorRange::one(cc))); st.store(ui.ctx(), field_id); } ui.ctx().memory_mut(|m| m.request_focus(field_id)); @@ -535,7 +541,9 @@ impl QuickAdd { if let Some(att) = parsed.attention { let (label, color) = match att { - heph_core::Attention::Red => ("⚑ red", egui::Color32::from_rgb(0xe0, 0x6c, 0x60)), + heph_core::Attention::Red => { + ("⚑ red", egui::Color32::from_rgb(0xe0, 0x6c, 0x60)) + } heph_core::Attention::Orange => { ("⚑ orange", egui::Color32::from_rgb(0xe5, 0xc0, 0x7b)) } @@ -555,7 +563,11 @@ impl QuickAdd { .find(|p| &p.id == id) .map(|p| p.title.as_str()) .unwrap_or("project"); - ui.label(egui::RichText::new(format!("📁 {title}")).color(dim).size(LABEL_SIZE)); + ui.label( + egui::RichText::new(format!("📁 {title}")) + .color(dim) + .size(LABEL_SIZE), + ); any = true; } diff --git a/crates/heph-quickadd/src/main.rs b/crates/heph-quickadd/src/main.rs index 0c76f98..2e70b81 100644 --- a/crates/heph-quickadd/src/main.rs +++ b/crates/heph-quickadd/src/main.rs @@ -19,7 +19,10 @@ use eframe::egui; use app::QuickAdd; #[derive(Parser, Debug)] -#[command(name = "heph-quickadd", about = "Global quick-capture popover for hephaestus")] +#[command( + name = "heph-quickadd", + about = "Global quick-capture popover for hephaestus" +)] struct Cli { /// hephd socket to talk to (defaults to $HEPH_SOCKET or the standard path). #[arg(long, global = true)] diff --git a/crates/heph-tui/src/app.rs b/crates/heph-tui/src/app.rs index 38bd38d..2a89cdd 100644 --- a/crates/heph-tui/src/app.rs +++ b/crates/heph-tui/src/app.rs @@ -252,8 +252,15 @@ impl MoveState { }); } } - if !f.is_empty() && !self.projects.iter().any(|p| p.title.eq_ignore_ascii_case(f)) { - opts.push(MoveOption::Create { name: f.to_string() }); + if !f.is_empty() + && !self + .projects + .iter() + .any(|p| p.title.eq_ignore_ascii_case(f)) + { + opts.push(MoveOption::Create { + name: f.to_string(), + }); } self.options = opts; self.cursor = self.cursor.min(self.options.len().saturating_sub(1)); @@ -886,7 +893,9 @@ impl App { .as_ref() .and_then(|sel| self.sidebar.iter().position(|e| e == sel)) .unwrap_or_else(|| { - let idx = self.sidebar_cursor.min(self.sidebar.len().saturating_sub(1)); + let idx = self + .sidebar_cursor + .min(self.sidebar.len().saturating_sub(1)); (0..=idx) .rev() .find(|&i| self.sidebar[i].selectable()) diff --git a/crates/heph-tui/src/ui.rs b/crates/heph-tui/src/ui.rs index 75f669b..23305c6 100644 --- a/crates/heph-tui/src/ui.rs +++ b/crates/heph-tui/src/ui.rs @@ -75,8 +75,7 @@ fn render_move(frame: &mut Frame, state: &MoveState) { height, }; frame.render_widget(Clear, popup); - let chunks = - Layout::vertical([Constraint::Length(3), Constraint::Min(1)]).split(popup); + let chunks = Layout::vertical([Constraint::Length(3), Constraint::Min(1)]).split(popup); // Filter input (with the task being moved in the title). let input = Paragraph::new(Line::from(vec![ diff --git a/crates/heph-tui/tests/navigation.rs b/crates/heph-tui/tests/navigation.rs index 6b79fd2..1d1e7b5 100644 --- a/crates/heph-tui/tests/navigation.rs +++ b/crates/heph-tui/tests/navigation.rs @@ -446,7 +446,10 @@ fn undo_restores_a_dropped_task_and_redo_redrops_it() { app.undo(); // restores it to outstanding { let states = rec.borrow(); - assert_eq!(states.states.first().unwrap(), &("t1".into(), "dropped".into())); + assert_eq!( + states.states.first().unwrap(), + &("t1".into(), "dropped".into()) + ); assert_eq!( states.states.last().unwrap(), &("t1".into(), "outstanding".into()), diff --git a/crates/hephd/src/main.rs b/crates/hephd/src/main.rs index e6275fd..ee07cf6 100644 --- a/crates/hephd/src/main.rs +++ b/crates/hephd/src/main.rs @@ -229,7 +229,9 @@ fn spawn_quickadd_supervisor(socket: PathBuf) { use std::process::Command; let Some(exe) = locate_quickadd_binary() else { - tracing::warn!("HEPH_QUICKADD=1 but `heph-quickadd` was not found next to hephd or on PATH"); + tracing::warn!( + "HEPH_QUICKADD=1 but `heph-quickadd` was not found next to hephd or on PATH" + ); return; };