agent: Improve terminal tool card design (#29712)

To-dos:

- [x] Expose the command to defend against cases where that's just super
long
- [x] Tackle the vertical scroll conflict with panel scroll
- [x] Reduce default font-size

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
Danilo Leal 2025-05-05 15:50:53 -03:00 committed by GitHub
parent e64f5ff358
commit 7dfbe0b908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 174 additions and 145 deletions

View file

@ -111,6 +111,7 @@ pub struct TerminalView {
context_menu: Option<(Entity<ContextMenu>, gpui::Point<Pixels>, Subscription)>,
cursor_shape: CursorShape,
blink_state: bool,
embedded: bool,
blinking_terminal_enabled: bool,
cwd_serialized: bool,
blinking_paused: bool,
@ -162,6 +163,7 @@ impl TerminalView {
workspace: WeakEntity<Workspace>,
workspace_id: Option<WorkspaceId>,
project: WeakEntity<Project>,
embedded: bool,
window: &mut Window,
cx: &mut Context<Self>,
) -> Self {
@ -200,6 +202,7 @@ impl TerminalView {
blink_epoch: 0,
hover_target_tooltip: None,
hover_tooltip_update: Task::ready(()),
embedded,
workspace_id,
show_breadcrumbs: TerminalSettings::get_global(cx).toolbar.breadcrumbs,
block_below_cursor: None,
@ -381,7 +384,6 @@ impl TerminalView {
return;
}
}
self.terminal.update(cx, |term, _| term.scroll_wheel(event));
}
@ -1377,6 +1379,7 @@ impl Render for TerminalView {
focused,
self.should_show_cursor(focused, cx),
self.block_below_cursor.clone(),
self.embedded,
))
.when_some(self.render_scrollbar(cx), |div, scrollbar| {
div.child(scrollbar)
@ -1502,6 +1505,7 @@ impl Item for TerminalView {
self.workspace.clone(),
workspace_id,
self.project.clone(),
false,
window,
cx,
)
@ -1659,6 +1663,7 @@ impl SerializableItem for TerminalView {
workspace,
Some(workspace_id),
project.downgrade(),
false,
window,
cx,
)