Repository navigation
[4/5] feat: integrate per-tab document modes and protected saves - #5802
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/marktext-document-mode
branch
from
October 20, 2026 08:54
1e68350 to
ddd11b5
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/marktext-document-mode
branch
2 times, most recently
from
October 20, 2026 09:23
7916492 to
1ae6697
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/marktext-document-mode
branch
from
October 20, 2026 09:25
1ae6697 to
caec78a
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/marktext-document-mode
branch
from
October 20, 2026 09:37
caec78a to
a0403d9
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/marktext-document-mode
branch
from
October 20, 2026 09:52
a0403d9 to
74bbad0
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 09:57
988d1bd to
6814f27
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
from
October 20, 2026 09:58
74bbad0 to
2faeaf5
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 10:11
6814f27 to
5a93018
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
from
October 20, 2026 10:11
2faeaf5 to
7f6545b
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 10:15
5a93018 to
8a327c9
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
2 times, most recently
from
October 20, 2026 10:22
39b4068 to
a48c98a
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
from
October 20, 2026 10:22
8a327c9 to
abbd4c1
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
from
October 20, 2026 13:22
a48c98a to
13022a2
Compare
Jocs
force-pushed
the
split/muya-reading-mode
branch
2 times, most recently
from
October 20, 2026 13:39
223e5b2 to
8996812
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
2 times, most recently
from
October 20, 2026 13:45
bff2cdb to
8403db9
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
from
October 20, 2026 14:14
8403db9 to
3d4b2b9
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
2 times, most recently
from
October 20, 2026 15:04
5bbbae7 to
663fe06
Compare
Jocs
force-pushed
the
split/marktext-document-mode
branch
from
October 20, 2026 15:13
663fe06 to
ed6369d
Compare
Zane-0x5a
added a commit
to Zane-0x5a/marktext
that referenced
this pull request
Oct 27, 2026
Brings in v0.22.0 and v0.23.0 and the start of 0.24.0: Electron 45, GitHub Alerts, foldable headings, per-tab reading mode and --read-only, the docked document outline, multiple folder roots, preview tabs, recent files in quick open, Italian, and the large-document fixes of marktext#4942 and marktext#5863. Conflicts: - muya state/inlineRenderer: marktext#4942 caches reference definitions per candidate state, which supersedes the fork's per-revision cache. Took upstream's; the fork's display math cache in mathPreview stays. - editor.vue: kept the fork's deferred content snapshot (no getState() deep clone per keystroke), document virtualization and camera, on top of upstream's reading mode, shortcut resolvers and image drop. The json-change handler keeps upstream's loadingContent/readOnly guard, the source handoff and reload take upstream's loadingContent blocks, and scrollToHeader reveals folded headings before following the target. publishContentChange uses getSelectionState(). - Print/PDF: the fork's paged preview replaces MarkdownPrint and the printToPDF export path, so printService, its specs and the pdf branch of handleResponseForExport keep the fork's side. marktext#3323 moved image resolution into the engine; exportHtml drops its own image rewrite and keeps the fork's rendered-heading TOC. - marktext#5802's assertExportDestination moves to main/filesystem so Save PDF in the preview refuses the source document too. - syntheticHistory keeps the 53-bit cyrb53 hash over upstream's BigInt FNV-64 (~6 ms per key on a 500 KB note); the store keeps isSameList and drops deep-equal. - Sidebar rows keep draggable alongside preview tabs; locales keep both printPreview and readingMode, and it.json gets the printPreview strings. Merge adjustments: - SET_READ_ONLY publishes the pending snapshot first: a read-only tab drops content changes, so an edit made within 150 ms of entering reading mode would otherwise be missing from the tab. - marktext#5798 moved notices to the bottom-right corner, over the preview's Save PDF and Print buttons, and an export notice stays while hovered. The preview lifts notices clear of its actions while it is open. - Specs: the docked outline is expanded by default and narrows the column, so the virtualization specs open it only when it is closed, measure the settled position and place their target inside the viewport. The camera specs press Control once before measuring, because since marktext#5878 the first key press re-renders the caret's heading with its marks shown. Verified on Windows 11 (175%): typecheck, lint, the desktop unit suite (1467) and the muya unit suite (3978) pass. In background windows the e2e suite (514 passed, 45 failed) fails only where a build of upstream/develop fails on this machine too (copy-anchor-link, document-outline, image clipboard/relative path, 5394, 5685, toc-active-heading, outline-layout, ...: 56 cases in 19 specs there), plus media-viewer cases that flake on both when the 1 px image's resize bar takes the click. print-preview, export-pdf, document-virtualization and sidebar-file-drag pass, and editor-camera passes on screen. reading-mode:54 needs the camera focus fix in the next commit.
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.
Existing documents can open in reading mode per tab while retaining unsaved buffers, rendered content, selection and copying. Integrate Muya's reading mode with document state, typed IPC, buffered restore and source-view handoff.
Save and Save As share the existing save handler, including the main-process write barrier and saved-content acknowledgement. Locking waits for active writes and rejects queued or stale saves. Explicit close-and-save unlocks dirty documents; external changes retain dirty buffers and suspend automatic overwrites.
Entering reading from source closes the runtime source view through its normal unmount handoff. Unlocking stays in live editing; the startup source-mode preference is unchanged. Source tabs retain independent undo histories across tab switches and later manual source entry, including tabs with identical content. New and pending documents remain editable by default. Mode-switch failures restore the editor and report the failure even if rollback IPC also fails.
Validation:
Targets
developafter merged #5799, #5800 and #5801. #5793 remains open as the downstream UI layer for switches, menus, shortcuts, tab indicators and shell localization. Reading-context and state notifications include all 12 desktop locales.