diff --git a/RELEASE_NOTES_1.0.6.md b/RELEASE_NOTES_1.0.6.md new file mode 100644 index 0000000..ba872ba --- /dev/null +++ b/RELEASE_NOTES_1.0.6.md @@ -0,0 +1,24 @@ +# Vault2Dify 1.0.6 + +## Added + +- No user-facing features in this release. + +## Fixed + +- Fixed the settings page heading layout so the Vault2Dify title, subtitle, and major section titles align naturally with the settings content. +- Tightened the spacing between the Vault2Dify title and subtitle. +- Kept the Directory mapping title aligned with the Add mapping button while preserving consistent title-to-content spacing across Connection, Directory mapping, and Sync settings. + +## Obsidian Review + +- Kept the fix scoped to the production settings UI and avoided prototype, sync behavior, or mapping logic changes. +- Added regression coverage for heading alignment, subtitle spacing, and section action alignment without relying on transform or manual offset patches. + +## Validation + +- `git diff --check` +- `npm run typecheck` +- `npm test` +- `npm run build` +- `npm run install:test-vault` diff --git a/manifest.json b/manifest.json index fd98f6a..b8eb201 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { "id": "vault-to-dify", "name": "Vault2Dify", - "version": "1.0.5", + "version": "1.0.6", "minAppVersion": "1.12.7", "description": "Sync selected Markdown notes to a Dify Knowledge Base.", "author": "WenBin", "authorUrl": "https://github.com/BeatsAD", "isDesktopOnly": true -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e569dcf..f564547 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vault-to-dify", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vault-to-dify", - "version": "1.0.5", + "version": "1.0.6", "license": "MIT", "devDependencies": { "@eslint/js": "^9.39.4", diff --git a/package.json b/package.json index 4b0634d..4a2a0f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vault-to-dify", - "version": "1.0.5", + "version": "1.0.6", "description": "Sync your Obsidian Vault to Dify Knowledge Base", "main": "main.js", "scripts": { diff --git a/styles.css b/styles.css index ed480d4..dcccf2e 100644 --- a/styles.css +++ b/styles.css @@ -191,6 +191,30 @@ gap: 4px; } +.dify-sync-settings .title-line > .setting-item, +.dify-sync-settings .heading-line > .setting-item { + display: block; + min-height: 0; + margin: 0; + padding: 0; + border: 0; +} + +.dify-sync-settings .title-line > .setting-item > .setting-item-info, +.dify-sync-settings .heading-line > .setting-item > .setting-item-info { + width: auto; + margin: 0; + padding: 0; + flex: 0 1 auto; +} + +.dify-sync-settings .title-line .setting-item-name, +.dify-sync-settings .heading-line .setting-item-name { + margin: 0; + padding: 0; + line-height: inherit; +} + .dify-sync-settings .heading-text { display: inline-block; position: static; @@ -224,7 +248,7 @@ } .dify-sync-settings .settings-subtitle { - margin: 0.125rem 0 0; + margin: 4px 0 0; max-width: min(100%, 34rem); color: var(--text-muted); font-size: 0.86rem; diff --git a/tests/settings-review-ui.test.mjs b/tests/settings-review-ui.test.mjs index ffbbc9d..0732450 100644 --- a/tests/settings-review-ui.test.mjs +++ b/tests/settings-review-ui.test.mjs @@ -20,7 +20,7 @@ function readTestVaultFile(relativePath) { `Missing external Obsidian test vault file: ${filePath}. ` + "Run `npm run install:test-vault` before `npm test`, or set VAULT2DIFY_TEST_VAULT to another prepared vault.", ); - } + } throw error; } } @@ -385,7 +385,18 @@ test("settings topbar renders localized plugin subtitle below the title", () => ".dify-sync-settings .title-line", "flex-direction: column;", "align-items: flex-start;", + ".dify-sync-settings .title-line > .setting-item,", + ".dify-sync-settings .heading-line > .setting-item", + "min-height: 0;", + "border: 0;", + ".dify-sync-settings .title-line > .setting-item > .setting-item-info,", + ".dify-sync-settings .heading-line > .setting-item > .setting-item-info", + "flex: 0 1 auto;", + ".dify-sync-settings .title-line .setting-item-name,", + ".dify-sync-settings .heading-line .setting-item-name", + "line-height: inherit;", ".dify-sync-settings .settings-subtitle", + "margin: 4px 0 0;", "color: var(--text-muted);", "overflow-wrap: anywhere;", ".dify-sync-settings .title-line > .heading-text,", @@ -1060,9 +1071,52 @@ test("test vault plugin styles keep natural topbar title alignment", () => { /\.dify-sync-settings \.title-line\s*\{[^}]*padding-left:/s, "Topbar title group should not be pushed right as a whole", ); + assert.match( + source, + /\.dify-sync-settings \.title-line > \.setting-item,\s*\.dify-sync-settings \.heading-line > \.setting-item\s*\{[^}]*min-height: 0;[^}]*margin: 0;[^}]*padding: 0;[^}]*border: 0;/s, + "Title rows should locally reset Obsidian Setting spacing instead of using manual offsets", + ); + assert.match( + source, + /\.dify-sync-settings \.settings-subtitle\s*\{[^}]*margin: 4px 0 0;/s, + "Topbar subtitle should sit close below the plugin title", + ); } }); +test("section headings share spacing and align action buttons", () => { + const mappingSectionBlock = mainSource.slice( + mainSource.indexOf("private renderMappingSection"), + mainSource.indexOf("private renderMainMappingPagination"), + ); + const createReviewSectionBlock = mainSource.slice( + mainSource.indexOf("private createReviewSection"), + mainSource.indexOf("private createSettingName"), + ); + + sourceContainsAll(mappingSectionBlock, [ + "this.createReviewSection(containerEl, 'mapping-title', this.plugin.t('settingsReviewMappingTitle'), (head) => {", + "const add = new ButtonComponent(head)", + ".setButtonText(this.plugin.t('addMapping'))", + ]); + sourceContainsAll(createReviewSectionBlock, [ + "const head = section.createDiv('section-head');", + "const titleLine = head.createDiv('heading-line');", + "const heading = new Setting(titleLine).setName(title).setHeading();", + "if (renderAction) renderAction(head);", + ]); + assert.match( + stylesSource, + /\.dify-sync-settings \.topbar,\s*\.dify-sync-settings \.section-head,\s*\.dify-sync-modal \.pending-mapping-head\s*\{[^}]*align-items: center;[^}]*justify-content: space-between;/s, + "Section headings and right-side actions should align through the shared section-head flex row", + ); + assert.match( + stylesSource, + /\.dify-sync-settings \.section-head\s*\{[^}]*margin-bottom: 0\.5rem;/s, + "Major settings sections should keep a consistent title-to-content gap", + ); +}); + test("settings body copy and buttons use consistent regular typography outside major headings", () => { sourceContainsAll(stylesSource, [ "/* Typography override: normalize dense settings copy while heading rules opt back into heavier weights. */", diff --git a/versions.json b/versions.json index 3e42a2e..e2a92c0 100644 --- a/versions.json +++ b/versions.json @@ -3,5 +3,6 @@ "1.0.2": "1.13.0", "1.0.3": "1.13.0", "1.0.4": "1.13.0", - "1.0.5": "1.12.7" -} + "1.0.5": "1.12.7", + "1.0.6": "1.12.7" +} \ No newline at end of file