From 1bf8de0a4b5da42018f10ccf00cd63bad4298306 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 24 Apr 2026 09:47:29 -0300 Subject: [PATCH] agent_ui: Fix markdown heading sizes (#54766) Follow up to https://github.com/zed-industries/zed/pull/54374 as that removed the custom heading styles that were mostly tailored to the agent panel. It makes sense for those values not to be the ones used for general markdown rendering, but I think it's just too big for the agent panel. So I'm sort of hijacking the `MarkdownFont::Agent` enum here so that we can set it conditionally to just the agent context. Release Notes: - N/A --- crates/markdown/src/markdown.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rs index fce79630c8..e6c046645c 100644 --- a/crates/markdown/src/markdown.rs +++ b/crates/markdown/src/markdown.rs @@ -265,6 +265,34 @@ impl MarkdownStyle { }), ..Default::default() }, + heading_level_styles: matches!(font, MarkdownFont::Agent).then_some( + HeadingLevelStyles { + h1: Some(TextStyleRefinement { + font_size: Some(rems(1.15).into()), + ..Default::default() + }), + h2: Some(TextStyleRefinement { + font_size: Some(rems(1.1).into()), + ..Default::default() + }), + h3: Some(TextStyleRefinement { + font_size: Some(rems(1.05).into()), + ..Default::default() + }), + h4: Some(TextStyleRefinement { + font_size: Some(rems(1.).into()), + ..Default::default() + }), + h5: Some(TextStyleRefinement { + font_size: Some(rems(0.95).into()), + ..Default::default() + }), + h6: Some(TextStyleRefinement { + font_size: Some(rems(0.875).into()), + ..Default::default() + }), + }, + ), ..Default::default() } }