timeline-view icon indicating copy to clipboard operation
timeline-view copied to clipboard

Save timeline in file system

Open b-camphart opened this issue 1 year ago • 7 comments

Probably related to #6, this feature would allow users to save a timeline as a json file with the applied filters, selected property, and groups. Users could then close the view, and later reopen that json file, and still have all the settings from a previous session. Effectively, this would work similarly to canvas, complete with custom .timeline file extension.

Update Aug 22, 2024:

I need to think about this a lot more, and I'm open to suggestions. I see a few options here:

  • follow the canvas pattern of creating a .timeline file (that's really just json), which the plugin would recognize.
  • follow more of a template pattern of having a folder, or possibly even a .json file, that has a list of timeline configurations
  • store the saved configs within the plugin data, which would make it opaque to users.

The Canvas Pattern

The user would have to choose to save the current timeline to a file, or all timelines would have to be files, to make this work. If the user has to choose to save it, then there's no reason that there couldn't be a "loading" feature to use a different config file. If we go the "all timelines are files" route, we'd have to remove the ribbon icon, and it changes the plugin from being a "view" of notes, and instead a special file type that only makes sense to this plugin.

Additionally, having files makes sync complicated. From other plugins I've seen in the community, working with save files that can sync can really mess some things up.

Config as a Note

Another version of this option is to use frontmatter with a special "timeline-view" property, which can have the timeline config inside of it. It removes the need for a special file type, but it encourages people to riddle their vaults with notes that are just frontmatter (this is how Longform does things).

The Template Pattern

This really just removes the need to automatically save a timeline. It's on the user to create new configs, or save the current timeline to the config folder/file. The timeline would only read a "template" once when opened, or when loaded. However, it still introduces some problems with sync, and requires users to be familiar/comfortable working with json.

Store as part of the plugin data

This option removes the need for users to work with json, but re-introduces the feature complexity of saving the timeline. It also hides some data that the user created (filter and group queries) from them, meaning they would be gone if the user removed the plugin.

b-camphart avatar Jan 28 '24 03:01 b-camphart