-
Notifications
You must be signed in to change notification settings - Fork 6k
agent_ui: Use agent font size tokens for thread markdown rendering #41610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
agent_ui: Use agent font size tokens for thread markdown rendering #41610
Conversation
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]>
|
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 check |
|
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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
danilo-leal
left a comment
There was a problem hiding this 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!
…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   --------- Co-authored-by: Danilo Leal <[email protected]>
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 :) |
…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   --------- Co-authored-by: Danilo Leal <[email protected]>
Release Notes:
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:
agent_buffer_code_font_sizesetting toThemeSettingsContent,ThemeSettings, and the default settings JSON, allowing users to specify the font size for code blocks in agent responses. [1] [2] [3]agent_buffer_code_font_sizesetting.Font size application in agent UI:
thread_view.rsto use the newagent_buffer_code_font_sizefor code blocks, and to fall back to the agent UI font size if unset. [1] [2]ThemeSettingsto retrieve the code block font size, with fallback logic to ensure a value is always used.Example Screenshots