Skip to content

markdown: Round inline code backgrounds across all markdown surfaces - #63272

Merged
macraig merged 7 commits into
mainfrom
agent-panel-rounded-inline-code
Aug 28, 2026
Merged

markdown: Round inline code backgrounds across all markdown surfaces#63272
macraig merged 7 commits into
mainfrom
agent-panel-rounded-inline-code

Conversation

@macraig

@macraig macraig commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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

  • 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:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments (there are none)
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • 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.

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.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 26, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Aug 26, 2026

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@JosephTLyons

JosephTLyons commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Yeah, I think rounding it everywhere would be good. Seems fine outside of that tweak.

@macraig macraig changed the title markdown: Round inline code backgrounds in the agent panel markdown: Round inline code backgrounds in the agent panel and editor popovers Aug 26, 2026
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.
@macraig macraig changed the title markdown: Round inline code backgrounds in the agent panel and editor popovers markdown: Round inline code backgrounds across all markdown surfaces Aug 26, 2026
@macraig

macraig commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Applied the changes

@macraig
macraig requested a review from MrSubidubi August 27, 2026 12:32

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for following that one up!

@Arcitec

Arcitec commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Unified rounded corners around markdown code chips. Fantastic idea. Thanks!

@macraig
macraig added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 9e9b13c Aug 28, 2026
34 checks passed
@macraig
macraig deleted the agent-panel-rounded-inline-code branch August 28, 2026 17:17
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants