From e25cb9796a35612b8147dd6baa375ae3f65c3f5d Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 6 Mar 2026 16:35:46 +0100 Subject: [PATCH] Remove AI sponsor feature and related settings; update changelog and localization files #983 --- CHANGELOG.md | 6 ++ package.json | 6 -- package.nls.de.json | 1 - package.nls.ja.json | 1 - package.nls.json | 1 - package.nls.zh-cn.json | 1 - src/constants/settings.ts | 5 -- src/helpers/PanelSettings.ts | 2 - src/helpers/Questions.ts | 65 +++++-------------- src/models/PanelSettings.ts | 1 - .../components/Fields/TagPicker.tsx | 19 +----- .../components/Fields/TextField.tsx | 16 +---- 12 files changed, 27 insertions(+), 97 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b1ea314..9c80c7ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,17 @@ ## [10.10.0] - 2025-xx-xx +- [#983](https://github.com/estruyf/vscode-front-matter/issues/983): Removal of the `frontMatter.sponsors.ai.enabled` features + ### 🎨 Enhancements - [#937](https://github.com/estruyf/vscode-front-matter/issues/937): Dashboard "Structure" view for documentation sites *WIP* - [#965](https://github.com/estruyf/vscode-front-matter/issues/965): Added SEO support for the keyword in the first paragraph - [#973](https://github.com/estruyf/vscode-front-matter/issues/973): Support for number fields in the snippets + +### 🐞 Fixes + +- [#984](https://github.com/estruyf/vscode-front-matter/issues/984): Fix in `frontMatter.global.timezone` is invalid - [#1004](https://github.com/estruyf/vscode-front-matter/issues/1004): Fix for `mediaDB.json` containing full paths on Windows instead of relative paths ### 🐞 Fixes diff --git a/package.json b/package.json index edee295a..79ea6a48 100644 --- a/package.json +++ b/package.json @@ -139,12 +139,6 @@ } } }, - "frontMatter.sponsors.ai.enabled": { - "type": "boolean", - "default": false, - "markdownDescription": "%setting.frontMatter.sponsors.ai.enabled.markdownDescription%", - "scope": "Sponsors" - }, "frontMatter.extensibility.scripts": { "type": "array", "markdownDescription": "%setting.frontMatter.extensibility.scripts.markdownDescription%", diff --git a/package.nls.de.json b/package.nls.de.json index b337f775..0ac8524a 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -52,7 +52,6 @@ "setting.frontMatter.projects.markdownDescription": "Geben Sie die Liste der Projekte an, die in Front Matter CMS geladen werden sollen. [Dokumentation prüfen](https://frontmatter.codes/docs/settings/overview#frontmatter.projects)", "setting.frontMatter.projects.items.properties.name.markdownDescription": "Geben Sie den Namen des Projekts an.", "setting.frontMatter.projects.items.properties.default.markdownDescription": "Geben Sie an, ob dieses Projekt das Standardprojekt zum Laden ist.", - "setting.frontMatter.sponsors.ai.enabled.markdownDescription": "Geben Sie an, ob Sie KI-Vorschläge aktivieren möchten. [Dokumentation prüfen](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled)", "setting.frontMatter.extensibility.scripts.markdownDescription": "Geben Sie die Liste der Skripte an, die in Front Matter CMS geladen werden sollen. [Dokumentation prüfen](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts)", "setting.frontMatter.experimental.markdownDescription": "Geben Sie an, ob Sie experimentelle Funktionen aktivieren möchten. [Dokumentation prüfen](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental)", "setting.frontMatter.extends.markdownDescription": "Geben Sie die Liste der Pfade/URLs an, um die Front Matter CMS-Konfiguration zu erweitern. [Dokumentation prüfen](https://frontmatter.codes/docs/settings/overview#frontmatter.extends)", diff --git a/package.nls.ja.json b/package.nls.ja.json index 258d1b2c..c21048ce 100644 --- a/package.nls.ja.json +++ b/package.nls.ja.json @@ -53,7 +53,6 @@ "setting.frontMatter.projects.markdownDescription": "Front Matter CMSを利用するプロジェクトを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.projects)", "setting.frontMatter.projects.items.properties.name.markdownDescription": "プロジェクトの名前を指定します。", "setting.frontMatter.projects.items.properties.default.markdownDescription": "このプロジェクトを読み込む既定のプロジェクトにするかどうかを指定します。", - "setting.frontMatter.sponsors.ai.enabled.markdownDescription": "AIによる提案を利用します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled)", "setting.frontMatter.extensibility.scripts.markdownDescription": "Front Matter CMSで読み込むスクリプトのリストを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts)", "setting.frontMatter.experimental.markdownDescription": "実験的な機能をオンにします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental)", "setting.frontMatter.extends.markdownDescription": "Front Matter CMSの構成を拡張するパス/URLのリストを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.extends)", diff --git a/package.nls.json b/package.nls.json index 8110f097..23d0e77f 100644 --- a/package.nls.json +++ b/package.nls.json @@ -55,7 +55,6 @@ "setting.frontMatter.projects.markdownDescription": "Specify the list of projects to load in the Front Matter CMS. [Local](https://file%2B.vscode-resource.vscode-cdn.net/Users/eliostruyf/nodejs/frontmatter-test-projects/astro-blog/test.html) - [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.projects) - [View in VS Code](vscode://simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.projects%22%5D)", "setting.frontMatter.projects.items.properties.name.markdownDescription": "Specify the name of the project.", "setting.frontMatter.projects.items.properties.default.markdownDescription": "Specify if this project is the default project to load.", - "setting.frontMatter.sponsors.ai.enabled.markdownDescription": "Specify if you want to enable AI suggestions. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.sponsors.ai.enabled%22%5D)", "setting.frontMatter.extensibility.scripts.markdownDescription": "Specify the list of scripts to load in the Front Matter CMS. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.extensibility.scripts%22%5D)", "setting.frontMatter.experimental.markdownDescription": "Specify if you want to enable the experimental features. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.experimental%22%5D)", "setting.frontMatter.extends.markdownDescription": "Specify the list of paths/URLs to extend the Front Matter CMS config. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.extends) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.extends%22%5D)", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index c57615d1..7a3d9577 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -55,7 +55,6 @@ "setting.frontMatter.projects.markdownDescription": "指定要在 Front Matter CMS 中加载的项目列表。[本地](https://file%2B.vscode-resource.vscode-cdn.net/Users/eliostruyf/nodejs/frontmatter-test-projects/astro-blog/test.html) - [文档](https://frontmatter.codes/docs/settings/overview#frontmatter.projects) - [在 VS Code 中查看](vscode://simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.projects%22%5D)", "setting.frontMatter.projects.items.properties.name.markdownDescription": "指定项目名称。", "setting.frontMatter.projects.items.properties.default.markdownDescription": "指定此项目是否为默认加载项目。", - "setting.frontMatter.sponsors.ai.enabled.markdownDescription": "指定是否启用 AI 建议。[文档](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled) - [在 VS Code 中查看](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.sponsors.ai.enabled%22%5D)", "setting.frontMatter.extensibility.scripts.markdownDescription": "指定要在 Front Matter CMS 中加载的脚本列表。[文档](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts) - [在 VS Code 中查看](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.extensibility.scripts%22%5D)", "setting.frontMatter.experimental.markdownDescription": "指定是否启用实验性功能。[文档](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental) - [在 VS Code 中查看](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.experimental%22%5D)", "setting.frontMatter.extends.markdownDescription": "指定扩展 Front Matter CMS 配置的路径/URL 列表。[文档](https://frontmatter.codes/docs/settings/overview#frontmatter.extends) - [在 VS Code 中查看](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.extends%22%5D)", diff --git a/src/constants/settings.ts b/src/constants/settings.ts index 6c96af7e..ec68a1d3 100644 --- a/src/constants/settings.ts +++ b/src/constants/settings.ts @@ -120,11 +120,6 @@ export const SETTING_COPILOT_FAMILY = 'copilot.family'; export const SETTING_LOGGING = 'logging'; -/** - * Sponsors only settings - */ -export const SETTING_SPONSORS_AI_ENABLED = 'sponsors.ai.enabled'; - /** * Project override support */ diff --git a/src/helpers/PanelSettings.ts b/src/helpers/PanelSettings.ts index 350e7a4e..31b61809 100644 --- a/src/helpers/PanelSettings.ts +++ b/src/helpers/PanelSettings.ts @@ -1,7 +1,6 @@ import { SETTING_GLOBAL_TIMEZONE, SETTING_PANEL_ACTIONS_DISABLED, - SETTING_SPONSORS_AI_ENABLED, SETTING_WEBSITE_URL } from './../constants/settings'; import { workspace } from 'vscode'; @@ -52,7 +51,6 @@ export class PanelSettings { try { return { - aiEnabled: Settings.get(SETTING_SPONSORS_AI_ENABLED) || false, copilotEnabled: await Copilot.isInstalled(), git: await GitListener.getSettings(), seo: { diff --git a/src/helpers/Questions.ts b/src/helpers/Questions.ts index 2a1cbe6b..45f8a96e 100644 --- a/src/helpers/Questions.ts +++ b/src/helpers/Questions.ts @@ -1,11 +1,8 @@ -import { authentication, QuickPickItem, QuickPickItemKind, window } from 'vscode'; +import { QuickPickItem, QuickPickItemKind, window } from 'vscode'; import { Folders } from '../commands/Folders'; -import { SETTING_SPONSORS_AI_ENABLED } from '../constants'; import { ContentType } from './ContentType'; import { Notifications } from './Notifications'; -import { Settings } from './SettingsHelper'; import { Logger } from './Logger'; -import { SponsorAi } from '../services/SponsorAI'; import * as l10n from '@vscode/l10n'; import { LocalizationKey } from '../localization'; import { ContentFolder } from '../models'; @@ -40,56 +37,28 @@ export class Questions { * @returns */ public static async ContentTitle(showWarning = true): Promise { - const aiEnabled = Settings.get(SETTING_SPONSORS_AI_ENABLED); let title: string | undefined = ''; const isCopilotInstalled = await Copilot.isInstalled(); let aiTitles: string[] | undefined; - if (aiEnabled || isCopilotInstalled) { - if (isCopilotInstalled) { - title = await window.showInputBox({ - title: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputTitle), - prompt: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputPrompt), - placeHolder: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputPlaceholder), - ignoreFocusOut: true - }); + if (isCopilotInstalled) { + title = await window.showInputBox({ + title: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputTitle), + prompt: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputPrompt), + placeHolder: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputPlaceholder), + ignoreFocusOut: true + }); - if (title) { - try { - aiTitles = await Copilot.suggestTitles(title); - } catch (e) { - Logger.error((e as Error).message); - Notifications.error( - l10n.t(LocalizationKey.helpersQuestionsContentTitleCopilotInputFailed) - ); - title = undefined; - } - } - } else { - const githubAuth = await authentication.getSession('github', ['read:user'], { - silent: true - }); - - if (githubAuth && githubAuth.account.label) { - title = await window.showInputBox({ - title: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputTitle), - prompt: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputPrompt), - placeHolder: l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputPlaceholder), - ignoreFocusOut: true - }); - - if (title) { - try { - aiTitles = await SponsorAi.getTitles(githubAuth.accessToken, title); - } catch (e) { - Logger.error((e as Error).message); - Notifications.error( - l10n.t(LocalizationKey.helpersQuestionsContentTitleAiInputFailed) - ); - title = undefined; - } - } + if (title) { + try { + aiTitles = await Copilot.suggestTitles(title); + } catch (e) { + Logger.error((e as Error).message); + Notifications.error( + l10n.t(LocalizationKey.helpersQuestionsContentTitleCopilotInputFailed) + ); + title = undefined; } } diff --git a/src/models/PanelSettings.ts b/src/models/PanelSettings.ts index 02f410de..30a1495f 100644 --- a/src/models/PanelSettings.ts +++ b/src/models/PanelSettings.ts @@ -28,7 +28,6 @@ export interface PanelSettings { dataTypes: DataType[] | undefined; fieldGroups: FieldGroup[] | undefined; commaSeparatedFields: string[]; - aiEnabled: boolean; copilotEnabled: boolean; contentFolders: ContentFolder[]; websiteUrl: string; diff --git a/src/panelWebView/components/Fields/TagPicker.tsx b/src/panelWebView/components/Fields/TagPicker.tsx index aad7fdbf..ba1fd58f 100644 --- a/src/panelWebView/components/Fields/TagPicker.tsx +++ b/src/panelWebView/components/Fields/TagPicker.tsx @@ -12,7 +12,7 @@ import { FieldMessage } from '../Fields/FieldMessage'; import { FieldTitle } from '../Fields/FieldTitle'; import { useRecoilValue } from 'recoil'; import { PanelSettingsAtom } from '../../state'; -import { SparklesIcon } from '@heroicons/react/24/outline'; +import { XMarkIcon } from '@heroicons/react/24/outline'; import { LocalizationKey, localize } from '../../../localization'; import useDropdownStyle from '../../hooks/useDropdownStyle'; import { CopilotIcon } from '../Icons'; @@ -311,21 +311,6 @@ const TagPicker: React.FunctionComponent = ({ return ( <> - {settings?.aiEnabled && ( - - )} - {settings?.copilotEnabled && ( - )} - {settings?.copilotEnabled && (