Use case or problem
Back and Forward in a tab re-render the note from scratch: Obsidian reads the Markdown, renders every section, runs embeds and Bases queries, then restores the scroll position. Meanwhile the pane is blank or shows the top of the note, then jumps.
Measured on a Mac (1.14.4) with an ordinary note that has a Bases gallery: the page appeared at 131 ms, jumped to the wrong place at 174 ms, then again at 202 ms, and ended 85 px from where I left it. On iOS it’s slower, and without CSS scroll anchoring the place is often wrong (see the bug report named below). Browsers solved this long ago with the back-forward cache.
Proposed solution
When a tab navigates away from a note, keep a still, non-interactive copy of its rendered page, attached to that history entry. On Back/Forward:
- Show the copy at once, at the saved scroll position.
- Re-render the note underneath, as today.
- Swap to the live page in one frame once it is drawn at the same place and has stopped moving (embeds, Bases cards, images).
- Let touches through to the live page once it’s ready, so a swipe right after Back isn’t swallowed.
Drop the copy when the note or anything it embeds has changed, when the pane was resized, after some time, or under memory pressure; Back then works as it does today. The same could make reopening a recently visited note instant.
This is cheaper than keeping whole views alive: a copy is plain DOM with no plugins, editors or queries running.
Current workaround (optional)
A local plugin that does this for one note in Reading view: Back shows the copy within 10–20 ms on a Mac, and the live page takes over at about 0.4 s with nothing moving. What it took:
- The copy must keep any CSS that depends on what the pane shows (container queries,
:has()on the leaf), or it renders differently for a moment. - The live page must land exactly where the copy is. With the reading view’s partial drawing, this needed the note to be drawn whole (see the bug report below).
- The swap waits for a still screen: on iOS, Bases kept adjusting cards for a few frames after the page looked ready.
It works, but it depends on internal methods (WorkspaceLeaf.setViewState, the reading view’s applyScrollDelayed and updateVirtualDisplay), so any update can break it. A built-in version would be far more robust.
Related feature requests (optional)
- “Remember Restore document position / scroll position / cursor / note position” (topic 962): about restoring the position when a note is opened, not on Back.
- My bug report “Reading view: Back returns to the top of an embedded Bases view instead of where you were” (topic 119839), why the swap is hard to get exact today.