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:
parent
239e479aed
commit
9eb1ff2726
6 changed files with 671 additions and 374 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue