assistant2: Make context pill names work like editor tabs (#22741)
Context pills for files will now only display the basename of the file. If two files have the same base name, we will also show their parent directories, mimicking the behavior of editor tabs. https://github.com/user-attachments/assets/ee88ee3b-80ff-4115-9ff9-8fe4845a67d8 Note: The double `/` in the file picker is a known separate issue. Release Notes: - N/A --------- Co-authored-by: Danilo <danilo@zed.dev> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
parent
a827f54022
commit
bcc6d95529
5 changed files with 218 additions and 85 deletions
|
@ -282,13 +282,11 @@ impl ActiveThread {
|
|||
.child(div().p_2p5().text_ui(cx).child(markdown.clone()))
|
||||
.when_some(context, |parent, context| {
|
||||
if !context.is_empty() {
|
||||
parent.child(
|
||||
h_flex().flex_wrap().gap_1().px_1p5().pb_1p5().children(
|
||||
context
|
||||
.iter()
|
||||
.map(|context| ContextPill::new(context.clone())),
|
||||
),
|
||||
)
|
||||
parent.child(h_flex().flex_wrap().gap_1().px_1p5().pb_1p5().children(
|
||||
context.iter().map(|context| {
|
||||
ContextPill::new_added(context.clone(), false, None)
|
||||
}),
|
||||
))
|
||||
} else {
|
||||
parent
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue