ZotLit rerenders Reading view on metadata changes, resetting embedded Bases state #993
ZotLit version2.1.2 Host application versionsObsidian 1.13.7, Zotero 10.0.1, macOS 26.6.2 Obsidian debug infoReproduces in a sandbox vault?No Steps to reproduce
The same setup does not exhibit the issue in Live Preview. It also stops exhibiting the issue when ZotLit is disabled. Expected behaviorOnly the edited property and the corresponding Base data should update. The parent Reading view should not be recreated, and its scroll position and the currently selected Base view should remain unchanged. Actual behaviorToggling the checkbox causes the entire parent Reading view to rerender. The page visibly flickers, the scroll position jumps to the top, and the embedded Base returns to the view specified in the embed instead of preserving the view selected by the user. This happens after every checkbox/property change, making an embedded Base difficult to use in Reading view. Logs or screenshotsRuntime instrumentation shows that immediately after Obsidian emits previewMode.rerender(true)Observed call stack: In ZotLit's bundled code, function jI(app) {
let count = 0;
for (const leaf of app.workspace.getLeavesOfType("markdown")) {
const { view } = leaf;
if (view instanceof MarkdownView) {
view.previewMode.rerender(true);
count += 1;
}
}
return count;
}The rerender appears to be unconditional, including when formatted wikilink citations are disabled. As a control test, only
This indicates that the full Reading view rerender initiated by ZotLit is the direct cause of the state reset. A possible fix would be to avoid globally rerendering every Markdown Reading view and instead update only affected citation elements or affected files. |
Replies: 1 comment
|
should be fixed in 2.1.3 |
should be fixed in 2.1.3