diff --git a/Commands/CopyWorldCommand.ts b/Commands/CopyWorldCommand.ts index 149ff4f..a9003ca 100644 --- a/Commands/CopyWorldCommand.ts +++ b/Commands/CopyWorldCommand.ts @@ -142,7 +142,12 @@ export class CopyWorldCommand { let parsedElement: Record; if (!isSpanFormat(fileContent) && file instanceof TFile) { const parsed = await readElement(this.app, file); - parsedElement = parsed ? parsed.fields : await this.parseTemplate(fileContent, worldName); + // id rides OUTSIDE parsed.fields — without it the copied + // JSON loses element identity and paste-dedupe breaks + // (gate finding, 2026-07-16). + parsedElement = parsed + ? { id: parsed.id, ...parsed.fields } + : await this.parseTemplate(fileContent, worldName); } else { parsedElement = await this.parseTemplate(fileContent, worldName); } diff --git a/Commands/ExportWorldCommand.ts b/Commands/ExportWorldCommand.ts index 468bc0f..903539b 100644 --- a/Commands/ExportWorldCommand.ts +++ b/Commands/ExportWorldCommand.ts @@ -212,7 +212,10 @@ export class ExportWorldCommand { const fileContent = await fs.read(file.path); if (!isSpanFormat(fileContent) && file instanceof TFile) { const parsed = await readElement(this.app, file); - if (parsed) return parsed.fields; + // id rides OUTSIDE parsed.fields — without it the upload + // sweep's `if (!id) continue` silently skips every + // frontmatter element (gate finding, 2026-07-16). + if (parsed) return { id: parsed.id, ...parsed.fields }; } return await this.parseTemplate(fileContent, worldFolder); })); diff --git a/docs/SMOKE-CHECKLIST.md b/docs/SMOKE-CHECKLIST.md index bef8f51..9991ae1 100644 --- a/docs/SMOKE-CHECKLIST.md +++ b/docs/SMOKE-CHECKLIST.md @@ -84,8 +84,11 @@ a pre-2.4 note). 17. In a world with BOTH migrated (frontmatter) and un-migrated (span) notes: - [ ] **Upload World** completes and pushes both correctly (frontmatter via the - reader, span via the legacy parser). - - [ ] **Copy World to Clipboard** completes without error. + reader, span via the legacy parser). **Check the count in the upload + notice matches your element count** — a silent skip looks like success + (this exact class was caught and fixed at the gate; verify it stays dead). + - [ ] **Copy World to Clipboard** completes; paste the clipboard into a text + editor and spot-check elements carry their `id`. Known limitation to eyeball, not a blocker: **Validate World** is still a span-format linter. Run on a migrated (frontmatter) world it will report false "missing Id / Name"