obsidian-releases icon indicating copy to clipboard operation
obsidian-releases copied to clipboard

Add New-Note-Plus plugin

Open ilucaslee opened this issue 2 years ago • 1 comments

I am submitting a new Community Plugin

Repo URL

Link to my plugin:obsidian-new-note-plus

Release Checklist

  • [x] I have tested the plugin on
    • [ ] Windows
    • [x] macOS
    • [ ] Linux
    • [ ] Android (if applicable)
    • [x] iOS (if applicable)
  • [x] My GitHub release contains all required files
    • [x] main.js
    • [x] manifest.json
    • [ ] styles.css (optional)
  • [x] GitHub release name matches the exact version number specified in my manifest.json (Note: Use the exact version number, don't include a prefix v)
  • [x] The id in my manifest.json matches the id in the community-plugins.json file.
  • [x] My README.md describes the plugin's purpose and provides clear usage instructions.
  • [x] I have read the tips in https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md and have self-reviewed my plugin to avoid these common pitfalls.
  • [x] I have added a license in the LICENSE file.
  • [x] My project respects and is compatible with the original license of any code from other plugins that I'm using. I have given proper attribution to these other projects in my README.md.

ilucaslee avatar Jul 14 '22 14:07 ilucaslee

  • new-note-plus It's not very clear from the parameter that this creates a file with the clipboard contents. Why not call the url action new-file-from-clipboard or similar?
  • await this.app.vault.modify(file, text); this looks dangerous. Given the name of the plugin and the fact that the uri specifically says "new-note," I wouldn't expect it to modify an existing note. Maybe this should either create a new note with a unique number at the end or display a prompt asking if the user wants to replace the file contents.
  • } else { it looks like it's possible for file to exist but be pointing to a TFolder and still get into this else block.
  • await editor.focus(); I don't think focus is async, no need to await it
  • var newPane = false; this variable looks unnecessary, just pass in false directly into openLinkText
  • await navigator.clipboard.readText(); You should wrap readText in a try/catch since it can throw exceptions in a few cases, such as if the window isn't focused.

liamcain avatar Aug 04 '22 22:08 liamcain