Skip to content

Conversation

@machr
Copy link
Contributor

@machr machr commented Oct 31, 2025

Release Notes:

  • N/A

Previously, agent markdown rendering used hardcoded font sizes (TextSize::Default and TextSize::Small) which ignored the agent_ui_font_size and agent_buffer_font_size settings. This updates the markdown style to respect these settings.

This pull request adds support for customizing the font size of code blocks in agent responses, making it possible to set a distinct font size for code within the agent panel. The changes ensure that if the new setting is not specified, the font size will fall back to the agent UI font size, maintaining consistent appearance.

(I am a frontend developer without any Rust knowledge so this is co-authored with Claude Code)

Theme settings extension:

  • Added a new agent_buffer_code_font_size setting to ThemeSettingsContent, ThemeSettings, and the default settings JSON, allowing users to specify the font size for code blocks in agent responses. [1] [2] [3]
  • Updated the VSCode import logic to recognize and import the new agent_buffer_code_font_size setting.

Font size application in agent UI:

  • Modified the agent UI rendering logic in thread_view.rs to use the new agent_buffer_code_font_size for code blocks, and to fall back to the agent UI font size if unset. [1] [2]
  • Implemented a helper method in ThemeSettings to retrieve the code block font size, with fallback logic to ensure a value is always used.
  • Updated the settings application logic to propagate the new code block font size setting throughout the theme system.

Example Screenshots

Screenshot 2025-10-31 at 12 38 28
Screenshot 2025-10-31 at 12 37 45

machr added 2 commits October 31, 2025 12:18
  text

  Previously, agent markdown rendering used
  hardcoded font sizes
  (TextSize::Default and TextSize::Small) which
  ignored the
  agent_ui_font_size and agent_buffer_font_size
  settings. This
  updates the markdown style to respect these
  settings.

  🤖 Generated with [Claude
  Code](https://claude.com/claude-code)

  Co-Authored-By: Claude <[email protected]>
@cla-bot
Copy link

cla-bot bot commented Oct 31, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @machr on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@machr
Copy link
Contributor Author

machr commented Oct 31, 2025

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Oct 31, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @machr on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot
Copy link

cla-bot bot commented Oct 31, 2025

The cla-bot has been summoned, and re-checked this pull request!

@machr
Copy link
Contributor Author

machr commented Oct 31, 2025

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 31, 2025
@cla-bot
Copy link

cla-bot bot commented Oct 31, 2025

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title fix: use agent font size settings for markdown text Use agent font size settings for markdown text Oct 31, 2025
@danilo-leal danilo-leal self-assigned this Oct 31, 2025
@SomeoneToIgnore SomeoneToIgnore added the ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Oct 31, 2025
@danilo-leal danilo-leal changed the title Use agent font size settings for markdown text agent_ui: Use agent font size tokens for thread markdown rendering Nov 1, 2025
Copy link
Member

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

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

Thank you for opening this PR! I actually think we don't need one more font size token for the agent panel (agent_buffer_code_font_size) and could just instead simplify and rely on agent_buffer_font_size. Pushed that change and the diff gets much simpler :) Thanks again!

@danilo-leal danilo-leal merged commit d6b58bb into zed-industries:main Nov 1, 2025
52 of 56 checks passed
scorphus pushed a commit to scorphus/zed that referenced this pull request Nov 1, 2025
…ed-industries#41610)

Release Notes:

- N/A

--- 

Previously, agent markdown rendering used hardcoded font sizes
(TextSize::Default and TextSize::Small) which ignored the
agent_ui_font_size and agent_buffer_font_size settings. This updates the
markdown style to respect these settings.

This pull request adds support for customizing the font size of code
blocks in agent responses, making it possible to set a distinct font
size for code within the agent panel. The changes ensure that if the new
setting is not specified, the font size will fall back to the agent UI
font size, maintaining consistent appearance.

(I am a frontend developer without any Rust knowledge so this is
co-authored with Claude Code)


**Theme settings extension:**

* Added a new `agent_buffer_code_font_size` setting to
`ThemeSettingsContent`, `ThemeSettings`, and the default settings JSON,
allowing users to specify the font size for code blocks in agent
responses.
[[1]](diffhunk://#diff-a3bba02a485aba48e8e9a9d85485332378aa4fe29a0c50d11ae801ecfa0a56a4R69-R72)
[[2]](diffhunk://#diff-aed3a9217587d27844c57ac8aff4a749f1fb1fc5d54926ef5065bf85f8fd633aR118-R119)
[[3]](diffhunk://#diff-42e01d7aacb60673842554e30970b4ddbbaee7a2ec2c6f2be1c0b08b0dd89631R82-R83)
* Updated the VSCode import logic to recognize and import the new
`agent_buffer_code_font_size` setting.

**Font size application in agent UI:**

* Modified the agent UI rendering logic in `thread_view.rs` to use the
new `agent_buffer_code_font_size` for code blocks, and to fall back to
the agent UI font size if unset.
[[1]](diffhunk://#diff-f73942e8d4f8c4d4d173d57d7c58bb653c4bb6ae7079533ee501750cdca27d98L5584-R5584)
[[2]](diffhunk://#diff-f73942e8d4f8c4d4d173d57d7c58bb653c4bb6ae7079533ee501750cdca27d98L5596-R5598)
* Implemented a helper method in `ThemeSettings` to retrieve the code
block font size, with fallback logic to ensure a value is always used.
* Updated the settings application logic to propagate the new code block
font size setting throughout the theme system.


### Example Screenshots
![Screenshot 2025-10-31 at 12 38
28](https://github.com/user-attachments/assets/cbc34232-ab1f-40bf-a006-689678380e47)
![Screenshot 2025-10-31 at 12 37
45](https://github.com/user-attachments/assets/372b5cf8-2df8-425a-b052-12136de7c6bd)

---------

Co-authored-by: Danilo Leal <[email protected]>
@machr
Copy link
Contributor Author

machr commented Nov 2, 2025

Thank you for opening this PR! I actually think we don't need one more font size token for the agent panel (agent_buffer_code_font_size) and could just instead simplify and rely on agent_buffer_font_size. Pushed that change and the diff gets much simpler :) Thanks again!

Awesome, I should have looked a bit closer at the patterns and maybe asked in the Discord. Thanks for helping me get it across the finish line :)

tomatitito pushed a commit to tomatitito/zed that referenced this pull request Nov 7, 2025
…ed-industries#41610)

Release Notes:

- N/A

--- 

Previously, agent markdown rendering used hardcoded font sizes
(TextSize::Default and TextSize::Small) which ignored the
agent_ui_font_size and agent_buffer_font_size settings. This updates the
markdown style to respect these settings.

This pull request adds support for customizing the font size of code
blocks in agent responses, making it possible to set a distinct font
size for code within the agent panel. The changes ensure that if the new
setting is not specified, the font size will fall back to the agent UI
font size, maintaining consistent appearance.

(I am a frontend developer without any Rust knowledge so this is
co-authored with Claude Code)


**Theme settings extension:**

* Added a new `agent_buffer_code_font_size` setting to
`ThemeSettingsContent`, `ThemeSettings`, and the default settings JSON,
allowing users to specify the font size for code blocks in agent
responses.
[[1]](diffhunk://#diff-a3bba02a485aba48e8e9a9d85485332378aa4fe29a0c50d11ae801ecfa0a56a4R69-R72)
[[2]](diffhunk://#diff-aed3a9217587d27844c57ac8aff4a749f1fb1fc5d54926ef5065bf85f8fd633aR118-R119)
[[3]](diffhunk://#diff-42e01d7aacb60673842554e30970b4ddbbaee7a2ec2c6f2be1c0b08b0dd89631R82-R83)
* Updated the VSCode import logic to recognize and import the new
`agent_buffer_code_font_size` setting.

**Font size application in agent UI:**

* Modified the agent UI rendering logic in `thread_view.rs` to use the
new `agent_buffer_code_font_size` for code blocks, and to fall back to
the agent UI font size if unset.
[[1]](diffhunk://#diff-f73942e8d4f8c4d4d173d57d7c58bb653c4bb6ae7079533ee501750cdca27d98L5584-R5584)
[[2]](diffhunk://#diff-f73942e8d4f8c4d4d173d57d7c58bb653c4bb6ae7079533ee501750cdca27d98L5596-R5598)
* Implemented a helper method in `ThemeSettings` to retrieve the code
block font size, with fallback logic to ensure a value is always used.
* Updated the settings application logic to propagate the new code block
font size setting throughout the theme system.


### Example Screenshots
![Screenshot 2025-10-31 at 12 38
28](https://github.com/user-attachments/assets/cbc34232-ab1f-40bf-a006-689678380e47)
![Screenshot 2025-10-31 at 12 37
45](https://github.com/user-attachments/assets/372b5cf8-2df8-425a-b052-12136de7c6bd)

---------

Co-authored-by: Danilo Leal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants