From d88d1e35c83c041cc26fcbbadeaabccb4388e91d Mon Sep 17 00:00:00 2001 From: Daniel Anderson Date: Fri, 17 Jul 2026 23:17:05 +1000 Subject: [PATCH] Bump to 1.0.25: restore Obsidian 1.12 compatibility, lower minAppVersion to 1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Obsidian 1.13 is not generally available (stable is 1.12.x), so releases 1.0.20-1.0.24 — whose minAppVersion 1.13.0 floor was raised to satisfy the review's no-unsupported-api check — were uninstallable for everyone; updaters correctly capped users at 1.0.19, and on 1.12.7 the settings tab rendered blank because 1.0.20 deleted the pre-1.13 display() path. Restores dual-path settings rendering with zero 1.13-only API references: getSettingDefinitions() still drives the declarative 1.13+ path, display() is back as the imperative fallback sharing the same per-setting builders, internal refreshes rebuild imperatively (identical output on both paths, avoids the 1.13-only update()), and the Reset-everything button gets its destructive styling via the mod-warning class rather than setDestructive()/setWarning(). minAppVersion back to 1.7.2; versions.json maps 1.0.25 accordingly so pre-1.13 devices jump straight from 1.0.19 to 1.0.25. --- README.md | 2 +- manifest.json | 4 +-- package-lock.json | 4 +-- package.json | 2 +- src/settings.ts | 79 +++++++++++++++++++++++++++++++++++++++-------- versions.json | 3 +- 6 files changed, 74 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index cbd7d3f..af44c59 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ Visual Notes only reads and writes files inside your own vault — it makes no n |---|---| | Obsidian desktop (Mac, Windows, Linux) | ✅ Supported | | Obsidian mobile (iOS, iPadOS) | ✅ Supported | -| Minimum Obsidian version | 1.13.0 | +| Minimum Obsidian version | 1.7.2 | --- diff --git a/manifest.json b/manifest.json index bc34400..4004f6b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "id": "visual-notes", "name": "Visual Notes", - "version": "1.0.24", - "minAppVersion": "1.13.0", + "version": "1.0.25", + "minAppVersion": "1.7.2", "description": "A visual workspace built on the Canvas format: nestable freeform boards, icon tile grids, kanban boards, sticky notes, checklists, columns, drawing with pen and highlighter, labels, reactions, and more.", "author": "Daniel Anderson", "isDesktopOnly": false diff --git a/package-lock.json b/package-lock.json index 7a5ea4d..cb26a7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "visual-notes", - "version": "1.0.24", + "version": "1.0.25", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "visual-notes", - "version": "1.0.24", + "version": "1.0.25", "license": "MIT", "dependencies": { "sortablejs": "^1.15.7" diff --git a/package.json b/package.json index 6118d5d..aae84fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "visual-notes", - "version": "1.0.24", + "version": "1.0.25", "description": "Visual Notes — a visual workspace for Obsidian", "main": "main.js", "scripts": { diff --git a/src/settings.ts b/src/settings.ts index 7791d6d..4c94e8e 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -27,11 +27,15 @@ class BoardPickerModal extends FuzzySuggestModal { // ── Settings tab ────────────────────────────────────────────── // -// Rendered declaratively via getSettingDefinitions() (Obsidian 1.13+, which -// is the plugin's minAppVersion) — the app renders each definition and -// indexes every setting's name/desc for its settings search. Each setting's -// controls are built by a small `buildX(setting)` method that fills in the -// Setting the app created for it. +// Two rendering paths, one body per setting so they can never drift: +// Obsidian 1.13+ renders declaratively from getSettingDefinitions() (and +// indexes each setting's name/desc for its settings search); older +// versions call display(), which builds the same settings imperatively. +// IMPORTANT: no 1.13-only APIs may be referenced here (update(), +// setDestructive(), …) — minAppVersion predates them and the plugin +// review's obsidianmd/no-unsupported-api check flags even guarded +// references. Obsidian 1.13 is not generally available yet (stable is +// 1.12.x as of 2026-07), so the floor must stay below 1.13. export class VisualNotesSettingsTab extends PluginSettingTab { plugin: VisualNotesPlugin; @@ -101,11 +105,57 @@ export class VisualNotesSettingsTab extends PluginSettingTab { ]; } + // ── Imperative fallback (Obsidian < 1.13) ─────────────────── + // Not called by the app on 1.13+ (getSettingDefinitions() takes over). + + override display(): void { + this.renderImperative(); + } + // Re-render after a settings mutation that changes the tab's structure - // (reset buttons, board picker's Clear visibility, sticky palette): - // update() re-renders the tab from fresh definitions. + // (reset buttons, board picker's Clear visibility, sticky palette). + // Rebuilds imperatively on both paths: on 1.13+ the proper API would be + // update(), but that's 1.13-only and even a guarded reference trips the + // review's no-unsupported-api check — and an imperative rebuild renders + // identically since both paths share the same buildX bodies. private refresh(): void { - this.update(); + this.renderImperative(); + } + + private renderImperative(): void { + const { containerEl } = this; + containerEl.empty(); + + this.buildOpenOnStartup(new Setting(containerEl)); + this.buildDefaultBoard(new Setting(containerEl)); + + new Setting(containerEl).setName('Freeform canvas').setHeading(); + this.buildToolbarPosition(new Setting(containerEl)); + this.buildDotColor(new Setting(containerEl)); + this.buildDotSize(new Setting(containerEl)); + this.buildCanvasBgColor(new Setting(containerEl)); + this.buildCardDragAnimation(new Setting(containerEl)); + this.buildCardDragAnimationIntensity(new Setting(containerEl)); + this.buildSnapToGrid(new Setting(containerEl)); + this.buildGridSize(new Setting(containerEl)); + this.buildTrashZoneSize(new Setting(containerEl)); + this.buildLargeKanbanItems(new Setting(containerEl)); + this.buildBookmarkCacheDuration(new Setting(containerEl)); + this.buildDefaultStickyColor(new Setting(containerEl)); + this.buildCommentAuthorName(new Setting(containerEl)); + + new Setting(containerEl).setName('Assets').setHeading(); + this.buildAutoSortAssets(new Setting(containerEl)); + this.buildAutoRelinkOnOpen(new Setting(containerEl)); + this.buildRelinkAllBoardsNow(new Setting(containerEl)); + + new Setting(containerEl).setName('Data').setHeading(); + this.buildExportTilesJson(new Setting(containerEl)); + this.buildImportDesc(new Setting(containerEl)); + this.buildImportButton(new Setting(containerEl)); + + new Setting(containerEl).setName('Danger zone').setHeading(); + this.buildResetAllTiles(new Setting(containerEl)); } // ── Per-setting builders ───────────────────────────────────── @@ -530,10 +580,13 @@ export class VisualNotesSettingsTab extends PluginSettingTab { setting .setName('Reset all tiles') .setDesc('Permanently delete every tile and nested board. This cannot be undone.') - .addButton(btn => - btn + .addButton(btn => { + // The destructive red styling on every supported version, without + // referencing setWarning() (deprecated) or setDestructive() + // (1.13-only, above our minAppVersion). + btn.buttonEl.addClass('mod-warning'); + return btn .setButtonText('Reset everything') - .setDestructive() .onClick(() => { new ConfirmModal( this.app, @@ -544,7 +597,7 @@ export class VisualNotesSettingsTab extends PluginSettingTab { new Notice('All tiles deleted.'); })(); } ).open(); - }) - ); + }); + }); } } diff --git a/versions.json b/versions.json index 0347509..46dd436 100644 --- a/versions.json +++ b/versions.json @@ -23,5 +23,6 @@ "1.0.21": "1.13.0", "1.0.22": "1.13.0", "1.0.23": "1.13.0", - "1.0.24": "1.13.0" + "1.0.24": "1.13.0", + "1.0.25": "1.7.2" }