From 1a5cf6b023e4804ae545474104ea820c1c27c072 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 14 Nov 2026 22:26:03 +0100 Subject: [PATCH] fix(ui): distinguish insert text annotation icon (#7170) --- crates/engine/src/commands.rs | 2 +- crates/ui-egui/src/tools/comments.rs | 2 +- crates/ui-egui/src/tools/comments/tests.rs | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/commands.rs b/crates/engine/src/commands.rs index 55a5d840ba..eb0b8f8b71 100644 --- a/crates/engine/src/commands.rs +++ b/crates/engine/src/commands.rs @@ -293,7 +293,7 @@ pub const COMMANDS: &[CommandSpec] = &[ c("comment.polyline", "Draw connected lines", None, None, Annotate, "spline"), c("comment.cloud", "Draw a cloud", None, None, Annotate, "cloud"), c("comment.callout", "Add a callout", None, None, Annotate, "message-square-quote"), - c("comment.caret", "Insert text", None, None, Annotate, "text-cursor-input"), + c("comment.caret", "Insert text", None, None, Annotate, "message-square-text"), c("comment.replace", "Replace text", None, None, Annotate, "replace"), c("comment.attach", "Attach a file", None, None, Annotate, "paperclip"), c("comment.eraser", "Erase drawings", None, None, Annotate, "eraser"), diff --git a/crates/ui-egui/src/tools/comments.rs b/crates/ui-egui/src/tools/comments.rs index b9b6b1b9cc..d6875aa3f9 100644 --- a/crates/ui-egui/src/tools/comments.rs +++ b/crates/ui-egui/src/tools/comments.rs @@ -211,7 +211,7 @@ impl CommentTool { Self::PolyLine => "spline", Self::Cloud => "cloud", Self::Callout => "message-square-quote", - Self::Caret => "text-cursor-input", + Self::Caret => "message-square-text", Self::ReplaceText => "replace", Self::Attach => "paperclip", Self::Eraser => "eraser", diff --git a/crates/ui-egui/src/tools/comments/tests.rs b/crates/ui-egui/src/tools/comments/tests.rs index 18c511debb..e43b7fc86f 100644 --- a/crates/ui-egui/src/tools/comments/tests.rs +++ b/crates/ui-egui/src/tools/comments/tests.rs @@ -898,3 +898,13 @@ fn comment_marker_wins_over_an_overlapping_body_for_pick_and_hover() { super::input::describe(&hidden, &mut view); assert!(view.cursor.resolve(&ctx, QuickTool::Select).is_none()); } + +#[test] +fn insert_text_icon_is_distinct_from_edit_text_and_matches_its_command() { + let insert = CommentTool::Caret.icon(); + let edit = pdfcraft_engine::commands::command("edit.edit_text").unwrap().icon; + let command = pdfcraft_engine::commands::command("comment.caret").unwrap().icon; + assert_ne!(insert, edit, "adjacent tools need distinct icons"); + assert_eq!(insert, command, "the annotation toolbar and command use the same icon"); + assert!(crate::widgets::icons::exists(insert)); +}