Conversation
Treat UI content that looks like frontmatter as plain body text while keeping importer updates on the frontmatter-preserving path. Also initialize baseline revisions for existing pages when revisions are enabled so revision history starts from the current state.
There was a problem hiding this comment.
Pull request overview
This PR adjusts wiki content handling so that UI-authored markdown that resembles YAML frontmatter is stored verbatim as body text, while importer-driven updates still preserve/merge frontmatter. It also adds baseline revision initialization so revision history begins from the current state when revisions are enabled.
Changes:
- Split content upsert behavior into UI (treat as plain body) vs importer (preserve/merge frontmatter) paths.
- Thread an
FromImportflag through the update use case down toTreeService.UpdateNode. - Initialize baseline content revisions for existing pages when revisions are enabled, and update tests to reflect the new frontmatter behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/wiki/wiki.go | Calls baseline revision creation on startup when revisions are enabled. |
| internal/wiki/pages/update_page.go | Adds FromImport flag to route importer vs UI behavior. |
| internal/wiki/pages/copy_page.go | Updates UpdateNode call signature with new fromImport arg. |
| internal/wiki/import_adapter.go | Sets FromImport: true for importer updates. |
| internal/core/tree/tree_service.go | Adds fromImport parameter and routes content writes to the correct NodeStore method. |
| internal/core/tree/node_store.go | Makes UpsertContent treat input as plain body; adds UpsertContentPreservingFrontmatter for importer behavior. |
| internal/core/tree/node_store_test.go | Adds/updates tests to validate UI vs importer frontmatter handling. |
| internal/core/tree/tree_service_test.go | Updates tests to reflect that “frontmatter-like” UI content is no longer parsed/validated as YAML. |
| internal/links/link_service_test.go | Updates UpdateNode calls for the new signature. |
| internal/core/revision/service.go | Updates UpdateNode calls for the new signature during restore/rollback. |
| internal/core/revision/service_test.go | Updates UpdateNode calls for the new signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Use bulk page and link lookups during refactor apply to reduce repeated work. Also add a benchmark make target to make these paths easier to measure.
Align the test name with the behavior it now verifies after frontmatter-like UI content stopped failing parsing.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Batch outgoing link lookups to avoid SQLite parameter limits during large refactors and reindex operations. Handle page enumeration and page load errors when creating baseline revisions so unreadable pages are skipped instead of silently weakening startup reliability.
Skip the editor navigation blocker when the latest store state is already clean after saving. Use a ref-based one-shot bypass to avoid React set-state-in-effect lint errors while keeping the rename/history close flow stable.
Treat UI content that looks like frontmatter as plain body text while keeping importer updates on the frontmatter-preserving path.
Also initialize baseline revisions for existing pages when revisions are enabled so revision history starts from the current state.