Skip to content

feat: #4940 add automatic reload preference - #5174

Closed
cyppe wants to merge 1 commit into
marktext:developfrom
cyppe:feat/4940-auto-reload
Closed

cyppe wants to merge 1 commit into
marktext:developfrom
cyppe:feat/4940-auto-reload

Conversation

@cyppe

@cyppe cyppe commented Aug 23, 2026

Copy link
Copy Markdown

Closes #4940

Summary

  • Add a default-off Auto Reload preference under General → File Changes.
  • Silently reload external disk changes only when the open tab has no unsaved edits.
  • Keep the existing confirmation prompt for dirty tabs, so external content never overwrites unsaved work.
  • Preserve the current auto-save behavior and document the new autoReload preference.

Auto Reload preference enabled

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added (or explain why not needed)
  • Manually tested on: Linux

Commands run:

  • pnpm run lint (0 errors; existing repository warnings remain)
  • pnpm run typecheck
  • pnpm -C packages/desktop exec vitest run
  • pnpm -C packages/desktop exec playwright test test/e2e/external-reload-undo.spec.ts
  • pnpm run build:unpack

The Preferences UI was also exercised in Electron to verify that the new switch renders, defaults to off, and can be enabled.

Notes for reviewers [optional]

autoReload defaults to false for backward compatibility. When enabled, only clean tabs reload automatically; tabs with unsaved edits continue to show the existing reload notification.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@Jocs

Jocs commented Sep 4, 2026

Copy link
Copy Markdown
Member

I’d prefer not to add extra setting options that could increase the cognitive load for users. Instead, we can keep the logic simple: if the user hasn’t made any changes, just reload the file directly. If the file has been modified, show a prompt asking the user what to do.

@Jocs Jocs added the 🛑 blocked This issue or PR is blocked by other issue label Sep 4, 2026
@Jocs Jocs closed this Sep 15, 2026
@dronov-dmitry

dronov-dmitry commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

@Jocs

Adding my voice — I'd really like to see this land.

My use case: the markdown files I keep open in MarkText are updated by external processes all the time (sync/scripts writing into the folder), so the "has been changed on disk" prompt pops up constantly. Since the open tab usually holds local edits, the clean-tab path doesn't help me, and clicking through the dialog every time gets old very quickly. A default-off switch I can turn on would be enough for my workflow.

I understand the concern about cognitive load — a single default-off toggle in Preferences seems like a small price for this, and it doesn't change anything for users who never touch it. (Offering it right from the reload prompt, as suggested in #4940, would also keep it out of the way.)

Happy to help test or re-implement if the direction changes.

One more thought on the cognitive load argument: having to click the confirmation button on every external file update is no less cognitive load — and quite possibly more — than one extra switch in Preferences. The switch is a one-time cost you forget about afterwards, while the dialog demands attention (and a decision) over and over again for as long as the file keeps changing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛑 blocked This issue or PR is blocked by other issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]

3 participants