From a28496de88cf532108a4eeb987c344915fa70aee Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 21:32:47 -0500 Subject: [PATCH] lead: remove the red rounds' DIAG prints from product code --- crates/ui-egui/src/app.rs | 1 - crates/ui-egui/src/canvas/image_pick.rs | 9 --------- crates/ui-egui/src/canvas/page_parts.rs | 1 - crates/ui-egui/src/editing.rs | 6 ------ crates/ui-egui/src/panels/side_panels.rs | 1 - crates/ui-egui/src/panes.rs | 2 -- crates/ui-egui/src/tools/forms_ui.rs | 6 ------ crates/ui-egui/src/tools/sign_ui/tool.rs | 2 -- crates/ui-egui/src/workflows/create_ui.rs | 5 ----- 9 files changed, 33 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index f9859a0209..540b2025eb 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -695,7 +695,6 @@ impl PdfCraftApp { if blocked { let thread = std::thread::current(); let name = thread.name().unwrap_or("").rsplit("::").next().unwrap_or(""); - eprintln!("DIAG {name}: input blocked: modal {} palette {} focused {}", self.modal_open(), self.palette_open, ctx.input(|i| i.focused)); } for (index, view) in self.views.iter_mut().enumerate() { let shut = blocked || self.active != Some(index); diff --git a/crates/ui-egui/src/canvas/image_pick.rs b/crates/ui-egui/src/canvas/image_pick.rs index 31ddfb4888..c8c97ffbf9 100644 --- a/crates/ui-egui/src/canvas/image_pick.rs +++ b/crates/ui-egui/src/canvas/image_pick.rs @@ -223,15 +223,6 @@ mod picture_tests { h.run_steps(2); let test = std::thread::current().name().and_then(|n| n.rsplit("::").next()).unwrap_or_default().to_owned(); let s = h.state(); - eprintln!( - "DIAG {test}: tool={:?} pending={:?} picked={:?} xform={} edit_gen={} point={:?}", - s.quick_tool, - s.views[0].session.pending_pick, - s.views[0].session.picked_image.is_some(), - s.views[0].page_xform(0).is_some(), - s.session.get(s.views[0].id).map(|d| d.edit_generation()).unwrap_or_default(), - at(100.0, 150.0) - ); assert!(h.state().views[0].session.pending_pick.is_some(), "the click waits for its page"); } diff --git a/crates/ui-egui/src/canvas/page_parts.rs b/crates/ui-egui/src/canvas/page_parts.rs index 2fa7c2a4b0..8869e7b29f 100644 --- a/crates/ui-egui/src/canvas/page_parts.rs +++ b/crates/ui-egui/src/canvas/page_parts.rs @@ -388,7 +388,6 @@ impl Component for PageParts<'_> { if press.phase.is_press() || hovered { let thread = std::thread::current(); let name = thread.name().unwrap_or("").rsplit("::").next().unwrap_or(""); - eprintln!("DIAG {name}: part {:?} page {} hovered {hovered} phase {:?}", part.owner, part.page, press.phase); } if press.phase.is_press() && self.report.press.is_none() { self.report.press = Some(PagePress { owner: part.owner, page: part.page, phase: press.phase, mods: press.mods }); diff --git a/crates/ui-egui/src/editing.rs b/crates/ui-egui/src/editing.rs index b137a32eec..640287e25a 100644 --- a/crates/ui-egui/src/editing.rs +++ b/crates/ui-egui/src/editing.rs @@ -83,11 +83,6 @@ fn select_after_edit( view.session.comments.select_keys(&[(a.page, n)]); } view.session.comments.reveal = true; - eprintln!( - "DIAG a_shape_just_drawn_resizes_from_its_handles_without_the_select_tool: AddAnnotation {:?} newest {newest:?} selection {:?}", - std::mem::discriminant(&a.shape), - view.session.comments.selection() - ); // A new highlight opens its note for typing straight away, as in Acrobat, // unless a note typed into another card is still unsaved. if let (pdfcraft_engine::Shape::TextMarkup { kind: pdfcraft_engine::Markup::Highlight, .. }, Some(n)) = (&a.shape, newest) @@ -113,7 +108,6 @@ fn select_after_edit( // can be moved or copied again; anything else in a batch clears the selection. Edit::Batch { edits, .. } if edits.iter().all(|e| matches!(e, Edit::MoveAnnotation { .. })) => {} Edit::Batch { edits, .. } => { - eprintln!("DIAG a_shape_just_drawn_resizes_from_its_handles_without_the_select_tool: batch of {} cleared the selection", edits.len()); view.session.comments.clear_selection(); } // The copies the paste added (and nothing that was there before): select them all. diff --git a/crates/ui-egui/src/panels/side_panels.rs b/crates/ui-egui/src/panels/side_panels.rs index 2d4a4d4c8d..52f2f0a7c9 100644 --- a/crates/ui-egui/src/panels/side_panels.rs +++ b/crates/ui-egui/src/panels/side_panels.rs @@ -722,7 +722,6 @@ fn build(old: &Old, right: Option, widths: bool) -> Option, action| workspace.apply(action, false, permissions).ok(); if old.tools_right { let moved = workspace.apply(Action::move_column(PanelId::Tools, Target::new_dock(DockEdge::End)), false, permissions); - eprintln!("DIAG an_old_saved_layout_migrates_to_the_dock_workspace: move tools right (widths {widths}): ok {}", moved.is_ok()); moved.ok()?; } let side = right.filter(|_| old.side_open).map(PanelId::from); diff --git a/crates/ui-egui/src/panes.rs b/crates/ui-egui/src/panes.rs index 02fce9ce16..b69ebd80c4 100644 --- a/crates/ui-egui/src/panes.rs +++ b/crates/ui-egui/src/panes.rs @@ -436,7 +436,6 @@ pub(crate) fn page_area(app: &mut PdfCraftApp, ui: &mut egui::Ui) { let active = usize::from(app.active.and_then(|i| app.views.get(i)).is_some_and(|v| v.pane.place == Place::Second)); // The drop rule reads the open views up front: the views closure below borrows the app. let open: HashSet = app.views.iter().map(|v| v.pane.key).collect(); - eprintln!("DIAG fit_visible_zooms_to_the_content_width: page_area avail {:?}", ui.available_rect_before_wrap()); let views = SplitViews::new(tl!("Pages").to_string(), layout, Bind::bound(&mut at)) .count(1) .active(active) @@ -449,7 +448,6 @@ pub(crate) fn page_area(app: &mut PdfCraftApp, ui: &mut egui::Ui) { strip(app, ui, place); } let room = ui.available_rect_before_wrap(); - eprintln!("DIAG fit_visible_zooms_to_the_content_width: pane {:?} room {room:?} max {:?}", pane.rect, ui.max_rect()); let mut body_ui = ui.new_child(egui::UiBuilder::new().max_rect(room).id_salt("body")); body_ui.shrink_clip_rect(room); // The strip may have closed or moved a tab just now: look the pane's tab up again (a diff --git a/crates/ui-egui/src/tools/forms_ui.rs b/crates/ui-egui/src/tools/forms_ui.rs index f552162d50..7d3c436261 100644 --- a/crates/ui-egui/src/tools/forms_ui.rs +++ b/crates/ui-egui/src/tools/forms_ui.rs @@ -426,12 +426,6 @@ pub(crate) fn field_press( let form = doc.form.as_slice(); let Some((f, w)) = form.get(field).and_then(|f| f.widgets.get(wi).map(|w| (f, w))) else { return }; let usable = usable(f, w, allowed); - eprintln!( - "DIAG list_box_clicks_select_directly_and_ctrl_click_toggles_multi: field_press {} widget {wi} usable {usable} down {} release_click {}", - f.name, - matches!(press.phase, PressPhase::Down { .. }), - matches!(press.phase, PressPhase::Release { click: true, .. }) - ); match &press.phase { PressPhase::Down { start, .. } => { // The press runs the widget's Mouse Down JavaScript, as in Acrobat (#269). diff --git a/crates/ui-egui/src/tools/sign_ui/tool.rs b/crates/ui-egui/src/tools/sign_ui/tool.rs index 60b5ad4c92..34ef5f8f11 100644 --- a/crates/ui-egui/src/tools/sign_ui/tool.rs +++ b/crates/ui-egui/src/tools/sign_ui/tool.rs @@ -52,7 +52,6 @@ impl<'a> SignAreaTool<'a> { impl CanvasTool for SignAreaTool<'_> { fn press(&mut self, pointer: &ToolPointer, _cx: &mut ToolContext<'_>) -> ToolAction { - eprintln!("DIAG ctrl_alt_q_types_an_email_without_quitting: sign press at {:?}, placed {}", pointer.pos, self.placed.len()); match self.placed_at(pointer.pos) { Some(placed) if self.drag.press(placed, pointer.pos) => ToolAction::Claimed, _ => ToolAction::Ignored, @@ -65,7 +64,6 @@ impl CanvasTool for SignAreaTool<'_> { fn release(&mut self, pointer: &ToolPointer, _cx: &mut ToolContext<'_>) { self.drag.drag(pointer.pos); - eprintln!("DIAG ctrl_alt_q_types_an_email_without_quitting: sign release at {:?}, active {}", pointer.pos, self.drag.is_active()); // A click with no drag leaves nothing drawn: `release` gives none under the least side. let Some((page, rect)) = self.drag.release(LEAST_SIDE) else { return }; let Some(placed) = self.placed.iter().find(|p| p.page == page) else { return }; diff --git a/crates/ui-egui/src/workflows/create_ui.rs b/crates/ui-egui/src/workflows/create_ui.rs index 14713f92f0..291d7e1287 100644 --- a/crates/ui-egui/src/workflows/create_ui.rs +++ b/crates/ui-egui/src/workflows/create_ui.rs @@ -482,11 +482,6 @@ mod tests { let ctx_h = h.ctx.clone(); h.state_mut().reduce_file_size(&ctx_h); h.run_steps(2); - eprintln!( - "DIAG reduce_file_size_asks_where_to_save_before_it_compresses: run {} waiting {}", - h.state().optimize_run.is_some(), - jobs.waiting() - ); assert!(h.state().optimize_run.is_none() && jobs.waiting() == 0, "nothing runs until the answer is in"); assert_eq!(files.open(), 1, "the question is out"); assert!(files.file(&out).is_none(), "no copy is written before the answer");