Skip to content

feat: migrate settings UI to declarative API#18

Draft
rhoades-brown wants to merge 2 commits into
mainfrom
declarative-settings-api
Draft

feat: migrate settings UI to declarative API#18
rhoades-brown wants to merge 2 commits into
mainfrom
declarative-settings-api

Conversation

@rhoades-brown

@rhoades-brown rhoades-brown commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates the settings tab from the imperative display() method to the new declarative Settings API introduced in Obsidian 1.13.0, and adds additional 1.13.0 API enhancements.

Declarative Settings Migration

  • Replaced display() with getSettingDefinitions() returning an array of declarative definitions
  • Added getControlValue / setControlValue with dot-notation support for nested settings objects
  • Auth section uses render callbacks for connection status and Connect button
  • Repository section uses dynamic dropdown via render callback
  • Additional repos use type: 'list' with page navigation
  • Ignore patterns use type: 'list' with inline editing
  • Sync behavior uses visible predicates (interval slider only shown when enabled)
  • Commit, conflict, UI sections use pure declarative control bindings
  • Logging uses render callbacks for side-effects (logger.configure())
  • All this.display() calls replaced with this.update()
  • All eslint-disable comments removed

1.13.0 API Enhancements

  • ConfirmationModal: Replaced placeholder SyncModal with reusable confirmDestructiveAction helper using native ConfirmationModal API for delete repo and clear logs confirmations
  • setDestructive: Applied destructive styling to Clear logs buttons in both Settings Tab and SyncView
  • setErrorMessage: Inline validation errors for PAT connection failures and vault directory path overlaps, replacing Notice-based alerts
  • Plugin.settings: Fixed setControlValue to use saveSettings() instead of saveData() to preserve sync state

Breaking Change

  • minAppVersion bumped from 1.7.2 to 1.13.0

Checklist

  • Build passes
  • Lint clean (0 errors/warnings)
  • All 119 tests pass
  • Mock updated with 1.13.0 API types

Draft: This PR should remain in draft until Obsidian 1.13.0 is publicly released.

@rhoades-brown rhoades-brown force-pushed the declarative-settings-api branch from 5d086b6 to a9f5b1d Compare May 29, 2026 23:40
@rhoades-brown rhoades-brown force-pushed the declarative-settings-api branch 2 times, most recently from efd3e62 to bd9eaf4 Compare May 30, 2026 20:39
@rhoades-brown rhoades-brown force-pushed the declarative-settings-api branch from bd9eaf4 to ec41f6e Compare May 30, 2026 20:42
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