From 981b224a46f26d21f925d62f67473d2df832da7b Mon Sep 17 00:00:00 2001 From: Gautam Manchandani Date: Fri, 2 Oct 2026 08:11:03 +0000 Subject: [PATCH] Fix forward Delete key icon (#65037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keymap-dark Closes #64964. Use a dedicated forward Delete icon (⌦) instead of Backspace (⌫). Add a regression test for distinct icons. Release Notes: - Fixed identical Backspace and Delete icons in the keymap editor. --- assets/icons/delete.svg | 7 +++++++ crates/icons/src/icons.rs | 1 + crates/ui/src/components/keybinding.rs | 17 ++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 assets/icons/delete.svg diff --git a/assets/icons/delete.svg b/assets/icons/delete.svg new file mode 100644 index 00000000000..cdb5d8b511b --- /dev/null +++ b/assets/icons/delete.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/crates/icons/src/icons.rs b/crates/icons/src/icons.rs index 22ca64a5822..385a8468502 100644 --- a/crates/icons/src/icons.rs +++ b/crates/icons/src/icons.rs @@ -101,6 +101,7 @@ pub enum IconName { DebugStepInto, DebugStepOut, DebugStepOver, + Delete, Diff, DiffSplit, DiffSplitAuto, diff --git a/crates/ui/src/components/keybinding.rs b/crates/ui/src/components/keybinding.rs index cd58c284cb7..b4437e0ad5d 100644 --- a/crates/ui/src/components/keybinding.rs +++ b/crates/ui/src/components/keybinding.rs @@ -392,7 +392,7 @@ fn icon_for_key(key: &str, platform_style: PlatformStyle) -> Option { "up" => Some(IconName::ArrowUp), "down" => Some(IconName::ArrowDown), "backspace" => Some(IconName::Backspace), - "delete" => Some(IconName::Backspace), + "delete" => Some(IconName::Delete), "return" => Some(IconName::Return), "enter" => Some(IconName::Return), "tab" => Some(IconName::Tab), @@ -848,6 +848,21 @@ impl Component for KeyBinding { mod tests { use super::*; + #[test] + fn test_backspace_and_delete_have_distinct_icons() { + for platform_style in [ + PlatformStyle::Mac, + PlatformStyle::Linux, + PlatformStyle::Windows, + ] { + let backspace = icon_for_key("backspace", platform_style); + let delete = icon_for_key("delete", platform_style); + assert!(backspace.is_some()); + assert!(delete.is_some()); + assert_ne!(backspace, delete); + } + } + #[test] fn test_text_for_keystroke() { let keystroke = Keystroke::parse("cmd-c").unwrap();