Skip to content
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

Incremental markdown parsing and various fixes #2776

Merged
merged 19 commits into from
Feb 1, 2025
Merged

Incremental markdown parsing and various fixes #2776

merged 19 commits into from
Feb 1, 2025

Conversation

hecrj
Copy link
Member

@hecrj hecrj commented Feb 1, 2025

This PR introduces a new Content type in the markdown module that allows users to incrementally parse Markdown—using its push_str method.

This is specially useful when you have potentially long Markdown streams—like an LLM reply in an AI chat application.

In fact, icebreaker has been the main driver of this feature (see hecrj/icebreaker#7):

2025-02-01.01-09-57.mp4

These changes also fix a bunch of minor issues and improve some APIs:

  • The spacing of Markdown items can be configured through markdown::Settings.
  • Big Markdown items have been split into multiple smaller ones to aid diffing and layouting.
  • Functions asking for a container::Id or scrollable::Id now uses Into generics. These types also implement From<&'static str> now.
  • text_editor no longer captures unfocus events.
  • stack now propagates mouse movements unconditionally to all layers. This allows widgets that are being interacted with to still work even when the mouse hovers layers on top.
  • rich_text now requests redraws properly when a link is hovered.
  • Horizontal scrolling with mouse wheel now requires Shift pressed.

And I think that's about it!

@hecrj hecrj added bug Something isn't working improvement An internal improvement feature New feature or request performance widget change addition fix labels Feb 1, 2025
@hecrj hecrj added this to the 0.14 milestone Feb 1, 2025
@hecrj hecrj merged commit 91f94f3 into master Feb 1, 2025
30 checks passed
@hecrj hecrj deleted the fix/markdown branch February 1, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition bug Something isn't working change feature New feature or request fix improvement An internal improvement performance widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant