From c22d728fa5d30ccdf437048413d2462227a744d3 Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:37:48 +0800 Subject: [PATCH 1/9] add new setting view for UI settings, support markdown block lineheight --- evals/packages/types/src/roo-code-defaults.ts | 1 + evals/packages/types/src/roo-code.ts | 2 + src/core/webview/ClineProvider.ts | 3 ++ src/core/webview/webviewMessageHandler.ts | 4 ++ src/exports/roo-code.d.ts | 1 + src/exports/types.ts | 1 + src/schemas/index.ts | 2 + src/shared/ExtensionMessage.ts | 2 + src/shared/WebviewMessage.ts | 1 + .../src/components/common/MarkdownBlock.tsx | 8 +-- .../src/components/settings/SettingsView.tsx | 14 +++++ .../src/components/settings/UISettings.tsx | 51 +++++++++++++++++++ .../src/context/ExtensionStateContext.tsx | 6 +++ webview-ui/src/i18n/locales/ca/settings.json | 8 +++ webview-ui/src/i18n/locales/de/settings.json | 10 +++- webview-ui/src/i18n/locales/en/settings.json | 8 +++ webview-ui/src/i18n/locales/es/settings.json | 8 +++ webview-ui/src/i18n/locales/fr/settings.json | 8 +++ webview-ui/src/i18n/locales/hi/settings.json | 8 +++ webview-ui/src/i18n/locales/it/settings.json | 8 +++ webview-ui/src/i18n/locales/ja/settings.json | 8 +++ webview-ui/src/i18n/locales/ko/settings.json | 8 +++ webview-ui/src/i18n/locales/nl/settings.json | 8 +++ webview-ui/src/i18n/locales/pl/settings.json | 8 +++ .../src/i18n/locales/pt-BR/settings.json | 8 +++ webview-ui/src/i18n/locales/ru/settings.json | 8 +++ webview-ui/src/i18n/locales/tr/settings.json | 8 +++ webview-ui/src/i18n/locales/vi/settings.json | 8 +++ .../src/i18n/locales/zh-CN/settings.json | 8 +++ .../src/i18n/locales/zh-TW/settings.json | 8 +++ 30 files changed, 229 insertions(+), 5 deletions(-) create mode 100644 webview-ui/src/components/settings/UISettings.tsx diff --git a/evals/packages/types/src/roo-code-defaults.ts b/evals/packages/types/src/roo-code-defaults.ts index 9c20f94146..2c15a1210d 100644 --- a/evals/packages/types/src/roo-code-defaults.ts +++ b/evals/packages/types/src/roo-code-defaults.ts @@ -8,6 +8,7 @@ export const rooCodeDefaults: RooCodeSettings = { pinnedApiConfigs: {}, + markdownBlockLineheight: 1.25, autoApprovalEnabled: true, alwaysAllowReadOnly: true, alwaysAllowReadOnlyOutsideWorkspace: false, diff --git a/evals/packages/types/src/roo-code.ts b/evals/packages/types/src/roo-code.ts index 338ecd8b2a..4f713a50f3 100644 --- a/evals/packages/types/src/roo-code.ts +++ b/evals/packages/types/src/roo-code.ts @@ -731,6 +731,7 @@ export const globalSettingsSchema = z.object({ customInstructions: z.string().optional(), taskHistory: z.array(historyItemSchema).optional(), + markdownBlockLineheight: z.number().optional(), autoApprovalEnabled: z.boolean().optional(), alwaysAllowReadOnly: z.boolean().optional(), alwaysAllowReadOnlyOutsideWorkspace: z.boolean().optional(), @@ -810,6 +811,7 @@ const globalSettingsRecord: GlobalSettingsRecord = { customInstructions: undefined, taskHistory: undefined, + markdownBlockLineheight: undefined, autoApprovalEnabled: undefined, alwaysAllowReadOnly: undefined, alwaysAllowReadOnlyOutsideWorkspace: undefined, diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 27b7fa8217..c3f8b267cb 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1268,6 +1268,7 @@ export class ClineProvider extends EventEmitter implements maxReadFileLine, terminalCompressProgressBar, historyPreviewCollapsed, + markdownBlockLineheight, } = await this.getState() const telemetryKey = process.env.POSTHOG_API_KEY @@ -1356,6 +1357,7 @@ export class ClineProvider extends EventEmitter implements terminalCompressProgressBar: terminalCompressProgressBar ?? true, hasSystemPromptOverride, historyPreviewCollapsed: historyPreviewCollapsed ?? false, + markdownBlockLineheight: markdownBlockLineheight ?? 1.25, } } @@ -1446,6 +1448,7 @@ export class ClineProvider extends EventEmitter implements showRooIgnoredFiles: stateValues.showRooIgnoredFiles ?? true, maxReadFileLine: stateValues.maxReadFileLine ?? 500, historyPreviewCollapsed: stateValues.historyPreviewCollapsed ?? false, + markdownBlockLineheight: stateValues.markdownBlockLineheight ?? 1.25, } } diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index 3cb33561ea..a2be024d37 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -894,6 +894,10 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We await updateGlobalState("maxReadFileLine", message.value) await provider.postStateToWebview() break + case "markdownBlockLineheight": + await updateGlobalState("markdownBlockLineheight", message.value ?? 1.25) + await provider.postStateToWebview() + break case "setHistoryPreviewCollapsed": // Add the new case handler await updateGlobalState("historyPreviewCollapsed", message.bool ?? false) // No need to call postStateToWebview here as the UI already updated optimistically diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index e048db2b68..e1e90f8d48 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -56,6 +56,7 @@ type GlobalSettings = { workspace?: string | undefined }[] | undefined + markdownBlockLineheight: number | undefined autoApprovalEnabled?: boolean | undefined alwaysAllowReadOnly?: boolean | undefined alwaysAllowReadOnlyOutsideWorkspace?: boolean | undefined diff --git a/src/exports/types.ts b/src/exports/types.ts index 752ea976c1..4a3642ad6e 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -56,6 +56,7 @@ type GlobalSettings = { workspace?: string | undefined }[] | undefined + markdownBlockLineheight?: number | undefined autoApprovalEnabled?: boolean | undefined alwaysAllowReadOnly?: boolean | undefined alwaysAllowReadOnlyOutsideWorkspace?: boolean | undefined diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 516d7cb430..065020f003 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -735,6 +735,7 @@ export const globalSettingsSchema = z.object({ customInstructions: z.string().optional(), taskHistory: z.array(historyItemSchema).optional(), + markdownBlockLineheight: z.number().optional(), autoApprovalEnabled: z.boolean().optional(), alwaysAllowReadOnly: z.boolean().optional(), alwaysAllowReadOnlyOutsideWorkspace: z.boolean().optional(), @@ -815,6 +816,7 @@ const globalSettingsRecord: GlobalSettingsRecord = { customInstructions: undefined, taskHistory: undefined, + markdownBlockLineheight: undefined, autoApprovalEnabled: undefined, alwaysAllowReadOnly: undefined, alwaysAllowReadOnlyOutsideWorkspace: undefined, diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index ce23437537..98731e2ee7 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -70,6 +70,7 @@ export interface ExtensionMessage { | "commandExecutionStatus" | "vsCodeSetting" | "condenseTaskContextResponse" + | "markdownBlockLineheight" text?: string action?: | "chatButtonClicked" @@ -170,6 +171,7 @@ export type ExtensionState = Pick< | "customModePrompts" | "customSupportPrompts" | "enhancementApiConfigId" + | "markdownBlockLineheight" > & { version: string clineMessages: ClineMessage[] diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 6d6c832e75..27cb07737d 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -132,6 +132,7 @@ export interface WebviewMessage { | "toggleApiConfigPin" | "setHistoryPreviewCollapsed" | "condenseTaskContextRequest" + | "markdownBlockLineheight" text?: string disabled?: boolean askResponse?: ClineAskResponse diff --git a/webview-ui/src/components/common/MarkdownBlock.tsx b/webview-ui/src/components/common/MarkdownBlock.tsx index a9c5ada19a..9609dd6360 100644 --- a/webview-ui/src/components/common/MarkdownBlock.tsx +++ b/webview-ui/src/components/common/MarkdownBlock.tsx @@ -55,7 +55,7 @@ const remarkUrlToLink = () => { } } -const StyledMarkdown = styled.div` +const StyledMarkdown = styled.div<{ lineheight: number | string }>` code:not(pre > code) { font-family: var(--vscode-editor-font-family, monospace); filter: saturation(110%) brightness(95%); @@ -95,7 +95,7 @@ const StyledMarkdown = styled.div` li, ol, ul { - line-height: 1.25; + line-height: ${(props) => props.lineheight}; } ol, @@ -122,7 +122,7 @@ const StyledMarkdown = styled.div` ` const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => { - const { theme } = useExtensionState() + const { theme, markdownBlockLineheight } = useExtensionState() const [reactContent, setMarkdown] = useRemark({ remarkPlugins: [ remarkUrlToLink, @@ -229,7 +229,7 @@ const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => { return (
- {reactContent} + {reactContent}
) }) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index f9c2425222..f692cfbc03 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -23,6 +23,7 @@ import { Globe, Info, LucideIcon, + Brush, } from "lucide-react" import { ExperimentId } from "@roo/shared/experiments" @@ -49,6 +50,7 @@ import { import { Tab, TabContent, TabHeader, TabList, TabTrigger } from "../common/Tab" import { SetCachedStateField, SetExperimentEnabled } from "./types" +import { UISettings } from "./UISettings" import { SectionHeader } from "./SectionHeader" import ApiConfigManager from "./ApiConfigManager" import ApiOptions from "./ApiOptions" @@ -77,6 +79,7 @@ export interface SettingsViewRef { const sectionNames = [ "providers", + "uiSettings", "autoApprove", "browser", "checkpoints", @@ -160,6 +163,7 @@ const SettingsView = forwardRef(({ onDone, t remoteBrowserEnabled, maxReadFileLine, terminalCompressProgressBar, + markdownBlockLineheight, } = cachedState const apiConfiguration = useMemo(() => cachedState.apiConfiguration ?? {}, [cachedState.apiConfiguration]) @@ -284,6 +288,7 @@ const SettingsView = forwardRef(({ onDone, t vscode.postMessage({ type: "alwaysAllowSubtasks", bool: alwaysAllowSubtasks }) vscode.postMessage({ type: "upsertApiConfiguration", text: currentApiConfigName, apiConfiguration }) vscode.postMessage({ type: "telemetrySetting", text: telemetrySetting }) + vscode.postMessage({ type: "markdownBlockLineheight", value: markdownBlockLineheight }) setChangeDetected(false) } } @@ -354,6 +359,7 @@ const SettingsView = forwardRef(({ onDone, t const sections: { id: SectionName; icon: LucideIcon }[] = useMemo( () => [ { id: "providers", icon: Webhook }, + { id: "uiSettings", icon: Brush }, { id: "autoApprove", icon: CheckCheck }, { id: "browser", icon: SquareMousePointer }, { id: "checkpoints", icon: GitBranch }, @@ -547,6 +553,14 @@ const SettingsView = forwardRef(({ onDone, t )} + {/* UISettings Section */} + {activeTab === "uiSettings" && ( + + )} + {/* Auto-Approve Section */} {activeTab === "autoApprove" && ( & { + markdownBlockLineheight: number + setCachedStateField: SetCachedStateField<"markdownBlockLineheight"> +} + +export const UISettings = ({ markdownBlockLineheight, setCachedStateField, className, ...props }: UISettingsProps) => { + const { t } = useAppTranslation() + return ( +
+ +
+ +
{t("settings:sections.uiSettings")}
+
+
+ +
+
+ + {t("settings:uiSettings.markdownBlockLineheight.label")} + +
+ setCachedStateField("markdownBlockLineheight", value)} + data-testid="open-tabs-limit-slider" + /> + {markdownBlockLineheight ?? 1.25} +
+
+ {t("settings:uiSettings.markdownBlockLineheight.description")} +
+
+
+
+ ) +} diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 4194c9b11f..6d29b44b12 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -24,6 +24,8 @@ export interface ExtensionStateContextType extends ExtensionState { currentCheckpoint?: string filePaths: string[] openedTabs: Array<{ label: string; isActive: boolean; path?: string }> + markdownBlockLineheight: number | undefined + setMarkdownBlockLineheight: (value: number) => void setApiConfiguration: (config: ProviderSettings) => void setCustomInstructions: (value?: string) => void setAlwaysAllowReadOnly: (value: boolean) => void @@ -159,6 +161,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode customSupportPrompts: {}, experiments: experimentDefault, enhancementApiConfigId: "", + markdownBlockLineheight: 1.25, autoApprovalEnabled: false, customModes: [], maxOpenTabsContext: 20, @@ -266,6 +269,9 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode fuzzyMatchThreshold: state.fuzzyMatchThreshold, writeDelayMs: state.writeDelayMs, screenshotQuality: state.screenshotQuality, + markdownBlockLineheight: state.markdownBlockLineheight, + setMarkdownBlockLineheight: (value) => + setState((prevState) => ({ ...prevState, markdownBlockLineheight: value })), setExperimentEnabled: (id, enabled) => setState((prevState) => ({ ...prevState, experiments: { ...prevState.experiments, [id]: enabled } })), setApiConfiguration: (value) => diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 0dca22bc49..2b73580aa1 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Proveïdors", + "uiSettings": "Configuració de la interfície", "autoApprove": "Auto-aprovació", "browser": "Accés a l'ordinador", "checkpoints": "Punts de control", @@ -324,6 +325,13 @@ "always_full_read": "Llegeix sempre el fitxer sencer" } }, + "uiSettings": { + "description": "Configuració relacionada amb la interfície d'usuari", + "markdownBlockLineheight": { + "label": "Espaiat entre línies del contingut del panell", + "description": "Ajusteu l'interlineat del contingut del panell per millorar la llegibilitat." + } + }, "terminal": { "basic": { "label": "Configuració del terminal: Bàsica", diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 0874415c21..b38facf3ee 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Anbieter", + "uiSettings": "界面设置", "autoApprove": "Auto-Genehmigung", "browser": "Computerzugriff", "checkpoints": "Kontrollpunkte", @@ -324,6 +325,13 @@ "always_full_read": "Immer die gesamte Datei lesen" } }, + "uiSettings": { + "description": "Benutzeroberflächenbezogene Konfiguration", + "markdownBlockLineheight": { + "label": "Zeilenabstand des Panelinhalts", + "description": "Passen Sie den Zeilenabstand des Panel-Inhalts an, um die Lesbarkeit zu verbessern." + } + }, "terminal": { "basic": { "label": "Terminal-Einstellungen: Grundlegend", @@ -331,7 +339,7 @@ }, "advanced": { "label": "Terminal-Einstellungen: Erweitert", - "description": "Die folgenden Optionen erfordern möglicherweise einen Terminal-Neustart, um die Einstellung zu übernehmen." + "descrip调整tion": "Die folgenden Optionen erfordern möglicherweise einen Terminal-Neustart, um die Einstellung zu übernehmen." }, "outputLineLimit": { "label": "Terminal-Ausgabelimit", diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 6fa457ab8f..883496d439 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Providers", + "uiSettings": "UI Settings", "autoApprove": "Auto-Approve", "browser": "Browser", "checkpoints": "Checkpoints", @@ -324,6 +325,13 @@ "always_full_read": "Always read entire file" } }, + "uiSettings": { + "description": "UI related configuration", + "markdownBlockLineheight": { + "label": "Content vertical spacing", + "description": "Adjust content vertical line spacing to improve readability." + } + }, "terminal": { "basic": { "label": "Terminal Settings: Basic", diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 43b23668c0..9555ee769b 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Proveedores", + "uiSettings": "界面设置", "autoApprove": "Auto-aprobación", "browser": "Acceso al ordenador", "checkpoints": "Puntos de control", @@ -324,6 +325,13 @@ "always_full_read": "Siempre leer el archivo completo" } }, + "uiSettings": { + "description": "Configuración relacionada con la interfaz de usuario", + "markdownBlockLineheight": { + "label": "Interlineado del contenido del panel", + "description": "Ajuste el espaciado entre líneas del contenido del panel para mejorar la legibilidad." + } + }, "terminal": { "basic": { "label": "Configuración del terminal: Básica", diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index c129a22c31..f11daa37ad 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Fournisseurs", + "uiSettings": "Paramètres de l'interface", "autoApprove": "Auto-approbation", "browser": "Accès ordinateur", "checkpoints": "Points de contrôle", @@ -324,6 +325,13 @@ "always_full_read": "Toujours lire le fichier entier" } }, + "uiSettings": { + "description": "Configuration liée à l'interface utilisateur", + "markdownBlockLineheight": { + "label": "Espacement des lignes du contenu du panneau", + "description": "Ajustez l'espacement des lignes de contenu du panneau pour améliorer la lisibilité." + } + }, "terminal": { "basic": { "label": "Paramètres du terminal : Base", diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 3b35311e9e..6f7cd31193 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "प्रदाता", + "uiSettings": "इंटरफ़ेस सेटिंग्स", "autoApprove": "अनुमोदन", "browser": "ब्राउज़र", "checkpoints": "चेकपॉइंट", @@ -324,6 +325,13 @@ "always_full_read": "हमेशा पूरी फ़ाइल पढ़ें" } }, + "uiSettings": { + "description": "उपयोगकर्ता इंटरफ़ेस संबंधित कॉन्फ़िगरेशन", + "markdownBlockLineheight": { + "label": "पैनल सामग्री पंक्ति रिक्ति", + "description": "पठनीयता में सुधार के लिए पैनल सामग्री की पंक्ति रिक्ति समायोजित करें." + } + }, "terminal": { "basic": { "label": "टर्मिनल सेटिंग्स: मूल", diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 52cadf7287..9ec427a741 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Fornitori", + "uiSettings": "Impostazioni dell'interfaccia", "autoApprove": "Auto-approvazione", "browser": "Accesso computer", "checkpoints": "Punti di controllo", @@ -324,6 +325,13 @@ "always_full_read": "Leggi sempre l'intero file" } }, + "uiSettings": { + "description": "Configurazione relativa all'interfaccia utente", + "markdownBlockLineheight": { + "label": "Interlinea del contenuto del pannello", + "description": "Regola la spaziatura delle righe del contenuto del pannello per migliorarne la leggibilità." + } + }, "terminal": { "basic": { "label": "Impostazioni terminale: Base", diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 32dbbe3bc6..6c383a1826 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "プロバイダー", + "uiSettings": "インターフェース設定", "autoApprove": "自動承認", "browser": "コンピューターアクセス", "checkpoints": "チェックポイント", @@ -324,6 +325,13 @@ "always_full_read": "常にファイル全体を読み込む" } }, + "uiSettings": { + "description": "ユーザーインターフェース関連の設定", + "markdownBlockLineheight": { + "label": "パネルコンテンツの行間隔", + "description": "読みやすさを向上させるために、パネル コンテンツの行間隔を調整します。" + } + }, "terminal": { "basic": { "label": "ターミナル設定:基本", diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 5087853391..c401ecef3b 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "공급자", + "uiSettings": "界面设置", "autoApprove": "자동 승인", "browser": "컴퓨터 접근", "checkpoints": "체크포인트", @@ -324,6 +325,13 @@ "always_full_read": "항상 전체 파일 읽기" } }, + "uiSettings": { + "description": "사용자 인터페이스 관련 구성", + "markdownBlockLineheight": { + "label": "패널 콘텐츠 줄 간격", + "description": "가독성을 높이려면 패널 콘텐츠 줄 간격을 조정하세요." + } + }, "terminal": { "basic": { "label": "터미널 설정: 기본", diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 10b8bd2ad4..4f19b48e67 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Providers", + "uiSettings": "Interface-instellingen", "autoApprove": "Auto-goedkeuren", "browser": "Browser", "checkpoints": "Checkpoints", @@ -324,6 +325,13 @@ "always_full_read": "Altijd volledig bestand lezen" } }, + "uiSettings": { + "description": "Gebruikersinterfacegerelateerde configuratie", + "markdownBlockLineheight": { + "label": "Regelafstand van paneelinhoud", + "description": "Pas de regelafstand van de paneelinhoud aan om de leesbaarheid te verbeteren." + } + }, "terminal": { "basic": { "label": "Terminalinstellingen: Basis", diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index 39160b5a67..e1a2794b36 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Dostawcy", + "uiSettings": "Ustawienia interfejsu", "autoApprove": "Auto-zatwierdzanie", "browser": "Dostęp komputera", "checkpoints": "Punkty kontrolne", @@ -324,6 +325,13 @@ "always_full_read": "Zawsze czytaj cały plik" } }, + "uiSettings": { + "description": "Konfiguracja związana z interfejsem użytkownika", + "markdownBlockLineheight": { + "label": "Odstęp między wierszami zawartości panelu", + "description": "Aby poprawić czytelność, dostosuj odstępy między wierszami zawartości panelu." + } + }, "terminal": { "basic": { "label": "Ustawienia terminala: Podstawowe", diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index ccf1e422a9..7e4b79a520 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Provedores", + "uiSettings": "Configurações de interface", "autoApprove": "Aprovação", "browser": "Navegador", "checkpoints": "Checkpoints", @@ -324,6 +325,13 @@ "always_full_read": "Sempre ler o arquivo inteiro" } }, + "uiSettings": { + "description": "Configuração relacionada à interface do usuário", + "markdownBlockLineheight": { + "label": "Espaçamento entre linhas do conteúdo do painel", + "description": "Ajuste o espaçamento entre linhas do conteúdo do painel para melhorar a legibilidade." + } + }, "terminal": { "basic": { "label": "Configurações do terminal: Básicas", diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index b73e37bdc1..61cee406f8 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Провайдеры", + "uiSettings": "Настройки интерфейса", "autoApprove": "Автоодобрение", "browser": "Доступ к компьютеру", "checkpoints": "Контрольные точки", @@ -324,6 +325,13 @@ "always_full_read": "Всегда читать весь файл" } }, + "uiSettings": { + "description": "Конфигурация, связанная с пользовательским интерфейсом", + "markdownBlockLineheight": { + "label": "Межстрочный интервал содержимого панели", + "description": "Отрегулируйте межстрочный интервал содержимого панели, чтобы улучшить читаемость." + } + }, "terminal": { "basic": { "label": "Настройки терминала: Основные", diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 2b192e9813..65c5327f64 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Sağlayıcılar", + "uiSettings": "Arayüz ayarları", "autoApprove": "Oto-Onay", "browser": "Bilgisayar Erişimi", "checkpoints": "Kontrol Noktaları", @@ -324,6 +325,13 @@ "always_full_read": "Her zaman tüm dosyayı oku" } }, + "uiSettings": { + "description": "Kullanıcı arayüzü ile ilgili konfigürasyon", + "markdownBlockLineheight": { + "label": "Panel içerik satır aralığı", + "description": "Okunabilirliği artırmak için panel içeriği satır aralığını ayarlayın." + } + }, "terminal": { "basic": { "label": "Terminal Ayarları: Temel", diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index 4c39eb62b0..3de32a9d90 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "Nhà cung cấp", + "uiSettings": "Cài đặt giao diện", "autoApprove": "Phê duyệt", "browser": "Trình duyệt", "checkpoints": "Điểm kiểm tra", @@ -324,6 +325,13 @@ "always_full_read": "Luôn đọc toàn bộ tệp" } }, + "uiSettings": { + "description": "Cấu hình liên quan đến giao diện người dùng", + "markdownBlockLineheight": { + "label": "Khoảng cách dòng nội dung bảng điều khiển", + "description": "Điều chỉnh khoảng cách giữa các dòng nội dung bảng điều khiển để dễ đọc hơn." + } + }, "terminal": { "basic": { "label": "Cài đặt Terminal: Cơ bản", diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 47bd13a2ba..3bbaa48d96 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "提供商", + "uiSettings": "界面设置", "autoApprove": "自动批准", "browser": "计算机交互", "checkpoints": "存档点", @@ -324,6 +325,13 @@ "always_full_read": "始终读取整个文件" } }, + "uiSettings": { + "description": "用户界面相关配置", + "markdownBlockLineheight": { + "label": "面板内容行间距", + "description": "调整面板内容行间距,以改善可读性。" + } + }, "terminal": { "basic": { "label": "终端设置:基础", diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 188d0fda88..469cdc4df6 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -22,6 +22,7 @@ }, "sections": { "providers": "供應商", + "uiSettings": "界面設置", "autoApprove": "自動核准", "browser": "電腦存取", "checkpoints": "檢查點", @@ -324,6 +325,13 @@ "always_full_read": "始終讀取整個檔案" } }, + "uiSettings": { + "description": "使用者界面相關設定", + "markdownBlockLineheight": { + "label": "使用者介面相關設定", + "description": "調整面板內容行間距,以改善可讀性。" + } + }, "terminal": { "basic": { "label": "終端機設定:基本", From b5466ff0fdc08b3b9b0683f52a82a8a015b324a3 Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:39:50 +0800 Subject: [PATCH 2/9] chore: remove useless words --- webview-ui/src/i18n/locales/de/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index b38facf3ee..f27ac60cce 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -339,7 +339,7 @@ }, "advanced": { "label": "Terminal-Einstellungen: Erweitert", - "descrip调整tion": "Die folgenden Optionen erfordern möglicherweise einen Terminal-Neustart, um die Einstellung zu übernehmen." + "description": "Die folgenden Optionen erfordern möglicherweise einen Terminal-Neustart, um die Einstellung zu übernehmen." }, "outputLineLimit": { "label": "Terminal-Ausgabelimit", From dcc1cb1678b0ef6a6bd92ccd28bab4230c6f8c72 Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:50:51 +0800 Subject: [PATCH 3/9] Update webview-ui/src/i18n/locales/es/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/es/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 9555ee769b..9946f382df 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -22,7 +22,7 @@ }, "sections": { "providers": "Proveedores", - "uiSettings": "界面设置", + "uiSettings": "Configuración de la interfaz de usuario", "autoApprove": "Auto-aprobación", "browser": "Acceso al ordenador", "checkpoints": "Puntos de control", From 4c1151192d1ded10c4db40fadb9062bbb1d79855 Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:50:58 +0800 Subject: [PATCH 4/9] Update webview-ui/src/i18n/locales/ko/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/ko/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index c401ecef3b..f241a3b6db 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -22,7 +22,7 @@ }, "sections": { "providers": "공급자", - "uiSettings": "界面设置", + "uiSettings": "UI 설정", "autoApprove": "자동 승인", "browser": "컴퓨터 접근", "checkpoints": "체크포인트", From ace4ba50474852a53128d7ef068efda9d9c912dd Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:51:04 +0800 Subject: [PATCH 5/9] Update webview-ui/src/i18n/locales/de/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/de/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index f27ac60cce..3dc809c21e 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -22,7 +22,7 @@ }, "sections": { "providers": "Anbieter", - "uiSettings": "界面设置", + "uiSettings": "UI-Einstellungen", "autoApprove": "Auto-Genehmigung", "browser": "Computerzugriff", "checkpoints": "Kontrollpunkte", From 161d397d1ca2cee00819bfdbdc2f666db2cf6562 Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:51:10 +0800 Subject: [PATCH 6/9] Update webview-ui/src/components/settings/UISettings.tsx Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/components/settings/UISettings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/UISettings.tsx b/webview-ui/src/components/settings/UISettings.tsx index 23bf1f171d..95661a5dac 100644 --- a/webview-ui/src/components/settings/UISettings.tsx +++ b/webview-ui/src/components/settings/UISettings.tsx @@ -37,7 +37,7 @@ export const UISettings = ({ markdownBlockLineheight, setCachedStateField, class step={0.01} value={[markdownBlockLineheight ?? 1.25]} onValueChange={([value]) => setCachedStateField("markdownBlockLineheight", value)} - data-testid="open-tabs-limit-slider" + data-testid="markdown-lineheight-slider" /> {markdownBlockLineheight ?? 1.25} From 7592f4fc55ba27a7eb36cf72d132b6480c0210ac Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:51:16 +0800 Subject: [PATCH 7/9] Update webview-ui/src/i18n/locales/zh-TW/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/zh-TW/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 469cdc4df6..7bcc1f2401 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -328,7 +328,7 @@ "uiSettings": { "description": "使用者界面相關設定", "markdownBlockLineheight": { - "label": "使用者介面相關設定", + "label": "面板內容行間距", "description": "調整面板內容行間距,以改善可讀性。" } }, From e638a56dcb53c3743fcb38df1f63c4b415c0d81c Mon Sep 17 00:00:00 2001 From: Yooooo Date: Sun, 11 May 2025 00:57:39 +0800 Subject: [PATCH 8/9] Change Variable name to a better camel-case format. --- evals/packages/types/src/roo-code-defaults.ts | 2 +- evals/packages/types/src/roo-code.ts | 4 ++-- src/core/webview/ClineProvider.ts | 6 +++--- src/core/webview/webviewMessageHandler.ts | 4 ++-- src/exports/roo-code.d.ts | 2 +- src/exports/types.ts | 2 +- src/schemas/index.ts | 4 ++-- src/shared/ExtensionMessage.ts | 4 ++-- src/shared/WebviewMessage.ts | 2 +- .../src/components/common/MarkdownBlock.tsx | 4 ++-- .../src/components/settings/SettingsView.tsx | 6 +++--- .../src/components/settings/UISettings.tsx | 16 ++++++++-------- webview-ui/src/context/ExtensionStateContext.tsx | 8 ++++---- webview-ui/src/i18n/locales/ca/settings.json | 4 ++-- webview-ui/src/i18n/locales/de/settings.json | 4 ++-- webview-ui/src/i18n/locales/en/settings.json | 4 ++-- webview-ui/src/i18n/locales/es/settings.json | 4 ++-- webview-ui/src/i18n/locales/fr/settings.json | 4 ++-- webview-ui/src/i18n/locales/hi/settings.json | 4 ++-- webview-ui/src/i18n/locales/it/settings.json | 4 ++-- webview-ui/src/i18n/locales/ja/settings.json | 4 ++-- webview-ui/src/i18n/locales/ko/settings.json | 4 ++-- webview-ui/src/i18n/locales/nl/settings.json | 4 ++-- webview-ui/src/i18n/locales/pl/settings.json | 4 ++-- webview-ui/src/i18n/locales/pt-BR/settings.json | 4 ++-- webview-ui/src/i18n/locales/ru/settings.json | 4 ++-- webview-ui/src/i18n/locales/tr/settings.json | 4 ++-- webview-ui/src/i18n/locales/vi/settings.json | 4 ++-- webview-ui/src/i18n/locales/zh-CN/settings.json | 4 ++-- webview-ui/src/i18n/locales/zh-TW/settings.json | 4 ++-- 30 files changed, 66 insertions(+), 66 deletions(-) diff --git a/evals/packages/types/src/roo-code-defaults.ts b/evals/packages/types/src/roo-code-defaults.ts index 2c15a1210d..64b211f9b4 100644 --- a/evals/packages/types/src/roo-code-defaults.ts +++ b/evals/packages/types/src/roo-code-defaults.ts @@ -8,7 +8,7 @@ export const rooCodeDefaults: RooCodeSettings = { pinnedApiConfigs: {}, - markdownBlockLineheight: 1.25, + markdownBlockLineHeight: 1.25, autoApprovalEnabled: true, alwaysAllowReadOnly: true, alwaysAllowReadOnlyOutsideWorkspace: false, diff --git a/evals/packages/types/src/roo-code.ts b/evals/packages/types/src/roo-code.ts index 4f713a50f3..f58d47876d 100644 --- a/evals/packages/types/src/roo-code.ts +++ b/evals/packages/types/src/roo-code.ts @@ -731,7 +731,7 @@ export const globalSettingsSchema = z.object({ customInstructions: z.string().optional(), taskHistory: z.array(historyItemSchema).optional(), - markdownBlockLineheight: z.number().optional(), + markdownBlockLineHeight: z.number().optional(), autoApprovalEnabled: z.boolean().optional(), alwaysAllowReadOnly: z.boolean().optional(), alwaysAllowReadOnlyOutsideWorkspace: z.boolean().optional(), @@ -811,7 +811,7 @@ const globalSettingsRecord: GlobalSettingsRecord = { customInstructions: undefined, taskHistory: undefined, - markdownBlockLineheight: undefined, + markdownBlockLineHeight: undefined, autoApprovalEnabled: undefined, alwaysAllowReadOnly: undefined, alwaysAllowReadOnlyOutsideWorkspace: undefined, diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index c3f8b267cb..fa09d6176c 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1268,7 +1268,7 @@ export class ClineProvider extends EventEmitter implements maxReadFileLine, terminalCompressProgressBar, historyPreviewCollapsed, - markdownBlockLineheight, + markdownBlockLineHeight, } = await this.getState() const telemetryKey = process.env.POSTHOG_API_KEY @@ -1357,7 +1357,7 @@ export class ClineProvider extends EventEmitter implements terminalCompressProgressBar: terminalCompressProgressBar ?? true, hasSystemPromptOverride, historyPreviewCollapsed: historyPreviewCollapsed ?? false, - markdownBlockLineheight: markdownBlockLineheight ?? 1.25, + markdownBlockLineHeight: markdownBlockLineHeight ?? 1.25, } } @@ -1448,7 +1448,7 @@ export class ClineProvider extends EventEmitter implements showRooIgnoredFiles: stateValues.showRooIgnoredFiles ?? true, maxReadFileLine: stateValues.maxReadFileLine ?? 500, historyPreviewCollapsed: stateValues.historyPreviewCollapsed ?? false, - markdownBlockLineheight: stateValues.markdownBlockLineheight ?? 1.25, + markdownBlockLineHeight: stateValues.markdownBlockLineHeight ?? 1.25, } } diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index a2be024d37..faed85c28f 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -894,8 +894,8 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We await updateGlobalState("maxReadFileLine", message.value) await provider.postStateToWebview() break - case "markdownBlockLineheight": - await updateGlobalState("markdownBlockLineheight", message.value ?? 1.25) + case "markdownBlockLineHeight": + await updateGlobalState("markdownBlockLineHeight", message.value ?? 1.25) await provider.postStateToWebview() break case "setHistoryPreviewCollapsed": // Add the new case handler diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index e1e90f8d48..e61b091672 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -56,7 +56,7 @@ type GlobalSettings = { workspace?: string | undefined }[] | undefined - markdownBlockLineheight: number | undefined + markdownBlockLineHeight?: number | undefined autoApprovalEnabled?: boolean | undefined alwaysAllowReadOnly?: boolean | undefined alwaysAllowReadOnlyOutsideWorkspace?: boolean | undefined diff --git a/src/exports/types.ts b/src/exports/types.ts index 4a3642ad6e..a0a065dfab 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -56,7 +56,7 @@ type GlobalSettings = { workspace?: string | undefined }[] | undefined - markdownBlockLineheight?: number | undefined + markdownBlockLineHeight?: number | undefined autoApprovalEnabled?: boolean | undefined alwaysAllowReadOnly?: boolean | undefined alwaysAllowReadOnlyOutsideWorkspace?: boolean | undefined diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 065020f003..2f678d2319 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -735,7 +735,7 @@ export const globalSettingsSchema = z.object({ customInstructions: z.string().optional(), taskHistory: z.array(historyItemSchema).optional(), - markdownBlockLineheight: z.number().optional(), + markdownBlockLineHeight: z.number().optional(), autoApprovalEnabled: z.boolean().optional(), alwaysAllowReadOnly: z.boolean().optional(), alwaysAllowReadOnlyOutsideWorkspace: z.boolean().optional(), @@ -816,7 +816,7 @@ const globalSettingsRecord: GlobalSettingsRecord = { customInstructions: undefined, taskHistory: undefined, - markdownBlockLineheight: undefined, + markdownBlockLineHeight: undefined, autoApprovalEnabled: undefined, alwaysAllowReadOnly: undefined, alwaysAllowReadOnlyOutsideWorkspace: undefined, diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 98731e2ee7..36685b46b6 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -70,7 +70,7 @@ export interface ExtensionMessage { | "commandExecutionStatus" | "vsCodeSetting" | "condenseTaskContextResponse" - | "markdownBlockLineheight" + | "markdownBlockLineHeight" text?: string action?: | "chatButtonClicked" @@ -171,7 +171,7 @@ export type ExtensionState = Pick< | "customModePrompts" | "customSupportPrompts" | "enhancementApiConfigId" - | "markdownBlockLineheight" + | "markdownBlockLineHeight" > & { version: string clineMessages: ClineMessage[] diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 27cb07737d..b5f85509b8 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -132,7 +132,7 @@ export interface WebviewMessage { | "toggleApiConfigPin" | "setHistoryPreviewCollapsed" | "condenseTaskContextRequest" - | "markdownBlockLineheight" + | "markdownBlockLineHeight" text?: string disabled?: boolean askResponse?: ClineAskResponse diff --git a/webview-ui/src/components/common/MarkdownBlock.tsx b/webview-ui/src/components/common/MarkdownBlock.tsx index 9609dd6360..4203d07a97 100644 --- a/webview-ui/src/components/common/MarkdownBlock.tsx +++ b/webview-ui/src/components/common/MarkdownBlock.tsx @@ -122,7 +122,7 @@ const StyledMarkdown = styled.div<{ lineheight: number | string }>` ` const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => { - const { theme, markdownBlockLineheight } = useExtensionState() + const { theme, markdownBlockLineHeight } = useExtensionState() const [reactContent, setMarkdown] = useRemark({ remarkPlugins: [ remarkUrlToLink, @@ -229,7 +229,7 @@ const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => { return (
- {reactContent} + {reactContent}
) }) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index f692cfbc03..74c497124a 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -163,7 +163,7 @@ const SettingsView = forwardRef(({ onDone, t remoteBrowserEnabled, maxReadFileLine, terminalCompressProgressBar, - markdownBlockLineheight, + markdownBlockLineHeight, } = cachedState const apiConfiguration = useMemo(() => cachedState.apiConfiguration ?? {}, [cachedState.apiConfiguration]) @@ -288,7 +288,7 @@ const SettingsView = forwardRef(({ onDone, t vscode.postMessage({ type: "alwaysAllowSubtasks", bool: alwaysAllowSubtasks }) vscode.postMessage({ type: "upsertApiConfiguration", text: currentApiConfigName, apiConfiguration }) vscode.postMessage({ type: "telemetrySetting", text: telemetrySetting }) - vscode.postMessage({ type: "markdownBlockLineheight", value: markdownBlockLineheight }) + vscode.postMessage({ type: "markdownBlockLineHeight", value: markdownBlockLineHeight }) setChangeDetected(false) } } @@ -556,7 +556,7 @@ const SettingsView = forwardRef(({ onDone, t {/* UISettings Section */} {activeTab === "uiSettings" && ( )} diff --git a/webview-ui/src/components/settings/UISettings.tsx b/webview-ui/src/components/settings/UISettings.tsx index 95661a5dac..d40be1f475 100644 --- a/webview-ui/src/components/settings/UISettings.tsx +++ b/webview-ui/src/components/settings/UISettings.tsx @@ -10,11 +10,11 @@ import { SectionHeader } from "./SectionHeader" import { Section } from "./Section" type UISettingsProps = HTMLAttributes & { - markdownBlockLineheight: number - setCachedStateField: SetCachedStateField<"markdownBlockLineheight"> + markdownBlockLineHeight: number + setCachedStateField: SetCachedStateField<"markdownBlockLineHeight"> } -export const UISettings = ({ markdownBlockLineheight, setCachedStateField, className, ...props }: UISettingsProps) => { +export const UISettings = ({ markdownBlockLineHeight, setCachedStateField, className, ...props }: UISettingsProps) => { const { t } = useAppTranslation() return (
@@ -28,21 +28,21 @@ export const UISettings = ({ markdownBlockLineheight, setCachedStateField, class
- {t("settings:uiSettings.markdownBlockLineheight.label")} + {t("settings:uiSettings.markdownBlockLineHeight.label")}
setCachedStateField("markdownBlockLineheight", value)} + value={[markdownBlockLineHeight ?? 1.25]} + onValueChange={([value]) => setCachedStateField("markdownBlockLineHeight", value)} data-testid="markdown-lineheight-slider" /> - {markdownBlockLineheight ?? 1.25} + {markdownBlockLineHeight ?? 1.25}
- {t("settings:uiSettings.markdownBlockLineheight.description")} + {t("settings:uiSettings.markdownBlockLineHeight.description")}
diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 6d29b44b12..66f66a32bb 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -161,7 +161,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode customSupportPrompts: {}, experiments: experimentDefault, enhancementApiConfigId: "", - markdownBlockLineheight: 1.25, + markdownBlockLineHeight: 1.25, autoApprovalEnabled: false, customModes: [], maxOpenTabsContext: 20, @@ -269,9 +269,9 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode fuzzyMatchThreshold: state.fuzzyMatchThreshold, writeDelayMs: state.writeDelayMs, screenshotQuality: state.screenshotQuality, - markdownBlockLineheight: state.markdownBlockLineheight, - setMarkdownBlockLineheight: (value) => - setState((prevState) => ({ ...prevState, markdownBlockLineheight: value })), + markdownBlockLineHeight: state.markdownBlockLineHeight, + setMarkdownBlockLineHeight: (value) => + setState((prevState) => ({ ...prevState, markdownBlockLineHeight: value })), setExperimentEnabled: (id, enabled) => setState((prevState) => ({ ...prevState, experiments: { ...prevState.experiments, [id]: enabled } })), setApiConfiguration: (value) => diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 2b73580aa1..c4c9b77d56 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Configuració relacionada amb la interfície d'usuari", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Espaiat entre línies del contingut del panell", "description": "Ajusteu l'interlineat del contingut del panell per millorar la llegibilitat." } @@ -537,4 +537,4 @@ "customArn": "ARN personalitzat", "useCustomArn": "Utilitza ARN personalitzat..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 3dc809c21e..2a1ef22160 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Benutzeroberflächenbezogene Konfiguration", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Zeilenabstand des Panelinhalts", "description": "Passen Sie den Zeilenabstand des Panel-Inhalts an, um die Lesbarkeit zu verbessern." } @@ -537,4 +537,4 @@ "customArn": "Benutzerdefinierte ARN", "useCustomArn": "Benutzerdefinierte ARN verwenden..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 883496d439..fa3da0e954 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "UI related configuration", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Content vertical spacing", "description": "Adjust content vertical line spacing to improve readability." } @@ -537,4 +537,4 @@ "customArn": "Custom ARN", "useCustomArn": "Use custom ARN..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 9946f382df..6be49a5b3b 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Configuración relacionada con la interfaz de usuario", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Interlineado del contenido del panel", "description": "Ajuste el espaciado entre líneas del contenido del panel para mejorar la legibilidad." } @@ -537,4 +537,4 @@ "customArn": "ARN personalizado", "useCustomArn": "Usar ARN personalizado..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index f11daa37ad..1f5aa19101 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Configuration liée à l'interface utilisateur", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Espacement des lignes du contenu du panneau", "description": "Ajustez l'espacement des lignes de contenu du panneau pour améliorer la lisibilité." } @@ -537,4 +537,4 @@ "customArn": "ARN personnalisé", "useCustomArn": "Utiliser un ARN personnalisé..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 6f7cd31193..1a557b8a2e 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "उपयोगकर्ता इंटरफ़ेस संबंधित कॉन्फ़िगरेशन", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "पैनल सामग्री पंक्ति रिक्ति", "description": "पठनीयता में सुधार के लिए पैनल सामग्री की पंक्ति रिक्ति समायोजित करें." } @@ -537,4 +537,4 @@ "customArn": "कस्टम ARN", "useCustomArn": "कस्टम ARN का उपयोग करें..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 9ec427a741..9db16e3bfb 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Configurazione relativa all'interfaccia utente", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Interlinea del contenuto del pannello", "description": "Regola la spaziatura delle righe del contenuto del pannello per migliorarne la leggibilità." } @@ -537,4 +537,4 @@ "customArn": "ARN personalizzato", "useCustomArn": "Usa ARN personalizzato..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 6c383a1826..65caaf3af2 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "ユーザーインターフェース関連の設定", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "パネルコンテンツの行間隔", "description": "読みやすさを向上させるために、パネル コンテンツの行間隔を調整します。" } @@ -537,4 +537,4 @@ "customArn": "カスタム ARN", "useCustomArn": "カスタム ARN を使用..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index f241a3b6db..3f7ab33e78 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "사용자 인터페이스 관련 구성", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "패널 콘텐츠 줄 간격", "description": "가독성을 높이려면 패널 콘텐츠 줄 간격을 조정하세요." } @@ -537,4 +537,4 @@ "customArn": "사용자 지정 ARN", "useCustomArn": "사용자 지정 ARN 사용..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 4f19b48e67..4112e91a32 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Gebruikersinterfacegerelateerde configuratie", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Regelafstand van paneelinhoud", "description": "Pas de regelafstand van de paneelinhoud aan om de leesbaarheid te verbeteren." } @@ -537,4 +537,4 @@ "customArn": "Aangepaste ARN", "useCustomArn": "Aangepaste ARN gebruiken..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index e1a2794b36..eb305308e1 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Konfiguracja związana z interfejsem użytkownika", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Odstęp między wierszami zawartości panelu", "description": "Aby poprawić czytelność, dostosuj odstępy między wierszami zawartości panelu." } @@ -537,4 +537,4 @@ "customArn": "Niestandardowy ARN", "useCustomArn": "Użyj niestandardowego ARN..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 7e4b79a520..6d1fffd08d 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Configuração relacionada à interface do usuário", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Espaçamento entre linhas do conteúdo do painel", "description": "Ajuste o espaçamento entre linhas do conteúdo do painel para melhorar a legibilidade." } @@ -537,4 +537,4 @@ "customArn": "ARN personalizado", "useCustomArn": "Usar ARN personalizado..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index 61cee406f8..c32e1d5c84 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Конфигурация, связанная с пользовательским интерфейсом", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Межстрочный интервал содержимого панели", "description": "Отрегулируйте межстрочный интервал содержимого панели, чтобы улучшить читаемость." } @@ -537,4 +537,4 @@ "customArn": "Пользовательский ARN", "useCustomArn": "Использовать пользовательский ARN..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 65c5327f64..65d9e80984 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Kullanıcı arayüzü ile ilgili konfigürasyon", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Panel içerik satır aralığı", "description": "Okunabilirliği artırmak için panel içeriği satır aralığını ayarlayın." } @@ -537,4 +537,4 @@ "customArn": "Özel ARN", "useCustomArn": "Özel ARN kullan..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index 3de32a9d90..567085a857 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "Cấu hình liên quan đến giao diện người dùng", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "Khoảng cách dòng nội dung bảng điều khiển", "description": "Điều chỉnh khoảng cách giữa các dòng nội dung bảng điều khiển để dễ đọc hơn." } @@ -537,4 +537,4 @@ "customArn": "ARN tùy chỉnh", "useCustomArn": "Sử dụng ARN tùy chỉnh..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 3bbaa48d96..de9c280f49 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "用户界面相关配置", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "面板内容行间距", "description": "调整面板内容行间距,以改善可读性。" } @@ -537,4 +537,4 @@ "customArn": "自定义 ARN", "useCustomArn": "使用自定义 ARN..." } -} +} \ No newline at end of file diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 7bcc1f2401..0c688786bc 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -327,7 +327,7 @@ }, "uiSettings": { "description": "使用者界面相關設定", - "markdownBlockLineheight": { + "markdownBlockLineHeight": { "label": "面板內容行間距", "description": "調整面板內容行間距,以改善可讀性。" } @@ -537,4 +537,4 @@ "customArn": "自訂 ARN", "useCustomArn": "使用自訂 ARN..." } -} +} \ No newline at end of file From f6c7cc93e156d70e63ebb801408a6e9b8ff4c4d3 Mon Sep 17 00:00:00 2001 From: Yooooo Date: Tue, 13 May 2025 10:38:23 +0800 Subject: [PATCH 9/9] fix: Correct highlight word style to Camel case --- webview-ui/src/context/ExtensionStateContext.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 66f66a32bb..af984c51da 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -24,8 +24,8 @@ export interface ExtensionStateContextType extends ExtensionState { currentCheckpoint?: string filePaths: string[] openedTabs: Array<{ label: string; isActive: boolean; path?: string }> - markdownBlockLineheight: number | undefined - setMarkdownBlockLineheight: (value: number) => void + markdownBlockLineHeight: number | undefined + setMarkdownBlockLineHeight: (value: number) => void setApiConfiguration: (config: ProviderSettings) => void setCustomInstructions: (value?: string) => void setAlwaysAllowReadOnly: (value: boolean) => void