Repository navigation
Conversation
|
@nishantwrp, Kindly review this PR. |
alondmnt
left a comment
There was a problem hiding this comment.
Thanks for tackling this @sh1vam31. The approach and error messaging look good for the tag-based workflow.
One issue: isNoteATemplate hardcodes a check for the template tag, but when TemplatesSource is set to "Notebook", templates live in a "Templates" folder and don't need that tag. Since getTemplateFromId is shared, this would cause notebook sourced default templates to be incorrectly rejected.
The fix should respect TemplatesSourceSetting for notebook source, check that the note is in a "Templates" folder instead of checking for the tag.
|
Following up on my earlier review, this is worse than I described, and my suggested fix was too narrow. Putting the tag check inside The underlying problem is that |
|
Hi @alondmnt, Thanks for the review! I've updated the PR based on your feedback: Reverted getTemplateFromId: Kept its responsibility clean (checks note existence without forcing tag validation, preventing settings erasure in showDefaultTemplates). |
|
Hi @alondmnt, I have resolved the merge conflicts with the latest All checks pass locally ( |
Fixes #107
If a note was set as the default template and later had its
templatetag removed, the plugin would silently fail or give a misleading error. It should instead inform the user that the saved default is no longer a template.Fix
src/utils/templates.ts
templatetagnullif the note is no longer a templatesrc/index.ts
commands now show a clear, actionable error message:
Testing
template, set it as the default templatetemplatetag from that notetemplatetag → default template worked normally again