From a02616374604492fe884ae456139adfab7a44865 Mon Sep 17 00:00:00 2001
From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Date: Tue, 2 Sep 2025 13:26:56 -0300
Subject: [PATCH] inline assistant: Adjust completion menu item font size
(#37375)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now the @ completion menu items font size respect/match the buffer's
font size, as opposed to being rendered a bit bigger.
| Before | After |
|--------|--------|
|
|
|
Release Notes:
- inline assistant: Improved @-mention menu item font size, better
matching the buffer's font size.
---
crates/agent_ui/src/inline_prompt_editor.rs | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/crates/agent_ui/src/inline_prompt_editor.rs b/crates/agent_ui/src/inline_prompt_editor.rs
index 3abefac8e8964ffdddc1397132541d0056f33ea8..d268c2f21154ee0dae5eeab1e35a900f6b773d69 100644
--- a/crates/agent_ui/src/inline_prompt_editor.rs
+++ b/crates/agent_ui/src/inline_prompt_editor.rs
@@ -93,8 +93,8 @@ impl Render for PromptEditor {
};
let bottom_padding = match &self.mode {
- PromptEditorMode::Buffer { .. } => Pixels::from(0.),
- PromptEditorMode::Terminal { .. } => Pixels::from(8.0),
+ PromptEditorMode::Buffer { .. } => rems_from_px(2.0),
+ PromptEditorMode::Terminal { .. } => rems_from_px(8.0),
};
buttons.extend(self.render_buttons(window, cx));
@@ -762,20 +762,22 @@ impl PromptEditor {
)
}
- fn render_editor(&mut self, window: &mut Window, cx: &mut Context) -> AnyElement {
- let font_size = TextSize::Default.rems(cx);
- let line_height = font_size.to_pixels(window.rem_size()) * 1.3;
+ fn render_editor(&mut self, _window: &mut Window, cx: &mut Context) -> AnyElement {
+ let colors = cx.theme().colors();
div()
.key_context("InlineAssistEditor")
.size_full()
.p_2()
.pl_1()
- .bg(cx.theme().colors().editor_background)
+ .bg(colors.editor_background)
.child({
let settings = ThemeSettings::get_global(cx);
+ let font_size = settings.buffer_font_size(cx);
+ let line_height = font_size * 1.2;
+
let text_style = TextStyle {
- color: cx.theme().colors().editor_foreground,
+ color: colors.editor_foreground,
font_family: settings.buffer_font.family.clone(),
font_features: settings.buffer_font.features.clone(),
font_size: font_size.into(),
@@ -786,7 +788,7 @@ impl PromptEditor {
EditorElement::new(
&self.editor,
EditorStyle {
- background: cx.theme().colors().editor_background,
+ background: colors.editor_background,
local_player: cx.theme().players().local(),
text: text_style,
..Default::default()