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" }