Foldable Frontmatter Groups

by Christopher Wagner
5
4
3
2
1
Score: 31/100

Description

Obsidian plugin: collapsible group headers in the Properties panel, with opt-in YAML reconcile on file leave.

Reviews

No reviews yet.

Stats

3
stars
782
downloads
0
forks
91
days
45
days
45
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
3
total issues
3
open issues
0
closed issues
22
commits

Latest Version

2 months ago

Changelog

Rolls up 1.6.0 and 1.6.1, which were developed back to back.

Opening a note no longer marks it edited

Foldable Frontmatter Groups rewrites notes on its own initiative: reconciling groups on open and leave, applying create-time defaults, inserting body templates, running Cleanup scrubs, migrating fields. To Obsidian, every one of those looks exactly like you editing the note.

It now announces those writes. Immediately before each one, the plugin fires the recent-edits:plugin-write workspace event. Recent Edits 1.6.0 and later listens for it and leaves its ledger untouched for the matching write, so simply opening a note no longer pushes it to the top of your recent list.

Two writes are deliberately not announced, because they are yours rather than housekeeping: the context-menu Remove property, which you asked for on that specific note, and the migration conflict checklist, which is a deliverable you will want to find. Fast paths that end up writing nothing never announce at all, and if Recent Edits is not installed the event has no listeners and nothing happens.

Cleanup guard for template-defaulted fields

Remove null and Remove ALL on a field that a matching template lists as a default now open a confirmation first. The dialog names the owning template with an Open template jump, tells you how many of the affected notes would get the field straight back on their next open, and offers Proceed anyway or Cancel.

This closes a real trap: a vault-wide Remove null on a scaffold field appears to work, then reconcile quietly re-inserts the field on every note as you open it. Ownership is computed by the same logic reconcile uses, so the guard and the reconcile pass cannot disagree.

Group fill indicator on folded headers

A folded group header showed a property count and nothing else, so a scaffold group holding nothing looked identical to one full of real values.

Folded headers now carry a dot between the group name and the count: solid and accent-colored when at least one property in the group holds a value, a hollow faint ring when they are all empty. An unchecked checkbox and a numeric 0 read as empty for this purpose, since the question is whether the group is worth unfolding.

Folded headers only. Unfolding shows you the values themselves.

Show fill indicator in settings is the master switch, on by default, and each group card carries its own opt-out.

Also

  • The settings tab can now reveal a template card that has no group attached.

README file from

Github

Foldable Frontmatter Groups

Adds collapsible group headers to the native Properties panel, keeps frontmatter keys in a canonical order, applies folder-scoped field templates, and provides cleanup tooling for stale or empty fields. All of it is configured from a settings UI, with no source edits.

Why this exists

The native Properties panel renders every frontmatter key as a flat, unordered list. On a metadata-rich vault, AI-system fields, hidden fields, CRM fields, and content fields all pile up with no structure. As you adopt more metadata conventions, the clutter only grows.

Foldable Frontmatter Groups adds the structure the panel lacks: collapsible sections, a consistent key order, folder-appropriate defaults, and a way to find and scrub fields you no longer want, so the panel shows what matters for each note type.

Features

  • Collapsible groups. Group frontmatter rows under folding headers in the Properties panel. Each group matches by an ordered list of literal names and prefix* wildcards (for example ai_*, aic_*, _*), or by a regex for power use. First match wins by settings order.
  • Properties Order. Pin chosen keys to the top of the panel in a fixed order, above the folding groups.
  • Per-field icons. Map any frontmatter key to a Lucide icon, overriding the type-based row icon.
  • Folder templates. Per folder-path prefix, insert default fields (with type-aware seed values and <today> / <now> markers), a per-template key order, an optional group assignment, and optional note-body scaffolding (evaluated through Templater when installed).
  • Auto-reconcile. Optionally, when you open or leave a note, insert missing template defaults, scrub cleanup-flagged empty values, and reorder keys to the canonical order in a single write. Idempotent: an already-correct note is never rewritten.
  • Exclusions. Exempt specific files from reconcile (and hide their Properties panel entirely), and exclude folder / MOC notes by default with per-note and per-folder whitelists.
  • Cleanup tab. A frontmatter-management surface: an in-scope key catalog with null/coverage counts, remove-null and remove-all actions, a per-field occurrence inspector, and a migrate-field (rename across the vault) tool. Every scrub and migrate is written to a recoverable scrub log.
  • Orphan handling. Passively tint any property no template claims, and optionally (off by default) scrub orphaned null values during reconcile.
  • Panel affordances. A settings gear next to "Add property," a per-group-header gear that jumps to that group's template settings, and a refresh button that reconciles the active file on demand.
  • Desktop and mobile. Works on both; verified on iPhone.

Install

This plugin is not yet in the Community Plugins directory. Install it via BRAT.

Via BRAT

  1. Install the BRAT plugin from the Community plugins directory.
  2. In Obsidian: Settings → BRAT → Add Beta plugin.
  3. Paste: cwagner223355/obsidian-foldable-frontmatter-groups
  4. Enable Foldable Frontmatter Groups in Community plugins.

Settings

Settings live on three tabs.

Tab What it configures
Grouping The master folding toggle and auto-reconcile toggle (with the exclude-list editor and the opt-in orphan-null scrub); Properties Order; global folder templates; and the groups, each with its matcher, fold-by-default state, and linked templates.
Customize Icons Per-field Lucide icon overrides.
Cleanup The in-scope key catalog with counts, per-field cleanup scope, remove-null / remove-all, the field-occurrence inspector, migrate field, and the scrub-log viewer.

Key toggles:

Setting Default Description
Group folding on Master switch. When off, the plugin unwraps every group and leaves the native panel untouched; settings below dim but persist.
Auto-reconcile frontmatter off When on, reconcile fires on both file open and file leave. Manual commands run regardless.
Exclude folder notes on Automatically exempt folder / MOC notes from reconcile, with per-note and per-folder whitelists.
Scrub orphaned nulls off During reconcile, delete null values whose key no matching template claims. Opt-in.

Commands

Command Action
Reconcile frontmatter order (active file) Run the full reconcile pass (defaults, cleanup, reorder) on the active file, regardless of the auto-reconcile toggle.
Apply default frontmatter (active file) Same pass, surfaced as a defaults-first action.

How reconcile works

Each reconcile does three things in one processFrontMatter write: it inserts template defaults into missing or empty keys (never overwriting a value that already holds data), scrubs cleanup-flagged null values, and reorders keys to the canonical order (Properties Order keys first, then unmatched keys in place, then each group's matching-template order). A key that any matching template lists as a default is never scrubbed by the cleanup pass, so a field configured as both is stable. When the note is already correct, no file is written.

Reconcile is triggered only by you opening or leaving a note, never by a background vault watcher. Any DOM or write error leaves the native Properties UI untouched.

Recovering scrubbed fields

Every remove-null, remove-all, and migrate action appends the removed { path, value } pairs to scrub-log.json in the plugin folder (capped at 500 entries). The "View scrub log" modal renders them newest-first with a date-range JSON export. Recovery is manual (there is no one-click restore yet).

Support

If Foldable Frontmatter Groups is useful to you, consider buying me a coffee.

License

MIT license. See LICENSE.