Skip to content

Commit 902e891

Browse files
doowtaclaude
authored andcommitted
Agent: activate search in its sidebar row
Keep the expanded header clear and place Search below New Task. Replace the row with the focused field in the same box, reveal it for the shortcut, and return to the row when an empty search ends. Clicking away drops the input focus while retaining a nonempty filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b8bfdd1 commit 902e891

7 files changed

Lines changed: 385 additions & 90 deletions

File tree

‎apps/maple-agent/app/src/keymap.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ fn catalog_for(os: HostOs) -> Vec<ShortcutSlot> {
379379
"Focus task search",
380380
ShortcutCategory::Chat,
381381
Some("Chat"),
382-
"secondary-k",
382+
"secondary-f",
383383
SlotAction::FocusSearch,
384384
),
385385
slot(

‎apps/maple-agent/app/src/ui/chat/commands.rs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ impl ChatScreen {
6565
}
6666
ChatCommand::ChooseProject => self.toggle_root_menu(cx),
6767
ChatCommand::CopySelection => self.copy_selected_text(cx),
68+
ChatCommand::Escape
69+
if self.sidebar.read(cx).search_input_focused(window, cx)
70+
&& self
71+
.sidebar
72+
.update(cx, |sidebar, cx| sidebar.hide_empty_search(cx)) =>
73+
{
74+
if let Some(composer) = &self.composer {
75+
use gpui::Focusable;
76+
window.focus(&composer.read(cx).focus_handle(cx), cx);
77+
}
78+
}
6879
ChatCommand::Escape if self.application_vim_enabled => {
6980
self.application_escape(window, cx)
7081
}

‎apps/maple-agent/app/src/ui/chat/composer.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ impl ChatScreen {
157157
ChatCommand::NewTask,
158158
4,
159159
),
160+
(
161+
"header-search",
162+
"search",
163+
"Search",
164+
&super::FocusSearch,
165+
ChatCommand::FocusSearch,
166+
5,
167+
),
160168
]
161169
.into_iter()
162170
.filter(|(_, _, _, _, command, _)| {

‎apps/maple-agent/app/src/ui/chat/navigation.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub(super) enum ChatRegion {
3131
pub(super) enum SidebarTarget {
3232
Computer(super::computers::Navigate),
3333
NewTask,
34+
Search,
3435
Projects,
3536
Task(String),
3637
Archived,
@@ -560,6 +561,7 @@ impl ChatScreen {
560561
match self.application_vim.region {
561562
ChatRegion::Sidebar => match self.sidebar.read(cx).vim_selected().cloned() {
562563
Some(SidebarTarget::NewTask) => self.new_session(cx),
564+
Some(SidebarTarget::Search) => self.focus_sidebar_search(window, cx),
563565
Some(SidebarTarget::Projects) => self.sidebar.update(cx, |sidebar, cx| {
564566
let open = sidebar.switcher_menu_open();
565567
sidebar.set_switcher_menu_open(!open, cx);

0 commit comments

Comments
 (0)