From e9998e28067a9814bfc6a9cf9c87701fa6607620 Mon Sep 17 00:00:00 2001 From: t8y2 Date: Sun, 27 Sep 2026 22:37:49 +0000 Subject: [PATCH] feat(ai): add independent conversation font settings Closes #9584 --- .../src/components/editor/AiAssistant.vue | 29 +++- .../editor/EditorSettingsDialog.vue | 139 ++++++++++++++++++ .../__tests__/AiAssistant.mount.spec.ts | 119 ++++++++++++++- .../__tests__/AiAssistant.typography.spec.ts | 20 +++ .../EditorSettingsDialog.aiTypography.spec.ts | 25 ++++ apps/desktop/src/i18n/locales/az.ts | 6 + apps/desktop/src/i18n/locales/en.ts | 6 + apps/desktop/src/i18n/locales/es.ts | 6 + apps/desktop/src/i18n/locales/it.ts | 6 + apps/desktop/src/i18n/locales/ja.ts | 6 + apps/desktop/src/i18n/locales/ko.ts | 6 + apps/desktop/src/i18n/locales/pt-BR.ts | 6 + apps/desktop/src/i18n/locales/ru.ts | 6 + apps/desktop/src/i18n/locales/tr.ts | 6 + apps/desktop/src/i18n/locales/zh-CN.ts | 6 + apps/desktop/src/i18n/locales/zh-TW.ts | 6 + .../src/lib/ai/__tests__/aiTypography.spec.ts | 49 ++++++ apps/desktop/src/lib/ai/aiTypography.ts | 50 +++++++ .../src/lib/settings/settingsSearch.ts | 2 + .../stores/__tests__/settingsStore.spec.ts | 62 ++++++++ apps/desktop/src/stores/settingsStore.ts | 9 ++ 21 files changed, 563 insertions(+), 7 deletions(-) create mode 100644 apps/desktop/src/components/editor/__tests__/AiAssistant.typography.spec.ts create mode 100644 apps/desktop/src/components/editor/__tests__/EditorSettingsDialog.aiTypography.spec.ts create mode 100644 apps/desktop/src/lib/ai/__tests__/aiTypography.spec.ts create mode 100644 apps/desktop/src/lib/ai/aiTypography.ts diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vue index d9a6d5967e..7bbab812dc 100644 --- a/apps/desktop/src/components/editor/AiAssistant.vue +++ b/apps/desktop/src/components/editor/AiAssistant.vue @@ -66,6 +66,7 @@ import { useSavedSqlStore } from "@/stores/savedSqlStore"; import { usePromptTemplateStore } from "@/stores/promptTemplateStore"; import { useUserSkillStore } from "@/stores/userSkillStore"; import { buildSelectedSkillChips, capSkillsToCharLimit, removeSkillIds, userSkillSourceOfId } from "@/lib/ai/userSkillSelection"; +import { aiConversationTypographyCssVariables } from "@/lib/ai/aiTypography"; import { ACTIVE_SKILLS_TOTAL_MAX, type ReadUserSkill, type ReadUserSkillFailure, type UserSkillFailureReason, type UserSkillRootSettings } from "@/types/userSkills"; import { supportsAiAssistantContext } from "@/lib/database/databaseFeatureSupport"; import ConnectionIcon from "@/components/icons/ConnectionIcon.vue"; @@ -210,6 +211,12 @@ const AiHtmlPreview = defineAsyncComponent({ loader: () => import("@/components/ai/rich/AiHtmlPreview.vue"), }); const settings = useSettingsStore(); +const aiTypographyStyle = computed(() => + aiConversationTypographyCssVariables({ + fontFamily: settings.editorSettings.aiFontFamily, + fontSize: settings.editorSettings.aiFontSize, + }), +); const connectionStore = useConnectionStore(); const savedSqlStore = useSavedSqlStore(); const promptTemplateStore = usePromptTemplateStore(); @@ -5419,7 +5426,7 @@ async function openExternalUrl(url: string) {