foam
foam copied to clipboard
Allow users to select the foam template as creating a new note by clicking on the link in the preview popup
Is your feature request related to a problem? Please describe.
Steps to produce:
- Open a foam project which contains foam templates, then open a markdown file.
- Add a new wiki link, ex. [[wiki-link| Wiki Link]], the associated markdown file was not created.
- Hover on the wiki link.
- Wait to see the preview popup, then click on
Create note for 'wiki-link'. - The file was created without asking user to select the foam template.
Describe the solution you'd like
As a user, I expect I can select the foam template after clicking on the link, similar to the feature Create new note from template.
Describe alternatives you've considered
I have some suggestions: 1 Change behaviour on clicking on the preview popup link. 2. Keep it, but add a new link to allow create a new note from the foam template. 3. Add a setting to allow users to choose the behaviour they want.
Screenshots or Videos
No response
I like this suggestion, maybe what could be done is that if a user clicks cmd+alt+click instead of simply cmd+click it gets prompted.
Related, but independent: another idea might be to have a hook that gets called when clicking on a wikilink with a signature along the lines of:
function getTemplateForWikilink(availableTemplates: Template[], souceNote: Resource, link: ResourceLink): Template?
which returns the Template to use, or undefined which would trigger the pop-up for template selection.
It requires some additional thinking (e.g. how does it interface with the existing template configuration), but I in general like the "hook" based approach.
(cc @movermeyer given all the previous work he did around templates)