Repository navigation
0.2.1
Fixed
The preview no longer reloads itself for no reason.
A console dump from real use showed the preview frontend initialising three times: twice against the same port, then once against a new one. The third is expected — changing the theme restarts the task. The first two were a bug.
Obsidian may call onOpen and setState in either order and both trigger a render, and nothing compared the resolved URL against what the frame was already showing. So the frame was torn down and rebuilt against an identical URL: two megabytes of preview frontend re-downloaded and its WebAssembly re-initialised to display what was already on screen.
Renders are now serialised, so two concurrent ones cannot build two frames, and skipped when the URL is unchanged — which also preserves your scroll position.
Switching the preview theme now shows Reloading… rather than going blank without explanation.
Two things in that report I cannot fix
Both are now written down as R11 and R12 in docs/risks.md.
The console flood is upstream. Lines like recv diff-v1 1388 and parse 0.20 ms, rerender 2.20 ms come from Tinymist's preview frontend, not this plugin — they are prefixed (index) and served from http://127.0.0.1:<port>. Not one of those strings exists in the built main.js. This plugin's logging is prefixed [tinymist: and is off below warn by default, so filtering the console on [tinymist: shows only its output.
It cannot be silenced from here: the preview runs in a cross-origin iframe on purpose, because that boundary is what keeps rendered documents away from Obsidian's DOM and APIs. The one technique that would work — patching the HTML and serving it from a blob — would move the frame into Obsidian's own origin and destroy that isolation. Quieter logs are not worth it.
The theme reload is inherent, for the same reason. Colour inversion is fixed when a preview task starts, and Tinymist's ControlPlaneMessage has no message to change it afterwards. The frontend can toggle it live, but only through its own keypress handler — on the far side of the same boundary. A CSS filter: invert() on the iframe would avoid the restart and also invert every photograph and figure, which is exactly why Tinymist treats images separately.
Both would be fixed by upstream changes, and both are worth asking for.
Requires Tinymist 0.13.0 or newer, installed separately. Obsidian 1.13.0+, desktop only.
Full changelog: 0.2.0...0.2.1