From 38e1d19e062f300068d944a0c8129d0ccd17648e Mon Sep 17 00:00:00 2001 From: Oleksiy Syvokon Date: Mon, 13 Apr 2026 12:27:54 +0300 Subject: [PATCH] agent_ui: Simplify thread scrolling with keyboard (#53547) This change allows using simple navigation keys (PageDown / PageUp / Ctrl-Home / Ctrl-End) when the message editor is focused, but only if the cursor is at the beginning/end of the message, where pressing these keys would normally result in no-op. One important corollary is that when the cursor is in an empty message, navigation keys scroll the thread. We already have this behavior for Up/Down and this change just expands it for other navigation keys. Demo: [Demo](https://github.com/user-attachments/assets/ff540c8c-a223-417b-b16a-b0d08599b1ae) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- assets/keymaps/default-linux.json | 18 ++++++++++++++++++ assets/keymaps/default-macos.json | 18 ++++++++++++++++++ assets/keymaps/default-windows.json | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 6433a420b87be8cf0678dc615e7c4736eed9d0b0..c33d60adc3aef9f32aa173e257f1cc5d360a54db 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -338,6 +338,24 @@ "ctrl-alt-.": "agent::ToggleFastMode", }, }, + { + "context": "AcpThread > Editor && start_of_input", + "use_key_equivalents": true, + "bindings": { + "pageup": "agent::ScrollOutputPageUp", + "ctrl-pageup": "agent::ScrollOutputPageUp", + "ctrl-home": "agent::ScrollOutputToTop", + }, + }, + { + "context": "AcpThread > Editor && end_of_input", + "use_key_equivalents": true, + "bindings": { + "pagedown": "agent::ScrollOutputPageDown", + "ctrl-pagedown": "agent::ScrollOutputPageDown", + "ctrl-end": "agent::ScrollOutputToBottom", + }, + }, { "context": "AcpThread > Editor && mode == full", "use_key_equivalents": true, diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 5e27dbd99e41861f0c9bace86c03d98788264d81..e560bdb2628a8b188eb08606c758ef400094724a 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -379,6 +379,24 @@ "cmd-alt-.": "agent::ToggleFastMode", }, }, + { + "context": "AcpThread > Editor && start_of_input", + "use_key_equivalents": true, + "bindings": { + "pageup": "agent::ScrollOutputPageUp", + "ctrl-pageup": "agent::ScrollOutputPageUp", + "ctrl-home": "agent::ScrollOutputToTop", + }, + }, + { + "context": "AcpThread > Editor && end_of_input", + "use_key_equivalents": true, + "bindings": { + "pagedown": "agent::ScrollOutputPageDown", + "ctrl-pagedown": "agent::ScrollOutputPageDown", + "ctrl-end": "agent::ScrollOutputToBottom", + }, + }, { "context": "AcpThread > Editor && mode == full", "use_key_equivalents": true, diff --git a/assets/keymaps/default-windows.json b/assets/keymaps/default-windows.json index 1e33a71d8815e72daba07adbc76b330795ff9d52..f4824c40906435b351978da3259328d84263fb54 100644 --- a/assets/keymaps/default-windows.json +++ b/assets/keymaps/default-windows.json @@ -339,6 +339,24 @@ "ctrl-alt-.": "agent::ToggleFastMode", }, }, + { + "context": "AcpThread > Editor && start_of_input", + "use_key_equivalents": true, + "bindings": { + "pageup": "agent::ScrollOutputPageUp", + "ctrl-pageup": "agent::ScrollOutputPageUp", + "ctrl-home": "agent::ScrollOutputToTop", + }, + }, + { + "context": "AcpThread > Editor && end_of_input", + "use_key_equivalents": true, + "bindings": { + "pagedown": "agent::ScrollOutputPageDown", + "ctrl-pagedown": "agent::ScrollOutputPageDown", + "ctrl-end": "agent::ScrollOutputToBottom", + }, + }, { "context": "AcpThread > Editor && mode == full", "use_key_equivalents": true,