acp thread view: Always use editors for user messages (#36256)

This means the cursor will be at the position you clicked:


https://github.com/user-attachments/assets/0693950d-7513-4d90-88e2-55817df7213a


Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-08-15 18:03:36 -03:00 committed by GitHub
parent 239e479aed
commit 9eb1ff2726
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 671 additions and 374 deletions

View file

@ -109,7 +109,7 @@ pub enum AgentThreadEntry {
}
impl AgentThreadEntry {
fn to_markdown(&self, cx: &App) -> String {
pub fn to_markdown(&self, cx: &App) -> String {
match self {
Self::UserMessage(message) => message.to_markdown(cx),
Self::AssistantMessage(message) => message.to_markdown(cx),
@ -117,6 +117,14 @@ impl AgentThreadEntry {
}
}
pub fn user_message(&self) -> Option<&UserMessage> {
if let AgentThreadEntry::UserMessage(message) = self {
Some(message)
} else {
None
}
}
pub fn diffs(&self) -> impl Iterator<Item = &Entity<Diff>> {
if let AgentThreadEntry::ToolCall(call) = self {
itertools::Either::Left(call.diffs())