Harden note-local frontmatter value editing and write semantics #65
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#65
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?
Make frontmatter value edits predictable and durable for all built-in property
widgets, and consolidate the duplicated note-local write path used by markdown
frontmatter surfaces.
Context
Audit findings from the current implementation:
file-frontmatter.svelteandfile-properties.svelteduplicate the sameprocessFrontMatter+ lodashset/unsetbehavior.widgets.ts; they update onlyon
blurin most cases, so checkbox/date/number/text changes can be lost whenfocus is moved by a menu, a view switch, or editor remount.
focused regression tests for conversion, clearing, or YAML serialization.
processFrontMatter()is solid for the cache-missing case but has limitedcoverage for notes with no frontmatter block, empty frontmatter, parse errors,
concurrent edits, or avoiding no-op writes.
silent instability.
Acceptance Criteria
update, clear, and nested path writes, reused by live-preview frontmatter and
the file properties side view.
values update on change, and text-like values do not lose edits when menus or
view transitions move focus.
false,0, empty arrays, andnull/undefinedremoval haveexplicit behavior and tests.
FileManager.processFrontMatter()coverage includes adding a firstfrontmatter block, editing an existing block, preserving unrelated keys,
handling parser/write failures, and suppressing unnecessary writes where
practical.
rather than silently failing.
Notes
Relevant files:
packages/api/src/lib/file-manager.tspackages/api/src/lib/__tests__/file-manager.test.tspackages/plugins/plugin-markdown/src/lib/components/frontmatter/file-frontmatter.sveltepackages/plugins/plugin-markdown/src/lib/views/file-properties/file-properties.sveltepackages/plugins/plugin-markdown/src/lib/components/frontmatter/widgets.tsImplementation Summary
Consolidated note-local frontmatter writes behind a shared helper, hardened falsey and nullish mutation semantics, surfaced write failures through Notice, expanded FileManager processFrontMatter edge-case coverage, and added widget/frontmatter regression tests.