obsidianmd/obsidian-api

Bug: navigable ItemView can't have history

pjeby opened this issue · 2 comments

pjeby commented

Steps to reproduce:

  • Create a navigable ItemView, with commands to set different states
  • History should work when you navigate, but it doesn't.

ISTM that navigable should mean "has history if you assign an altered state". But it appears that in order for history to work, the ItemView setState must set the result history to true, and that property is not exposed in the API. Probably it should be?

lishid commented

navigable defines whether the view can be navigated away. It is intended for views that shouldn't be navigated (to other views) to set to false so that getLeaf and getUnpinnedLeaf can avoid picking those views.

But you are right we should probably export history in the API.

pjeby commented

Thanks!