Skip to content

repl: Streamline Markdown output usage#47713

Merged
MrSubidubi merged 9 commits intozed-industries:mainfrom
rgbkrk:update-markdown-output
Jan 28, 2026
Merged

repl: Streamline Markdown output usage#47713
MrSubidubi merged 9 commits intozed-industries:mainfrom
rgbkrk:update-markdown-output

Conversation

@rgbkrk
Copy link
Collaborator

@rgbkrk rgbkrk commented Jan 27, 2026

Brought the Markdown output up to date with how Markdown is used in the Agent panel. This fixed an issue with outputs that were too large for the execution view as well as made sure that markdown would wrap.

image

Release Notes:

  • Fixed REPL output wrapping for large content
  • Fixed markdown wrapping in REPL outputs

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 27, 2026
@rgbkrk rgbkrk changed the title repl: streamline markdown output usage repl: Streamline markdown output usage Jan 27, 2026
@maxdeviant maxdeviant changed the title repl: Streamline markdown output usage repl: Streamline Markdown output usage Jan 27, 2026
@rgbkrk rgbkrk marked this pull request as draft January 27, 2026 01:08
@rgbkrk rgbkrk marked this pull request as ready for review January 27, 2026 02:48
@rgbkrk rgbkrk force-pushed the update-markdown-output branch from bc8d0a7 to 5962985 Compare January 27, 2026 03:19
Copy link
Member

@MrSubidubi MrSubidubi 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 again for pushing this forward and helping with this. Left two minor notes

)
}))
.into_any_element()
MarkdownStyle {
Copy link
Member

Choose a reason for hiding this comment

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

I think instead of duplicating this, I'd probably prefer if we were to move the default_markdown_style from the agent_ui into the markdown crate perhaps (and probably make it an associated function of MarkdownStyle even), given that we want to style these the same way anyway. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is some slight difference as default_markdown_style in the agent_ui crate uses agent_buffer_font_size and agent_ui_font_size from the theme settings. I generally agree with you though as I'd love to have markdown text content be consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Didn't notice that, thanks for mentioning it.

I took another look just now, and it might be worth to traitify fonts across the code base at some point, although that is very much a chore work I neither require nor want you to do (after all, thanks for helping here).

However, as an intermediate solution: How would you feel about moving it and have the default_markdown_style take an enum instead that covers the current 4 font types, like

enum MarkdownFont {
    AgentBuffer, AgentUi, Buffer, UI }

for the time being?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I can do that.

@MrSubidubi MrSubidubi self-assigned this Jan 27, 2026
@rgbkrk rgbkrk force-pushed the update-markdown-output branch from b376737 to 05d7682 Compare January 27, 2026 13:20
Migrate from legacy markdown_preview to modern markdown crate which has
proper text wrapping support and better styling capabilities.

Fix width constraints in output rendering:
- Add overflow_x_hidden to output area flex container to enforce bounds
- Remove size_full from execution view container (conflicts with flex_1)
- Add proper width constraints to output flex children
- Make horizontal scrolling conditional (only tables/images need it)

Update notebook cells to use modern markdown rendering with reset() method.

The modern markdown crate uses proper text layout with WhiteSpace::Normal
by default and respects width constraints when overflow is hidden.
@rgbkrk rgbkrk force-pushed the update-markdown-output branch from df8b875 to 59af71b Compare January 27, 2026 13:40
@rgbkrk
Copy link
Collaborator Author

rgbkrk commented Jan 28, 2026

Ok @MrSubidubi, I've extracted out the default_markdown_style and used it within the agent UI as well. There were a few boolean options on the default_markdown_style that I had to make some choices on:

  • buffer_font - always set to false in all call sites
  • muted_text - used in a few places

I opted to drop the leading buffer_font boolean to eliminate dead code. For muted_text I had it use a builder pattern with_muted_text so that it's easy to chain at the few invocations that use it.

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

This is awesome, I love every piece of it! Reads so much better at a glance and love that we do not have to duplicate the style anymore

Looks good to me, thanks again and thank you for the quick turnarounds!

@MrSubidubi MrSubidubi enabled auto-merge (squash) January 28, 2026 17:32
@MrSubidubi MrSubidubi merged commit 446227c into zed-industries:main Jan 28, 2026
27 checks passed
@rgbkrk rgbkrk deleted the update-markdown-output branch January 28, 2026 17:42
@rgbkrk
Copy link
Collaborator Author

rgbkrk commented Jan 28, 2026

Sadly I failed to update the release notes at the top in time. I switched them to N/A when I was in a draft state and unsure if I fully solved the Markdown output wrapping issue. Now it's fixed! If anything we could make it:

  • Fixed REPL output wrapping for large content
  • Fixed markdown wrapping in REPL outputs

I'll update above but I think it'll miss automation.

@MrSubidubi
Copy link
Member

Yeah I think you are right about the automation part - I'll notify Joseph about it for next weeks release.

@JosephTLyons
Copy link
Collaborator

JosephTLyons commented Jan 28, 2026

Release notes are only generated after the items land in a preview branch. Also, when the script does run on the preview branch, it pings up to the pull requests on GitHub to pull the latest notes—it doesn't look at what landed in the git history. So, since this PR only just hit main today, you've got a week to adjust the notes before they are picked up by the scripts. So you're all good!

@rgbkrk
Copy link
Collaborator Author

rgbkrk commented Jan 28, 2026

Thank you @JosephTLyons! I've updated it.

@rgbkrk rgbkrk added the area:repl repl, jupyter, notebooks, etc label Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:repl repl, jupyter, notebooks, etc 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