foam icon indicating copy to clipboard operation
foam copied to clipboard

Open note command

Open riccardoferretti opened this issue 4 years ago • 0 comments

"Open note" command as building block

I would like to add a generic "Open note" command. The regular behavior of this command would be to:

  • show a list of all the notes as a quick pick list, where the user can then select what note they want to open
  • if only one note is available, open the note directly.

The command would also support the following params:

  • filterBy Notes to be displayed in the list can be filtered by different attributes, such as path, type, properties, connections, ... basically the metadata we have available in the workspace/resource and graph
  • sortBy The filtered notes will then can be sorted by various attributes, defaulting to note title

The above params would allow this command to be a building block for custom workflows, to be defined:

  • by other extensions (https://code.visualstudio.com/api/extension-guides/command#programmatically-executing-a-command)
  • via key bindings (https://code.visualstudio.com/docs/getstarted/keybindings#_command-arguments)

Possible use cases

  • Open a note of a specific type
  • Open an orphan note
  • Open a weekly note (whether using the type, or path pattern)

Other thoughts

I wonder whether this can/should also allow for the creation of the note if it doesn't exist, in which case we could also provide a reference template to use to create such note. This would allow even more powerful workflows, such as:

  • daily note would become an instance of this pattern
  • we could create a weekly note as an instance of this pattern
  • same for anything that is template based (e.g. meeting note, ...)

riccardoferretti avatar Dec 23 '21 09:12 riccardoferretti