Repository navigation
[3/5] feat(muya): add read-only document mode - #5801
Merged
Merged
Conversation
This was referenced Oct 20, 2026
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 08:54
ed4beec to
8723cec
Compare
Jocs
force-pushed
the
split/muya-code-copy-feedback
branch
from
October 20, 2026 08:54
8afb5e6 to
3376f57
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 09:11
8723cec to
f61f872
Compare
Jocs
force-pushed
the
split/muya-code-copy-feedback
branch
2 times, most recently
from
October 20, 2026 09:23
ade176c to
97454e9
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 09:23
f61f872 to
5320df4
Compare
Jocs
force-pushed
the
split/muya-code-copy-feedback
branch
from
October 20, 2026 09:25
97454e9 to
7a9f072
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 09:25
5320df4 to
8507714
Compare
Jocs
force-pushed
the
split/muya-code-copy-feedback
branch
from
October 20, 2026 09:37
7a9f072 to
6e56326
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
2 times, most recently
from
October 20, 2026 09:52
615f06e to
988d1bd
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
6 times, most recently
from
October 20, 2026 13:39
223e5b2 to
8996812
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 13:45
8996812 to
2a470b3
Compare
This was referenced Oct 21, 2026
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.
Relates to #3688, #4532, #3745. Split from #5793, which stays open as layer 5.
Review stack
Review and merge in this order. Each PR targets the preceding branch, so its Files changed tab contains only its own layer.
After a preceding PR merges, retarget/rebase its successor onto
developbefore merging it. Keep intermediate branches until their downstream PR has been retargeted. #5793 is the original PR, retained and reused.Summary
Add Muya read-only document mode: guard mutations and async targets while allowing host document loads, preserve rendered content and Markdown source copying, follow links, open diagram previews, and disable paragraph dragging. Include the engine API, interaction regressions and all supported engine locales.
Type of change
Test plan
Notes for reviewers
Layer 3/5 of a linear PR stack. Review the diff against this PR’s base branch; merge in order. The next layer is rebased/retargeted after this one lands.
Follow-up review
Removed the redundant link-preparation pass before the reading presentation rerender; keep preparation after rendering. Full Muya suite: 2793 tests passed; Chromium reading/paste regressions: 11 passed.
Changes remain in their owning layer; all five existing PRs are retained. Additional IME handling was deferred as requested.
Diagram preview state
Reading-mode activation checks the render completion flag rather than searching the DOM for SVG/image nodes. Each update resets eligibility; successful renderer completion enables preview. Tests cover successful SVG/image renders, injected DOM, loading, failure and empty content. Validation: 2793 Muya unit tests, 7 Chromium reading cases, 1 Electron diagram preview case; ESLint, types and desktop build passed.
#5799 and #5800 are merged. This PR now targets develop directly.
Setter mutation guards
Code-block language, frontmatter language and table alignment setters uniformly reject mutations when canMutate is false, including same-value assignments. Language initialization invokes separate rendering methods, preserving highlighting without granting write access. Regression tests cover indented-block promotion, same-value rendering side effects, table alignment and locked initialization. Full Muya suite: 2793 tests passed; reading-mode Chromium: 7 passed; root/Muya ESLint and Muya typecheck passed.
Shared clipboard pipeline
Reading mode uses the existing getClipboardData/writeClipboardData pipeline for normal, Markdown, HTML and rich-text copying. Removed the dedicated reading clipboard module and write branch; Markdown syntax in copied text is intentional. Reading select-all uses content-block endpoints so the existing selection resolver can consume its range. Validation: 2793 Muya unit tests, 10 Chromium reading-mode cases, root/Muya ESLint and Muya typecheck passed.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.