assistant: Tweak tab bar layout (#15901)

- Add "New Context" button next to the hamburger
- Add "History"
- Allow Pane tab rendering callback to return items for both left and
right side of the tab bar.


![image](https://github.com/user-attachments/assets/d5aa599d-c9e4-4f26-ad66-ffc290c53c29)


Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-08-07 13:46:59 +02:00 committed by GitHub
parent bf403ca788
commit 8aa1ba8cbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 15 deletions

View file

@ -174,9 +174,9 @@ impl TerminalPanel {
self.pane.update(cx, |pane, cx| {
pane.set_render_tab_bar_buttons(cx, move |pane, cx| {
if !pane.has_focus(cx) {
return None;
return (None, None);
}
h_flex()
let right_children = h_flex()
.gap_2()
.children(additional_buttons.clone())
.child(
@ -232,7 +232,8 @@ impl TerminalPanel {
})
})
.into_any_element()
.into()
.into();
(None, right_children)
});
});
}