Skip to content

Yield to the event loop while building Markdown and composing widgets - #129

Merged
trissim merged 2 commits into
mainfrom
fix/cooperative-markdown-construction-20261008
Oct 8, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/cooperative-markdown-construction-20261008

Conversation

@trissim

@trissim trissim commented Oct 8, 2026 •

Copy link
Copy Markdown

Markdown built up to 200 root blocks in one go, and App and Widget compose collected all children without letting the event loop run. compose.py now has compose_async, which shares one traversal with compose but sleeps for a loop turn between children, and app.py and widget.py use it. Markdown construction in _markdown.py yields between tokens and mounts each root before building the next, and the unused synchronous _build_from_source is removed. Tests are added to test_markdown.py and test_mount.py.

Copilot AI balanced review requested due to automatic review settings October 8, 2026 22:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trissim
trissim merged commit 3918b89 into main Oct 8, 2026
0 of 22 checks passed
@trissim trissim changed the title Cooperate during private Markdown construction and composition Yield to the event loop while building Markdown and composing widgets Oct 11, 2026
@trissim
trissim deleted the fix/cooperative-markdown-construction-20261008 branch October 11, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants