indrajithi / vs-journal

VSCode extension to create journals/notes and sync to your remote repository
MIT License
6 stars 2 forks source link

Added ability To Create Notes in Folders #1

Closed TobyDustin closed 1 month ago

TobyDustin commented 1 month ago

Description

This pull request introduces a new feature to the VSJournal extension, allowing users to create a new note inside a specified folder. The new command, VSJournal: Create New Note in Folder, enhances the existing functionality by providing better organisation and structure for journal entries.

Changes

  1. New Command Implementation

    • Added a new command VSJournal: Create New Note in Folder to the extension.
    • This command prompts the user to select or create a folder, then creates a new note inside the chosen folder.
  2. UI Enhancements

    • Updated the command palette to include the new command.
    • Added a folder selection dialog to allow users to specify the target folder for the new note defaulting to the workspace directory of the VS code project.
  3. Code Modifications

    • Modified the command registration in extension.js to include the new command.
    • Implemented folder selection and note creation logic in a new function disposableCreateNoteInFolder within extension.js.
  4. Documentation

    • Updated the extension's README.md to include instructions for using the new command.

How to Test

  1. Open VS Code with the VSJournal extension installed.
  2. Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
  3. Type and select VSJournal: Create New Note in Folder.
  4. Choose an existing folder or create a new one in the dialog that appears.
  5. Verify that a new note is created inside the selected folder with the appropriate naming convention.

Screenshots

Folder Seelection Dialog Screenshot of the folder selection dialog.

Screenshot 2024-06-03 at 10 15 36 Screenshot of a new note created inside a folder.


Review Checklist


Please review the changes and provide feedback. Looking forward to your inputs and suggestions!

Thank you!

indrajithi commented 1 month ago

Hi @TobyDustin, thanks for the PR.

I was thinking of an improvement like this. It would also be better to have the user type the folder path while they create the notes.

For example:

todo/shopping-list meetings/toby<>indra

And create the notes in the directory specified in the path. If the directory is not created we create the directory before creating the notes. WDYT?

TobyDustin commented 1 month ago

Thats a really great idea. With this implementation as well we don't have to specify a new command, we can use the create notes command. I will make the change now.

Do we need to think about users wanting to use "/" in there notes titles? if we start splitting the notes titles this may cause an issue?

TobyDustin commented 1 month ago
Screenshot 2024-06-04 at 13 21 49 Screenshot 2024-06-04 at 13 21 59 Screenshot 2024-06-04 at 13 22 25 Screenshot 2024-06-04 at 13 22 38