From 540627db751fde04b21814ec4984d4c124d1e1f3 Mon Sep 17 00:00:00 2001 From: Ignacio Perez Date: Sun, 4 Jan 2026 18:38:04 -0300 Subject: [PATCH] fix(modal): keep focus in annotations section when moving up from first item --- src/view/task_detail_modal/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/view/task_detail_modal/mod.rs b/src/view/task_detail_modal/mod.rs index b82c81b..d3b4e07 100644 --- a/src/view/task_detail_modal/mod.rs +++ b/src/view/task_detail_modal/mod.rs @@ -1841,11 +1841,13 @@ impl TaskDetailModal { pub fn scroll(&self, delta: i32, cx: &mut gpui::Context) { let handle = &self.scroll_handle; + let current = if delta > 0 { handle.bottom_item() } else { handle.top_item() }; + let next = if delta > 0 { current.saturating_add(1) } else { @@ -1890,7 +1892,7 @@ impl TaskDetailModal { (Some(next_index), true) } } else if i == 0 { - (None, false) + (None, true) } else { (Some(i - 1), true) }