Fix duplicated live-preview frontmatter block rendering #242
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#242
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix the sporadic case where the markdown live-preview frontmatter block renders
twice for a single note, most visibly on
plugin-markdown/Markdown Feature Tour.mdin the e2e vault.Problem
In live-preview mode, the frontmatter block can appear twice even though the
note contains only one YAML frontmatter section. The bug is sporadic and seems
to surface during live-preview widget refreshes rather than from duplicated note
content. The visible symptom is two
.md-frontmatterblocks mounted in theeditor for the same note.
Goal
Ensure markdown live preview renders at most one frontmatter block per note,
including after note open, mode refreshes, and normal CodeMirror widget
rebuilds.
Scope
or in the Svelte markdown renderer identity/lifecycle.
single-instance in live preview.
block is present for a note with YAML frontmatter.
Non-goals
behavior beyond what is necessary for this duplication fix.
path.
Acceptance Criteria
.md-frontmatterblock in live-preview mode.triggering the live-preview refresh path that previously exposed the bug.
Implementation Notes
packages/plugins/plugin-markdown/src/lib/codemirror-extensions/rich-editor/index.tsand
packages/plugins/plugin-markdown/src/lib/renderer/contexts.svelte.ts.Frontmatterdecorations or from stale renderer identity/lifecycle.
live-preview refreshes, which can let an old frontmatter subtree survive a
widget rebuild.
Suggested Files or Specs To Inspect
packages/plugins/plugin-markdown/src/lib/codemirror-extensions/rich-editor/index.tspackages/plugins/plugin-markdown/src/lib/renderer/Renderer.sveltepackages/plugins/plugin-markdown/src/lib/renderer/contexts.svelte.tspackages/plugins/plugin-markdown/src/lib/components/frontmatter/file-frontmatter.sveltepackages/workspace/e2e/frontmatter-properties.spec.tsspec/src/20-packages/plugins/markdown/index.mdValidation Commands
Related Issues
Follow-up Tasks
Implementation Summary
Stabilized markdown renderer node identity and added a live-preview frontmatter regression that asserts a single .md-frontmatter block through editor refreshes.