Saving and restoring the collapse/expansion state?

I wonder if it would be feasible/useful for Bike file items to have something like a data-collapsed attribute ?

(So that patterns of outline collapse and expansion could be:

  1. saved and restored
  2. taken account of in translations from Bike outlines to other formats)
1 Like

I donā€™t think I want to store that state with items because you can have multiple views on the same document (File > New Window). Expand/focus state are owned by view not items.

So far Iā€™ve just been saving expanded items state using the macOS ā€œrestorable stateā€ system, so thatā€™s why state is restored, but you donā€™t see anything in file format. I can imagine also storing this view state in <head> metadata. I think that would work well for most cases, but it gets messy if you are sharing a file with someone on dropbox (which some TaskPaper users do).

I think better way to expose expanded state is through eventual scripting API.

1 Like

Got it ā€“ I hadnā€™t thought of multiple views ā€“ that sounds good.

For some reason I had thought that collapse state wasnā€™t yet being restored. I must check again : -)


thatā€™s why state is restored

Should I be seeing that in Preview build 23 ?

Yes, itā€™s using the standard ā€œrestorable stateā€ macOS system. For that to work you need to make sure that you donā€™t have System > General > ā€œClose Windows when quitting an appā€ selected. It also will only work for documents that you have left open as you quit Bike. If you close document and then quite Bike the state wonā€™t be restored.

1 Like

Got it ā€“ works fine now : -)

(I think my habit had been to āŒ˜W each file when done with it)

1 Like

In the latest preview release Bike will store expanded state even for closed documents: Bike 1.16 (Preview) - #11 by jessegrosjean

1 Like