{{ message }}
fix: mirror the Contents page to markdown - #13165
Open
tiensonqin wants to merge 2 commits into
Open
Conversation
Exclude built-in pages from markdown mirroring except Contents, which is a user-facing page that holds ordinary blocks. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to the exclusion predicate and is backed by targeted tests that confirm Contents is mirrored while other excluded page types remain skipped.
Pull request overview
This PR fixes Markdown mirroring so the built-in Contents page (which can contain normal user blocks) is no longer excluded from mirroring, ensuring it is generated/updated as mirror/markdown/pages/Contents.md during both per-page updates and full regeneration.
Changes:
- Allow the Contents page through the
mirrorable-page?predicate even whenldb/built-in?is true (by matching:block/name "contents"). - Extend markdown mirror tests to assert Contents is written while other built-in/hidden/property pages remain excluded, and that edits don’t trigger unintended deletes.
File summaries
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Fixes logseq/db-test#1144
Root cause
mirrorable-page?excluded every page with:logseq.property/built-in? true. The Contents page is seeded as a built-in page (alongside Library and Quick add) but holds ordinary user blocks. That made<mirror-page!return{:status :skipped :reason :excluded-page}and omitted Contents from full regeneration, so user content never reachedmirror/markdown/pages/Contents.md.Change
Keep excluding built-in, hidden, property, and user-email pages. Allow the Contents page by
:block/name("contents").deleted-page?andpage-jobalready use the same predicate, so Contents stays a write/update job instead of a delete on later txs.Tests
pages/Contents.mdeven whenbuilt-in?is true:excluded-pagebb lint:devpassed.frontend.worker.markdown-mirror-testpassed: 48 tests, 98 assertions, 0 failures.