From 609e7910fa9533a71c91b7fa13245eb98417f26d Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Sun, 31 May 2026 22:00:43 +0800 Subject: [PATCH] fix(git): swallow Enter while branch-picker / overflow popover is open In list / merge mode (and the overflow menu) no input is focused, so Enter skipped every input handler and fell through to the global chat send. Guard it: while either ready-state popover is open, Enter is consumed (focused inputs still submit via the handlers above). --- crates/op-host-native/src/widget_host/keyboard.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/op-host-native/src/widget_host/keyboard.rs b/crates/op-host-native/src/widget_host/keyboard.rs index cc8df2956..b7f00bd78 100644 --- a/crates/op-host-native/src/widget_host/keyboard.rs +++ b/crates/op-host-native/src/widget_host/keyboard.rs @@ -646,6 +646,14 @@ impl WidgetHostNative { self.mark_dirty(); return true; } + // While a ready-state popover (branch picker / overflow menu) is open + // with no focused input, swallow Enter so it can't fall through to the + // global chat send below. (Focused inputs already submitted above.) + if self.editor_state.editor_ui.git_panel.branch_picker_open + || self.editor_state.editor_ui.git_panel.overflow_open + { + return true; + } if self.editor_state.ui.layer_rename.is_some() { let ok = self.editor_state.rename_commit(); if ok {