agent: Add button to open thread as markdown (#28481)
<img src="https://github.com/user-attachments/assets/92ca8f64-a949-4cc1-a657-3978a2c65839" width="600"/> Release Notes: - agent: The action to open the current active thread in Markdown is now exposed in the UI.
This commit is contained in:
parent
12212dc329
commit
b46ab367ef
1 changed files with 15 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
||||||
use crate::AssistantPanel;
|
|
||||||
use crate::context::{AssistantContext, ContextId};
|
use crate::context::{AssistantContext, ContextId};
|
||||||
use crate::context_picker::MentionLink;
|
use crate::context_picker::MentionLink;
|
||||||
use crate::thread::{
|
use crate::thread::{
|
||||||
|
@ -8,6 +7,7 @@ use crate::thread::{
|
||||||
use crate::thread_store::ThreadStore;
|
use crate::thread_store::ThreadStore;
|
||||||
use crate::tool_use::{PendingToolUseStatus, ToolUse, ToolUseStatus};
|
use crate::tool_use::{PendingToolUseStatus, ToolUse, ToolUseStatus};
|
||||||
use crate::ui::{AddedContext, AgentNotification, AgentNotificationEvent, ContextPill};
|
use crate::ui::{AddedContext, AgentNotification, AgentNotificationEvent, ContextPill};
|
||||||
|
use crate::{AssistantPanel, OpenActiveThreadAsMarkdown};
|
||||||
use anyhow::Context as _;
|
use anyhow::Context as _;
|
||||||
use assistant_settings::{AssistantSettings, NotifyWhenAgentWaiting};
|
use assistant_settings::{AssistantSettings, NotifyWhenAgentWaiting};
|
||||||
use collections::{HashMap, HashSet};
|
use collections::{HashMap, HashSet};
|
||||||
|
@ -1380,8 +1380,16 @@ impl ActiveThread {
|
||||||
let editor_bg_color = colors.editor_background;
|
let editor_bg_color = colors.editor_background;
|
||||||
let bg_user_message_header = editor_bg_color.blend(active_color.opacity(0.25));
|
let bg_user_message_header = editor_bg_color.blend(active_color.opacity(0.25));
|
||||||
|
|
||||||
let feedback_container = h_flex().py_2().px_4().gap_1().justify_between();
|
let open_as_markdown = IconButton::new("open-as-markdown", IconName::FileCode)
|
||||||
|
.shape(ui::IconButtonShape::Square)
|
||||||
|
.icon_size(IconSize::XSmall)
|
||||||
|
.icon_color(Color::Ignored)
|
||||||
|
.tooltip(Tooltip::text("Open Thread as Markdown"))
|
||||||
|
.on_click(|_event, window, cx| {
|
||||||
|
window.dispatch_action(Box::new(OpenActiveThreadAsMarkdown), cx)
|
||||||
|
});
|
||||||
|
|
||||||
|
let feedback_container = h_flex().py_2().px_4().gap_1().justify_between();
|
||||||
let feedback_items = match self.thread.read(cx).message_feedback(message_id) {
|
let feedback_items = match self.thread.read(cx).message_feedback(message_id) {
|
||||||
Some(feedback) => feedback_container
|
Some(feedback) => feedback_container
|
||||||
.child(
|
.child(
|
||||||
|
@ -1433,7 +1441,8 @@ impl ActiveThread {
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
})),
|
})),
|
||||||
),
|
)
|
||||||
|
.child(open_as_markdown),
|
||||||
)
|
)
|
||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
None => feedback_container
|
None => feedback_container
|
||||||
|
@ -1446,6 +1455,7 @@ impl ActiveThread {
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
.pr_1()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
.child(
|
.child(
|
||||||
IconButton::new(("feedback-thumbs-up", ix), IconName::ThumbsUp)
|
IconButton::new(("feedback-thumbs-up", ix), IconName::ThumbsUp)
|
||||||
|
@ -1476,7 +1486,8 @@ impl ActiveThread {
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
})),
|
})),
|
||||||
),
|
)
|
||||||
|
.child(open_as_markdown),
|
||||||
)
|
)
|
||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue