Skip to content

Commit 93860c7

Browse files
hannesrudolphdaniel-lxs
authored andcommitted
feat: enhance diagnostic settings UI with reset button and unlimited option
- Add reset button to restore default value (50 diagnostics) - Add unlimited checkbox that sets value to -1 and displays ∞ symbol - Update checkbox label to 'Automatically include diagnostics in context' - Clarify description to explain automatic vs manual inclusion behavior - Update all 18 language translation files with new UI strings
1 parent 2e0e637 commit 93860c7

File tree

19 files changed

+113
-55
lines changed

19 files changed

+113
-55
lines changed

webview-ui/src/components/settings/ContextManagementSettings.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,30 @@ export const ContextManagementSettings = ({
229229
value={[maxDiagnosticMessages ?? 50]}
230230
onValueChange={([value]) => setCachedStateField("maxDiagnosticMessages", value)}
231231
data-testid="max-diagnostic-messages-slider"
232+
disabled={maxDiagnosticMessages === -1}
232233
/>
233-
<span className="w-10">{maxDiagnosticMessages ?? 50}</span>
234+
<span className="w-10">
235+
{maxDiagnosticMessages === -1 ? "∞" : (maxDiagnosticMessages ?? 50)}
236+
</span>
237+
<Button
238+
variant="ghost"
239+
size="sm"
240+
onClick={() => setCachedStateField("maxDiagnosticMessages", 50)}
241+
title={t("settings:contextManagement.diagnostics.maxMessages.resetTooltip")}
242+
className="p-1 h-6 w-6"
243+
disabled={maxDiagnosticMessages === 50}>
244+
<span className="codicon codicon-discard" />
245+
</Button>
246+
</div>
247+
<div className="flex items-center gap-2 mt-2">
248+
<VSCodeCheckbox
249+
checked={maxDiagnosticMessages === -1}
250+
onChange={(e: any) =>
251+
setCachedStateField("maxDiagnosticMessages", e.target.checked ? -1 : 50)
252+
}
253+
data-testid="max-diagnostic-messages-unlimited-checkbox">
254+
{t("settings:contextManagement.diagnostics.maxMessages.unlimited")}
255+
</VSCodeCheckbox>
234256
</div>
235257
<div className="text-vscode-descriptionForeground text-sm mt-1">
236258
{t("settings:contextManagement.diagnostics.maxMessages.description")}

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,14 @@
490490
},
491491
"diagnostics": {
492492
"includeMessages": {
493-
"label": "Include diagnostic messages in context",
494-
"description": "When enabled, diagnostic messages (errors, warnings) will be included when using @problems or when files with diagnostics are read."
493+
"label": "Automatically include diagnostics in context",
494+
"description": "When enabled, diagnostic messages (errors) from edited files will be automatically included in the context. You can always manually include all workspace diagnostics using @problems."
495495
},
496496
"maxMessages": {
497497
"label": "Maximum diagnostic messages",
498-
"description": "Maximum number of diagnostic messages to include per file when using @problems or when automatic inclusion is enabled. Higher values provide more context but increase token usage."
498+
"description": "Maximum number of diagnostic messages to include per file. This limit applies to both automatic inclusion (when checkbox is enabled) and manual @problems mentions. Higher values provide more context but increase token usage.",
499+
"resetTooltip": "Reset to default value (50)",
500+
"unlimited": "Unlimited diagnostic messages"
499501
}
500502
},
501503
"condensingThreshold": {

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/id/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/it/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/ja/settings.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)