assistant2: Sketch in sending file context to model (#21829)
This PR sketches in support for sending file context attached to a message to the model. Right now the context is just mocked. <img width="1159" alt="Screenshot 2024-12-10 at 4 18 41 PM" src="https://github.com/user-attachments/assets/3ee4e86a-7893-42dc-98f9-982aa202d310"> <img width="1159" alt="Screenshot 2024-12-10 at 4 18 53 PM" src="https://github.com/user-attachments/assets/8a3c2dd7-a466-4dbf-83ec-1c7d969c1a4b"> Release Notes: - N/A
This commit is contained in:
parent
f80eb73213
commit
c255e55599
10 changed files with 145 additions and 15 deletions
25
crates/assistant2/src/ui/context_pill.rs
Normal file
25
crates/assistant2/src/ui/context_pill.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
use ui::prelude::*;
|
||||
|
||||
use crate::context::Context;
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct ContextPill {
|
||||
context: Context,
|
||||
}
|
||||
|
||||
impl ContextPill {
|
||||
pub fn new(context: Context) -> Self {
|
||||
Self { context }
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderOnce for ContextPill {
|
||||
fn render(self, cx: &mut WindowContext) -> impl IntoElement {
|
||||
div()
|
||||
.px_1()
|
||||
.border_1()
|
||||
.border_color(cx.theme().colors().border)
|
||||
.rounded_md()
|
||||
.child(Label::new(self.context.name.clone()).size(LabelSize::Small))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue