-
Notifications
You must be signed in to change notification settings - Fork 680
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
Add open daily note base feature #79
Add open daily note base feature #79
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for this addition @francishamel 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work @francishamel 🎉! this looks great. I tested it out locally and all works as expected.
there are some formatting changes I would make but we can always fix that later. i'll let you make that call.
suggested follow-up PRs:
- update the official docs with info on how to use new features
- add unit tests for the functions these new functions
No obligation to do these! Please let me know though. If you don't do it, I'd like to open a separate to keep track and open it up to others.
For the docs, I'd be happy to update it in another PR. I'd just like some directions so that I don't miss anything. For the unit tests, I talked with @jevakallio and there isn't a test infrastructure yet in this project and I'm not that familiar with JS test frameworks to be honest. I'd be happy to learn but I don't feel like I'd be the best to add a basic test infrastructure tho. |
Awesome! Why don't we move this discussion to an issue so it doesn't get lost? I'll add some thoughts to kick it off. Issue: #87
No worries there! Looks like @jevakallio mentioned it in #57 so we won't create a separate issue. If you want to learn, we can discuss there. |
} | ||
|
||
async function focusDailyNote(dailyNotePath: string) { | ||
const document = await workspace.openTextDocument(Uri.parse(dailyNotePath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future improvement (not expected now): Automatically move cursor to the end of file so you can just start typing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Opened up #118 to capture this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@francishamel this is looking good! I tested it with different permutations of settings, and it worked as expected! Can't wait to use this 🎉
I left a few minor nits in the comments, the biggest being that in preparation of landing #83, we should move the new code (apart from command registration) out into its separate file.
- Activate command - Add default keybindings for the command - Use settings to configure the filename format, the file extension, the title format and the directory where the note should be created
@francishamel ping me when this is ready again (here or on Discord) and we'll get this merged in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thank you so much @francishamel! ❤️
Thanks @jsjoeio @riccardoferretti for reviews 👍
Landed, will release in next version! @all-contributors add @francishamel for code ⌨️ |
I've put up a pull request to add @francishamel! 🎉 |
Open Daily Note is a core feature of roam. That's why this feature is considered as a core feature in foam's roadmap. This feature is quite simple. With the
Foam: Open Daily Note
command, vscode will create today's note (yyyy-mm-dd.md
) if it's not already created and focus the editor on today's note. It is also possible to trigger the command via theAlt+d
keyboard shortcut.Some things related to the daily note are configurable:
This PR implements the Must Have and the Should Have.
Related issue: #54