fix: keep markdown preview in sync on local edits#8832
Merged
mscolnick merged 2 commits intomarimo-team:mainfrom Mar 23, 2026
Merged
fix: keep markdown preview in sync on local edits#8832mscolnick merged 2 commits intomarimo-team:mainfrom
mscolnick merged 2 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a markdown preview sync issue by ensuring markdown autorun triggers on true local edit transactions while ignoring RTC sync (including initial reconciliation) and formatting-only changes, keeping preview updates consistent.
Changes:
- Annotate Loro’s initial reconciliation dispatch with the existing RTC sync annotation.
- Refactor markdown autorun gating into a reusable helper that filters by local user events, focus fallback, formatting changes, and RTC sync annotations.
- Add Vitest coverage for both RTC init-sync annotation and markdown autorun gating behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/core/codemirror/rtc/loro/sync.ts | Marks the initial reconciliation dispatch as RTC sync via loroSyncAnnotation. |
| frontend/src/core/codemirror/rtc/loro/tests/sync.test.ts | Adds a test asserting init reconciliation dispatch is annotated as RTC sync. |
| frontend/src/core/codemirror/cells/extensions.ts | Implements shouldAutorunMarkdownUpdate and updates markdown autorun to use it (including RTC sync/formatting filters). |
| frontend/src/core/codemirror/cells/tests/extensions.test.ts | Adds focused tests for markdown autorun gating logic (local events, formatting, RTC sync, predicate, focus fallback). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mscolnick
reviewed
Mar 23, 2026
mscolnick
approved these changes
Mar 23, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.21.2-dev39 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the below-illustrated markdown preview sync bug where the preview could miss the last typed character or stay stale after local edits.
last-char-md-sync.mp4.mov
Details
input,delete,undo,redo)