From aab02a4166fd40a576ef52245fc399ab114c76c0 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 25 Mar 2025 16:55:42 -0300 Subject: [PATCH] Fix color swatch shrinking in the LSP completion menu (#27450) ### Before Note how in the second time I try to add a color property, the color swatch is shrunk. https://github.com/user-attachments/assets/677a37b2-8ae4-408d-8dea-d9cc4bc2e119 ### After https://github.com/user-attachments/assets/aa902573-1f44-48e1-a396-e22ad5703155 Release Notes: - Fixed color swatches shrinking upon re-adding a color-related property. --- crates/editor/src/code_context_menus.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rs index 89d47af0d37fcc7637f3d888775c4ba6af749e5c..0908ad48fbdd6c9f1b9bad0af1d967b6e865ad1c 100644 --- a/crates/editor/src/code_context_menus.rs +++ b/crates/editor/src/code_context_menus.rs @@ -543,7 +543,14 @@ impl CompletionsMenu { let start_slot = completion .color() - .map(|color| div().size_4().bg(color).rounded_xs().into_any_element()) + .map(|color| { + div() + .flex_shrink_0() + .size_3p5() + .rounded_xs() + .bg(color) + .into_any_element() + }) .or_else(|| { completion.icon_path.as_ref().map(|path| { Icon::from_path(path)