ENG-1580 Fix command palette availability#939
Closed
trangdoan982 wants to merge 2 commits intomainfrom
Closed
Conversation
…alette - Switch create-discourse-node command from editorCallback to callback so it's available from any view (canvas, graph, file explorer, etc.) - Fix stale metadata cache race condition in applyTemplate: compute merged frontmatter inside processFrontMatter callback using live fm instead of potentially stale metadataCache for newly created files - Simplify createModifyNodeModalSubmitHandler to accept optional editor, removing duplicate inline handler Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Member
Author
|
some work done here for consistent command behavior but I think we can table this until we finish consolidating all the create node flows from Obsidian |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
applyTemplatewas reading target file's frontmatter frommetadataCachebefore computing the merge, but newly created files may not be indexed yet — causing template frontmatter to overwritenodeTypeIdand other fields. Fixed by computing the merge insideprocessFrontMatterwhere the livefmobject is available.create-discourse-nodeusededitorCallback, which is only available when a markdown editor is active. Switched tocallbackso it's accessible from any view (canvas, graph, file explorer, etc.).createModifyNodeModalSubmitHandlernow acceptseditor?: Editor, eliminating the duplicate inline fallback handler.Test plan
[[link]]if creating from selected textnodeTypeIdopen-node-type-menucommand with a selection — template should still apply🤖 Generated with Claude Code