fix(ui): feature-detect Obsidian 1.13 settings/button APIs - #53
Merged
Conversation
setDestructive() and getSettingDefinitions() are Obsidian 1.13.0+, but minAppVersion stays 1.7.2. Buttons fall back to setWarning() when setDestructive is absent; the settings tab keeps display() as the documented fallback, with getSettingDefinitions() driving the declarative renderer (and Settings search) on newer hosts.
istefox
added a commit
that referenced
this pull request
Jul 23, 2026
Bump manifest.json, package.json, package-lock.json, versions.json to 1.5.0. Adds Obsidian 1.13 settings-search support and setDestructive feature-detection (PR #53) since v1.4.2. minAppVersion stays 1.7.2.
4 tasks
istefox
added a commit
that referenced
this pull request
Jul 23, 2026
…#55) setDestructive(), getSettingDefinitions(), and SettingGroup.addSetting() are all newer than minAppVersion 1.7.2. Runtime feature-detection doesn't satisfy obsidianmd/no-unsupported-api: the review bot flags every static reference regardless of the guard. Reverts settings-tab.ts, confirm-modal.ts, and chain-wizard-modal.ts to their pre-PR-#53 state and removes button-compat.ts.
5 tasks
istefox
added a commit
that referenced
this pull request
Jul 23, 2026
…57) The previous attempt (PR #53, reverted in #55) gated setDestructive()/ getSettingDefinitions()/SettingGroup.addSetting() behind typeof checks, which obsidianmd/no-unsupported-api does not recognize as a guard. Verified by reading the rule's source and reproducing both the failure and the fix in an isolated eslint-plugin-obsidianmd install: only requireApiVersion("1.13.0") is recognized. minAppVersion stays 1.7.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setDestructive()andgetSettingDefinitions()are Obsidian 1.13.0+, butminAppVersionstays 1.7.2.src/ui/button-compat.tsfeature-detectssetDestructive()at runtime, falling back to the deprecated but always-presentsetWarning()on older hosts (confirm-modal.ts,chain-wizard-modal.ts).settings-tab.tsnow implementsgetSettingDefinitions()(makes every setting searchable on 1.13+) while keepingdisplay()as the documented fallback for older hosts, wheregetSettingDefinitionsis never called. Each field's control logic lives in one shared private method used by both paths, so they can't drift apart.Test plan
npm run build(typecheck + production build)npm run lintnpx vitest run(362 tests passing, no domain logic changed)