Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foam always asks for a title when creating a new note from template #1243

Open
redactedscribe opened this issue Jun 6, 2023 · 5 comments
Open

Comments

@redactedscribe
Copy link

redactedscribe commented Jun 6, 2023

Describe the bug

According to the documentation (and I think it was also previously and recently possible), Foam should only prompt for a title when using the variables FOAM_TITLE, FOAM_TITLE_SAFE, or FOAM_SLUG, but this is not the case.

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

  1. Use the Create New Template command.
  2. Delete its contents.
  3. Save the file.
  4. Use the Create New Note From Template command.
  5. Foam prompts the user for a title when it should not.

Expected behavior

At step 5, create the note based upon the template without asking for a title unless the previously mentioned variables were used. The user can then save the new file manually.

Screenshots or Videos

No response

Operating System Version

  • OS: Windows

Visual Studio Code Version

VSCodium 1.78.2

Additional context

No response

@redactedscribe redactedscribe changed the title Foam _always_ asks for a title when creating a new note from template Foam always asks for a title when creating a new note from template Jun 6, 2023
@riccardoferretti
Copy link
Collaborator

If you don't provide a file path Foam will ask for a title to name the file - have you tried that?

@redactedscribe
Copy link
Author

If you don't provide a file path Foam will ask for a title to name the file - have you tried that?

I think I was misremembering. Right, if I have a filepath set in the template, no title is asked for.

I guess I was hoping for a way to open a new VS Code editor (tab) with the contents of the template evaluated by Foam without it being saved to a file. This way I can choose to save it in a directory of my choosing without having to have it predefined in a template. This also gives one the chance to decide upon the name after having started writing; as you might know, detailing a bug report can often change the initial title once the details have been better understood.

Also, using the Create New Note command has the same issue for me: It just creates the file in the workspace's root (not in the active file's directory which I believe the documentation states that it should) and this isn't ideal. In both cases just opening a new tab with the template / new note contents already present would be more flexible for me.

@riccardoferretti
Copy link
Collaborator

I guess I was hoping for a way to open a new VS Code editor (tab) with the contents of the template evaluated by Foam without it being saved to a file.

This is a really good idea, I wanna think about it

Also, using the Create New Note command has the same issue for me: It just creates the file in the workspace's root

There is a setting for that. If it doesn't work create a new issue as I want to issues to be single-topic so it easier to keep track of things.

@redactedscribe
Copy link
Author

redactedscribe commented Jun 8, 2023

I guess I was hoping for a way to open a new VS Code editor (tab) with the contents of the template evaluated by Foam without it being saved to a file.

This is a really good idea, I wanna think about it

In my opinion, the flow I suggest for creating templates is what I'd expect to be the default, but it probably only makes sense being so when someone is using a hierarchical directory system (myself) rather than a flatter or flat one as is commonly recommended for PKMSes. Should Foam take a position on which organisational system should be used, if not, a flow that accommodates both equally would be a good balance to strike.

I also question why we avoid the OS's Save As dialogue window with the current way that note creation works. Is there a reason why we use that small pop-up for defining the new note's name? From my black-box perspective, it doesn't seem to serve a purpose and lacks all the niceties provided by a Save As dialogue window.

Hopefully these comments add to your thinking process.

@redactedscribe
Copy link
Author

redactedscribe commented Jul 16, 2023

This is a really good idea, I wanna think about it

I think it would also be useful if the two Create New Note commands were accessible via VS Code's Explorer Folders panel. We could browse to the desired location, right-click and select New Note From Template for example.

Perhaps it's also possible to intercept the New File button action and offer these commands? If so, please also offer the standard VS Code option too (i.e. a blank file, nothing special):

2023-07-16_15-14-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants