You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mdviewer): fix flaky md editor tests and md-to-html switch regression
- Save scroll position before hiding md iframe (panel close / HTML switch)
so it can be restored on reopen. Wrapped in try-catch to handle sandboxed
cross-origin iframe access that was causing a SecurityError and breaking
the md-to-html preview switch entirely.
- Flush (not cancel) pending debounced content-change in handleSwitchFile
and handleSetContent so outgoing file edits are preserved in cache, preventing
data loss when users switch files within the 50ms debounce window.
- Tag mdviewrContentChanged messages with filePath so MarkdownSync can
verify the change matches the active document, preventing stale edits
from a previous file from modifying the wrong CM document.
- Guard MarkdownSync._onIframeContentChanged against stale content changes
arriving after document close (null CM check + filePath mismatch check).
- Guard doc-cache.saveActiveScrollPos against overwriting saved non-zero
scroll with 0 after browser resets scrollTop on hide/show.
- Fix _waitForMdPreviewReady in all 4 md test files: increase timeout from
default 2s to 5s, re-read editor content each poll iteration so comparison
adapts to async content sync that may modify the document.
0 commit comments