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
This commit is contained in:
Danilo Leal authored and GitHub committed 2026-04-24 12:47:29 +00:00
1 parent 71f14685a5
commit 1bf8de0a4b
1 file changed
+28
+28
View File
@@ -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()
}
}