Skip to content

Commit 5b9ffa8

Browse files
trangdoan982claude
andauthored
[ENG-1459] Obsidian plugin store prep Part 3 (#850)
* fix(obsidian): address plugin store submission requirements + UI text + commands - Update manifest.json description to start with verb and end with period (SR-4, SR-5) - Remove top-level "Discourse Graph Settings" heading (PG-UI7, PG-UI8) - Remove default hotkey Mod+\ from open-node-type-menu command (PG-C14) - Replace workspace.activeLeaf with getActiveViewOfType() (PG-W16) - Add PLUGIN_STORE_SUBMISSION.md and PR_SUMMARY.md tracking docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revise PLUGIN_STORE_SUBMISSION.md for clarity and updates Updated submission document to reflect changes addressing failed criteria and improved clarity on plugin guidelines. * remove PR_SUMMARY.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(obsidian): modernize Vault & Workspace APIs - Replace vault.adapter.exists() with getAbstractFileByPath() (PG-V21) - Replace vault.modify() with vault.process() for background edits (PG-V19) - Replace deprecated getFrontMatterInfo() with custom parser (PG-V20) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(obsidian): complete vault.adapter.exists migration + update tracking doc - Replace 4 remaining vault.adapter.exists() calls with getAbstractFileByPath() in importNodes.ts - Update PLUGIN_STORE_SUBMISSION.md with correct guideline URLs and accurate descriptions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * revert vault.adapter.exists changes + update tracking doc Keep vault.adapter.exists() usage as-is per preference. Remove the "Prefer Vault API over Adapter API" section from tracking doc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * revert changes * address PR comment * delete file --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8e624b2 commit 5b9ffa8

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

apps/obsidian/src/components/BulkIdentifyDiscourseNodesModal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@ const BulkImportContent = ({ plugin, onClose }: BulkImportModalProps) => {
140140
);
141141

142142
try {
143-
const fileContent = await plugin.app.vault.read(candidate.file);
144-
const newContent = `---\nnodeTypeId: ${candidate.matchedNodeType.id}\n---\n\n${fileContent}`;
145-
146-
await plugin.app.vault.modify(candidate.file, newContent);
143+
await plugin.app.vault.process(
144+
candidate.file,
145+
(data) =>
146+
`---\nnodeTypeId: ${candidate.matchedNodeType.id}\n---\n\n${data}`,
147+
);
147148

148149
successCount++;
149150

apps/obsidian/src/utils/importNodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ const processFileContent = async ({
10711071
if (!file) {
10721072
file = await plugin.app.vault.create(filePath, rawContent, stat);
10731073
} else {
1074-
await plugin.app.vault.modify(file, rawContent, stat);
1074+
await plugin.app.vault.process(file, () => rawContent, stat);
10751075
}
10761076

10771077
// 2. Parse frontmatter from rawContent (metadataCache is updated async and is
@@ -1287,7 +1287,7 @@ export const importSelectedNodes = async ({
12871287

12881288
// Only update if content changed
12891289
if (updatedContent !== currentContent) {
1290-
await plugin.app.vault.modify(processedFile, updatedContent);
1290+
await plugin.app.vault.process(processedFile, () => updatedContent);
12911291
}
12921292
}
12931293

0 commit comments

Comments
 (0)