Outline does not remember state between restarts

Use case or problem

Currently, the document outline does not remember its state regarding folding between restarts.

I have a few longer documents with several sections and subsections. I actively work on only a few of the sections at a period of time, for some I just want to look up stuff there and many are irrelevant. The outline really helps when looking stuff up, but the sections that are momentarily irrelevant often get in the way. So I collapse them. And again on the next day :sweat_smile: It’s not tragic but a bit annoying nonetheless.

Proposed solution

You guessed it: Save the state of the outline between restarts. Either as part of the current workspace or as meta information attached to the document (same as for the folding state).

Workaround

This could be worked around by using the outline or document search. I find that argument weak because you could also employ it to the existence of the outline. Also I don’t always know what to search for, but seeing the headings I’d know which to pick.

Related feature requests

The FR below is probably the better option and easier to implement, since folding is already remembered for notes and all you have to do is copy that state to the outline. The only benefit I could see in my FR is that it allows having different folding states in the document and the outline, but I don’t know whether there is a proper use case for that.

This FR is a duplicate of the FR below which was merged with another (implemented) FR as an implementation detail that sadly never made it.

Edit: There also seems to be a regression. The FR below was said to be implemented but the same issue occurs for me on v1.5.3. Also it mentions relaunching in the title, which I overlooked in my original search. So maybe this should be transformed into a bug report?

6 Likes

I tested once each (without following the debugging steps) on MacOS, where the outline was forgotten, and iOS, where it was remembered.

Thx for bringing this up. I observed the ā€œforget state between launchesā€-issue on Linux in a new vault. I observed the ā€œexpand on editā€-issue in an existing vault but did not try it in a new one.

On Linux, folded state in the outline is reliably forgotten simply by deleting a paragraph in Source mode.

I’ve also seen mismatched folding states in Source mode - the heading showing as folded (> and the ... at the end), but the text within expanded.

I’d be happy to construct a minimal repro test case and screencast if the team has the bandwidth and priority to fix these issues, just let me know.

Adding to the outline cache issues:

On Mac, if you search for a term in the outline plugin and then delete the search, and restart Obsidian, the previous term that you searched for will come back to the search field, requiring you to keep deleting search terms to use the plugin properly.

That might be worth reporting separately as a bug.

Reported this separately at Outline tab does not stay collapsed and scrolls while typing (expands, unfolds headings) - #25 by dandv

@CawlinTeffid I’ll file a separate report when I encounter this reliably again.