Live Mode can reload the wrong tab after an external file change
Problem
Live Mode currently watches one file per window, but the watcher emits a pathless file-changed event. The frontend then reloads whichever tab is active at delivery time rather than the file that was watched.
This can overwrite unsaved edits in the active tab:
- Open
A.md, thenB.md. - Enable Live Mode while
B.mdis active, soB.mdis watched. - Switch to
A.mdand make an unsaved edit. - Modify
B.mdoutside Markpad. - The
B.mdwatcher event reloadsA.md; its in-memory buffer is replaced and its dirty state is cleared.
Root cause
src-tauri/src/window_runtime.rs emits file-changed with () and src/lib/MarkdownViewer.svelte reloads currentFile, which is derived from the active tab. The event has no way to identify the watched path.
Expected behavior
A file-change event must carry the watched path. The UI must reload only when that path is the active Live Mode document; an event for another tab must never replace the active tab's buffer.
Scope
Keep the single-watcher model. Route the watched path through the event and add a regression test for the cross-tab case.
Tracked by #296. The regression test covers path-carrying watcher events, active-tab watcher ownership, and the no-reload Live Mode toggle behavior.