From 37f77139384157eebc9aeef2257182a333021ea1 Mon Sep 17 00:00:00 2001 From: FallenSigh Date: Mon, 22 Jun 2026 15:42:05 +0800 Subject: [PATCH] feat(gui): add 'Show sent data' toggle in send panel Add checkbox to control whether sent text/hex appears in the console/hex view. Default enabled (current behavior). Log-to-file is unaffected. --- crates/pipeview-gui/src/app.rs | 1 + crates/pipeview-gui/src/models.rs | 1 + crates/pipeview-gui/src/panels/send_panel.rs | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/pipeview-gui/src/app.rs b/crates/pipeview-gui/src/app.rs index 7be3b26..e5fdcf8 100644 --- a/crates/pipeview-gui/src/app.rs +++ b/crates/pipeview-gui/src/app.rs @@ -280,6 +280,7 @@ impl XserialApp { search: SearchState::default(), log_enabled: false, log_path: String::new(), + show_sent: true, log_writer: None, }); } diff --git a/crates/pipeview-gui/src/models.rs b/crates/pipeview-gui/src/models.rs index 409f9d0..d21e3b3 100644 --- a/crates/pipeview-gui/src/models.rs +++ b/crates/pipeview-gui/src/models.rs @@ -129,5 +129,6 @@ pub struct SessionTab { pub search: SearchState, pub log_enabled: bool, pub log_path: String, + pub show_sent: bool, pub log_writer: Option, } diff --git a/crates/pipeview-gui/src/panels/send_panel.rs b/crates/pipeview-gui/src/panels/send_panel.rs index 36607c6..e13b0bc 100644 --- a/crates/pipeview-gui/src/panels/send_panel.rs +++ b/crates/pipeview-gui/src/panels/send_panel.rs @@ -66,6 +66,8 @@ pub fn render_send_panel(ui: &mut egui::Ui, manager: &SessionManager, tab: &mut }); } ui.add_space(3.0); + ui.checkbox(&mut tab.show_sent, "Show sent data"); + ui.add_space(3.0); let hint = match tab.send_mode { SendMode::Text => "Enter to send, Ctrl+Enter for newline", @@ -116,7 +118,9 @@ pub fn render_send_panel(ui: &mut egui::Ui, manager: &SessionManager, tab: &mut LineEnding::CR => text.push('\r'), LineEnding::CRLF => text.push_str("\r\n"), } - tab.console.push_outbound(text.clone()); + if tab.show_sent { + tab.console.push_outbound(text.clone()); + } if let Some(ref writer) = tab.log_writer { writer.write_line(&logging::format_sent_log(&text)); } @@ -129,7 +133,9 @@ pub fn render_send_panel(ui: &mut egui::Ui, manager: &SessionManager, tab: &mut .collect::>() .join(" "); if !hex.is_empty() { - tab.hex.push_outbound(hex.clone()); + if tab.show_sent { + tab.hex.push_outbound(hex.clone()); + } if let Some(ref writer) = tab.log_writer { writer.write_line(&logging::format_sent_log(&hex)); }