From 0d3badc8575aa46685b4423af2bb5fa009bda1a2 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 23 Jun 2026 12:18:56 -0300 Subject: [PATCH] agent_ui: Fix opening the profile configuration modal from picker (#59768) Release Notes: - Agent: Fixed a bug where trying to open the profile configuration modal through the picker in the agent panel's message editor wouldn't work through the keybinding. --- assets/keymaps/specific-overrides-macos.json | 6 ++++++ assets/keymaps/specific-overrides.json | 5 +++++ crates/picker/src/render.rs | 11 +++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/assets/keymaps/specific-overrides-macos.json b/assets/keymaps/specific-overrides-macos.json index 151bebeec01..3fd1d6c87f8 100644 --- a/assets/keymaps/specific-overrides-macos.json +++ b/assets/keymaps/specific-overrides-macos.json @@ -11,6 +11,12 @@ "use_key_equivalents": true, "bindings": { "cmd-shift-a": "picker::ToggleActionsMenu", + }, + }, + { + "context": "(Picker && with_preview) > Editor", + "use_key_equivalents": true, + "bindings": { "cmd-alt-p": "picker::TogglePreview", "cmd-alt-right": "picker::SetPreviewRight", "cmd-alt-down": "picker::SetPreviewBelow", diff --git a/assets/keymaps/specific-overrides.json b/assets/keymaps/specific-overrides.json index 283d930b86e..663153a8435 100644 --- a/assets/keymaps/specific-overrides.json +++ b/assets/keymaps/specific-overrides.json @@ -10,6 +10,11 @@ "context": "Picker > Editor", "bindings": { "ctrl-shift-a": "picker::ToggleActionsMenu", + }, + }, + { + "context": "(Picker && with_preview) > Editor", + "bindings": { "ctrl-alt-p": "picker::TogglePreview", "ctrl-alt-right": "picker::SetPreviewRight", "ctrl-alt-down": "picker::SetPreviewBelow", diff --git a/crates/picker/src/render.rs b/crates/picker/src/render.rs index 82cdc4ad474..4ff7c425622 100644 --- a/crates/picker/src/render.rs +++ b/crates/picker/src/render.rs @@ -1,4 +1,4 @@ -use gpui::canvas; +use gpui::{KeyContext, canvas}; use settings::Settings; use theme_settings::ThemeSettings; use ui::{ @@ -89,8 +89,15 @@ impl Picker { let editor_position = self.delegate.editor_position(); let picker_bounds = self.picker_bounds.clone(); + + let mut key_context = KeyContext::default(); + key_context.add("Picker"); + if self.preview.is_some() { + key_context.add("with_preview"); + } + let menu = v_flex() - .key_context("Picker") + .key_context(key_context) .relative() .map(|this| { self.shape.apply_results_size(