Skip to content

feat(settings): move the settings tab to Obsidian's declarative settings API - #229

Merged
chhoumann merged 6 commits into
masterfrom
feat/declarative-settings
Oct 24, 2026
Merged

chhoumann merged 6 commits into
masterfrom
feat/declarative-settings

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

PluginSettingTab.display() is deprecated since Obsidian 1.13. MetaEdit's settings tab now returns getSettingDefinitions(), and the tab was redesigned around it. Operator review requested before merge: this changes every settings label and raises minAppVersion.

For users:

  • Three groups, Editing, Menu, and Automation, made of native toggles and a dropdown. Labels are sentence case and say what each setting does ("UI Elements" becomes "Right-click menu", "Edit Meta menu" becomes "Hide properties", and Edit mode's values read "One value", "List", "List for chosen properties").
  • Each feature's configuration moved from a gear-expanded inline panel to its own settings sub-page, with a count on its row. A sub-page row only shows while its feature is on.
  • Hidden properties, list properties, tracked task counts, and Kanban boards are native Obsidian settings lists: "+" to add (through MetaEdit's prompt or a board picker), "x" to delete. They replace three HTML-table Svelte editors whose empty state was a bare "Name Type" header. Kanban rows show their lanes under the board name.
  • Auto properties keeps its existing card editor, now on its own sub-page.
  • Obsidian's settings search now finds MetaEdit's settings.

Dropped on purpose: list entries can't be renamed in place anymore (delete and re-add). Legacy rows with an empty name, which the old tables wrote on Add, show as nameless rows that can be deleted.

Stored data is unchanged. Same data.json keys and stored enum strings ("All Single", "Total Tasks", ...), so no migration.

minAppVersion 1.12.7 to 1.13.4

The declarative API exists from 1.13.0, and displayValue from 1.13.1. I raised the floor instead of keeping display() as a fallback, which would mean two settings UIs to maintain. QuickAdd, PodNotes, and NoteTweet already moved to 1.13.0 the same way. I chose 1.13.4 over 1.13.0 because it's the first public 1.13 release (1.13.0-1.13.3 shipped only to insiders), and it's the oldest build I could download and test. Users on Obsidian 1.12.x keep getting MetaEdit 1.10.x through versions.json. The release pipeline writes the new versions.json entry. Existing entries are untouched.

Implementation notes for reviewers

  • src/Settings/metaEditSettingsTab.ts. A typed controls table maps each control key to get, set, and an optional runtime side effect (toggleAutomators, link-menu register or unregister). Every write goes through the serialized updateSettings writer.
  • Obsidian builds the definitions once, at addSettingTab(), which is before the metadata cache is ready. It does not rebuild them when the tab opens, only on update(). So the settings writer calls settingsTab.syncWithSettings() after each flush, which runs update() only when a list's structure changed. That covers writes from the tab, the API (setAutoProperties), and prompts, and typing in a field never triggers a rebuild that would steal focus. Kanban lanes are read inside render.
  • Deleted: three Svelte table editors, two unused modal classes (ProgressPropertiesModal, IgnoredPropertiesModal), and the CSS only they used.
  • Docs under website/ are rewritten for the new tab (the settings reference fully). Six screenshots were recaptured with obsidian-e2e capture at 2x, dark theme, to match the existing ones.

Screenshots

Before (master, Obsidian 1.14.4, gear panels expanded):
old settings tab

After (Obsidian 1.14.4, dark):
new settings tab

Sub-pages:
Hidden properties page Tracked task counts page
Boards page Preset values page

Add prompt, settings search, and Obsidian 1.13.4:
Add property prompt Settings search finds Kanban board helper
Settings tab on Obsidian 1.13.4

Verification

  • Full E2E suite on the isolated obsidian-e2e vault (Linux, headless): 112 passed on Obsidian 1.14.4 and 112 passed on Obsidian 1.13.4. The settings tests are rewritten for the new UI: SET-03/04/05, AUTO-02/03, PROG-02, KAN-02/03. New ones: SET-06 (List properties follows Edit mode and persists), SET-07 (Hidden properties add, trim, and ignore duplicates).
  • Driven by hand in Obsidian 1.14.4 with real clicks and CDP keystrokes. Every toggle, the dropdown, and every sub-page round-trips to data.json: add and delete in each list, the progress type dropdown, and typing in the Kanban property field (focus kept). An API setAutoProperties call while the tab is open updates the "Preset values" count. Lanes show right after a plugin reload. No console errors.
  • Review rounds (gpt-6-astra and claude-fable-5-1) found a real data-loss race. Two quick deletes could remove the wrong row, because the second index was resolved after the first save. Rows are now removed by the entry they rendered, and SET-07 reproduces the race (on the old code it deleted "keep" instead of "draft"). Failed saves now roll back and re-render. MENU-04 and the Kanban test now drive the real controls, and the new SET-08 checks that the automators attach and detach from the toggles.
  • pnpm run lint, pnpm run build, pnpm run test (365 passed).

Release impact

feat: triggers a minor release, and the next release requires Obsidian 1.13.4. Release PR #220 will be refreshed by the bot after merge. Not merged by me.


Note

Medium Risk
Settings UI and save/sync behavior changed broadly and minimum Obsidian version increased; runtime automator/link-menu side effects still run on toggle via the controls map, but users on Obsidian <1.13.4 cannot install this build.

Overview
Migrates MetaEdit's settings tab from hand-built display() panels to Obsidian's declarative settings API (getSettingDefinitions(), grouped toggles/dropdowns, and native list sub-pages). The tab is reorganized into Editing, Menu, and Automation, with clearer labels (e.g. "Right-click menu", "Hide properties") and feature-specific pages instead of gear-expanded inline Svelte tables.

Removed the old table editors and related modals/CSS (IgnoredPropertiesModal, progress/Kanban/hidden-property Svelte UIs, SingleValueTableEditorContent). List edits (hidden properties, edit-mode list keys, progress rules, Kanban boards) now use Obsidian's "+" / delete flows with prompts or a board suggester; deletes resolve by entry identity to avoid index races on rapid double-delete.

Persistence: all tab writes go through the serialized updateSettings path with rollback + notices on failure; after each disk flush, settingsTab.syncWithSettings() rebuilds definitions only when list structure changes so typing doesn't steal focus. Raises minAppVersion to 1.13.4 (no data.json migration). Docs and e2e tests are updated for the new navigation and copy.

Reviewed by Cursor Bugbot for commit 6a7de48. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Rebuild settings tab on Obsidian's declarative settings API

  • Replaces the manually built settings DOM in MetaEditSettingsTab with declarative setting definitions grouped into Editing, Menu, and Automation, with conditional sub-pages for List properties, Hidden properties, Preset values, Tracked task counts, and Boards (metaEditSettingsTab.ts)
  • Settings now save through the serialized updateSettings writer; save failures show a Notice instead of silently mutating in memory
  • Renames settings and labels: Edit Meta menu becomes Right-click menu, Edit Mode options become One value / List / List for chosen properties, and Ignored Properties becomes Hide properties
  • Removes the IgnoredPropertiesModal class, old manual setting builders, and unused CSS selectors
  • Updates e2e tests to the new sub-page navigation, and updates all website docs to the new UI and renamed labels
  • Risk: raises the minimum Obsidian version from 1.12.7 to 1.13.4 in manifest.json; users on older Obsidian get MetaEdit 1.8.4 instead

Macroscope summarized 6a7de48.

…ngs API

PluginSettingTab.display() is deprecated since Obsidian 1.13. The tab now
returns getSettingDefinitions(): three groups (Editing, Menu, Automation)
of native toggles and a dropdown, plus sub-pages for each feature's
configuration. The sub-pages only show while their feature is on, and the
settings search now finds every MetaEdit setting.

- Hidden properties, list properties, tracked task counts, and Kanban
  boards are native settings lists with add and delete, replacing three
  HTML-table Svelte editors.
- Auto properties keeps its Svelte editor on its own sub-page.
- Toggles persist through the serialized settings writer.
- Delete the unused ProgressPropertiesModal and IgnoredPropertiesModal.
- Raise minAppVersion to 1.13.4, the first public 1.13 release.
… writes

Obsidian renders the declarative tab from the snapshot taken when the tab
was registered, before the metadata cache is ready, and does not call
getSettingDefinitions() again on open. Rebuild after any settings flush
that changes a list, read Kanban lanes at render time, and refresh the
doc screenshots for the new tab.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
metaedit-docs e3db597 Oct 24 2026, 03:10 PM

Comment thread src/Settings/metaEditSettingsTab.ts Outdated
Comment thread src/Settings/metaEditSettingsTab.ts Outdated
Two quick deletes could both be queued before the first save re-rendered
the list, so the second index pointed one row too far and removed the
wrong entry. Rows are now removed by the entry they rendered, and
progress and Kanban rows edit their own entry rather than the first one
with the same name.

A failed save now undoes the in-memory change and re-renders the tab, so
memory, disk, and runtime side effects stay in step.

MENU-04 drives the Right-click menu toggle, and the Kanban test checks
that the property field persists.
@chhoumann
chhoumann merged commit f0632dd into master Oct 24, 2026
12 of 13 checks passed
@chhoumann
chhoumann deleted the feat/declarative-settings branch October 24, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant