[4/5] feat: integrate per-tab document modes and protected saves by Jocs · Pull Request #5802 · marktext/marktext · GitHub
Skip to content

[4/5] feat: integrate per-tab document modes and protected saves - #5802

Merged
Jocs merged 1 commit into
developfrom
split/marktext-document-mode
Oct 20, 2026
Merged

Jocs merged 1 commit into
developfrom
split/marktext-document-mode

Conversation

@Jocs

@Jocs Jocs commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

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:

  • Desktop unit suite: 107 files / 1154 tests passed.
  • Electron reading-mode and existing source undo/caret/save-marker regressions: 18 passed on macOS.
  • The identical-content source-tab regression fails against the previous implementation and passes with the fix.
  • ESLint, typecheck and desktop build passed.

Targets develop after 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.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

@Jocs
Jocs force-pushed the split/muya-reading-mode branch from 8723cec to f61f872 Compare October 20, 2026 09:11
@Jocs
Jocs force-pushed the split/marktext-document-mode branch 2 times, most recently from 7916492 to 1ae6697 Compare October 20, 2026 09:23
@Jocs
Jocs force-pushed the split/muya-reading-mode branch from f61f872 to 5320df4 Compare October 20, 2026 09:23
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from 1ae6697 to caec78a Compare October 20, 2026 09:25
@Jocs
Jocs force-pushed the split/muya-reading-mode branch from 5320df4 to 8507714 Compare October 20, 2026 09:25
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from caec78a to a0403d9 Compare October 20, 2026 09:37
@Jocs
Jocs force-pushed the split/muya-reading-mode branch 2 times, most recently from 615f06e to 988d1bd Compare October 20, 2026 09:52
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from a0403d9 to 74bbad0 Compare October 20, 2026 09:52
@Jocs
Jocs force-pushed the split/muya-reading-mode branch from 988d1bd to 6814f27 Compare October 20, 2026 09:57
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from 74bbad0 to 2faeaf5 Compare October 20, 2026 09:58
@Jocs
Jocs force-pushed the split/muya-reading-mode branch from 6814f27 to 5a93018 Compare October 20, 2026 10:11
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from 2faeaf5 to 7f6545b Compare October 20, 2026 10:11
@Jocs
Jocs force-pushed the split/muya-reading-mode branch from 5a93018 to 8a327c9 Compare October 20, 2026 10:15
@Jocs
Jocs force-pushed the split/marktext-document-mode branch 2 times, most recently from 39b4068 to a48c98a Compare October 20, 2026 10:22
@Jocs
Jocs force-pushed the split/muya-reading-mode branch from 8a327c9 to abbd4c1 Compare October 20, 2026 10:22
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from a48c98a to 13022a2 Compare October 20, 2026 13:22
@Jocs
Jocs force-pushed the split/muya-reading-mode branch 2 times, most recently from 223e5b2 to 8996812 Compare October 20, 2026 13:39
@Jocs
Jocs force-pushed the split/marktext-document-mode branch 2 times, most recently from bff2cdb to 8403db9 Compare October 20, 2026 13:45
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from 8403db9 to 3d4b2b9 Compare October 20, 2026 14:14
@Jocs
Jocs changed the base branch from split/muya-reading-mode to develop October 20, 2026 14:14
@Jocs
Jocs force-pushed the split/marktext-document-mode branch 2 times, most recently from 5bbbae7 to 663fe06 Compare October 20, 2026 15:04
@Jocs
Jocs force-pushed the split/marktext-document-mode branch from 663fe06 to ed6369d Compare October 20, 2026 15:13
@Jocs
Jocs merged commit ba03411 into develop Oct 20, 2026
13 checks passed
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.

1 participant