markdown: Round inline code backgrounds across all markdown surfaces - #63272
Merged
Conversation
Inline code chips were introduced for the Markdown preview but left disabled for the agent panel, which renders through the same crate. Resolve the corner radius with one match over MarkdownFont so the value is defined in a single place, and keep editor-embedded markdown square.
MrSubidubi
requested changes
Aug 26, 2026
MrSubidubi
left a comment
Member
There was a problem hiding this comment.
Is there a good reason that we not round it in editor popovers? Does this not just introduce another inconsistency like the one we want to fix with this PR?
Collaborator
|
Yeah, I think rounding it everywhere would be good. Seems fine outside of that tweak. |
Hover popovers, notifications, and other surfaces build MarkdownStyle by hand instead of calling themed(), so rounding only inside themed() left them square. Set the radius in the Default impl instead, which every style inherits unless it overrides it.
Contributor
Author
|
Applied the changes |
JosephTLyons
approved these changes
Aug 27, 2026
MrSubidubi
approved these changes
Aug 27, 2026
MrSubidubi
left a comment
Member
There was a problem hiding this comment.
I think it would probably be best to just inline it and remove the option to configure it, but don't consider it blocking here.
MrSubidubi
approved these changes
Aug 28, 2026
MrSubidubi
left a comment
Member
There was a problem hiding this comment.
Nice, thanks for following that one up!
Contributor
|
Unified rounded corners around markdown code chips. Fantastic idea. Thanks! |
playdohface
pushed a commit
to playdohface/zed
that referenced
this pull request
Aug 29, 2026
…ed-industries#63272) # Objective Inline code renders as a rounded chip in the Markdown preview (zed-industries#63118) but as a square, full-line-height background everywhere else — the agent panel, editor hover popovers, notifications, and other markdown surfaces. ## Solution Inline code with a background color now always renders as a chip with a 4 px corner radius. The radius is fixed at the paint site rather than exposed through `MarkdownStyle`, so every markdown surface uses the same rendering without carrying configuration through the element builder and rendered lines. Chip backgrounds and text styling remain configurable. Only the corner radius is fixed, removing the alternative square rendering path and preventing surfaces from becoming inconsistent. ## Testing - Updated `test_inline_code_chips_cover_exactly_the_code_span_glyphs` to cover the fixed chip behavior. - `cargo test -p markdown test_inline_code_chips_cover_exactly_the_code_span_glyphs` - `./script/clippy -p markdown` ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments (there are none) - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Improved inline code to render with rounded backgrounds across all markdown surfaces, matching the Markdown preview. --------- Co-authored-by: MrSubidubi <finn@zed.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Inline code renders as a rounded chip in the Markdown preview (#63118) but as a square, full-line-height background everywhere else — the agent panel, editor hover popovers, notifications, and other markdown surfaces.
Solution
Inline code with a background color now always renders as a chip with a 4 px corner radius. The radius is fixed at the paint site rather than exposed through
MarkdownStyle, so every markdown surface uses the same rendering without carrying configuration through the element builder and rendered lines.Chip backgrounds and text styling remain configurable. Only the corner radius is fixed, removing the alternative square rendering path and preventing surfaces from becoming inconsistent.
Testing
test_inline_code_chips_cover_exactly_the_code_span_glyphsto cover the fixed chip behavior.cargo test -p markdown test_inline_code_chips_cover_exactly_the_code_span_glyphs./script/clippy -p markdownSelf-Review Checklist:
Release Notes: