Redesign settings dialog with curated list and view-switching UI

This commit is contained in:
tanzhenxin 2026-01-18 21:56:33 +08:00
parent 28f6c161da
commit c87197d420
20 changed files with 627 additions and 724 deletions

View file

@ -132,7 +132,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: undefined as string | undefined,
description: 'The preferred editor to open files in.',
showInDialog: false,
showInDialog: true,
},
vimMode: {
type: 'boolean',
@ -163,13 +163,13 @@ const SETTINGS_SCHEMA = {
},
gitCoAuthor: {
type: 'boolean',
label: 'Git Co-Author',
label: 'Add AI Co-Author to Commits',
category: 'General',
requiresRestart: false,
default: true,
description:
'Automatically add a Co-authored-by trailer to git commit messages when commits are made through Qwen Code.',
showInDialog: false,
showInDialog: true,
},
checkpointing: {
type: 'object',
@ -198,13 +198,13 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: false,
description: 'Enable debug logging of keystrokes to the console.',
showInDialog: true,
showInDialog: false,
},
language: {
type: 'enum',
label: 'Language',
category: 'General',
requiresRestart: false,
requiresRestart: true,
default: 'auto',
description:
'The language for the user interface. Use "auto" to detect from system settings. ' +
@ -221,7 +221,7 @@ const SETTINGS_SCHEMA = {
},
terminalBell: {
type: 'boolean',
label: 'Terminal Bell',
label: 'Terminal Bell Notification',
category: 'General',
requiresRestart: false,
default: true,
@ -257,7 +257,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: 'text',
description: 'The format of the CLI output.',
showInDialog: true,
showInDialog: false,
options: [
{ value: 'text', label: 'Text' },
{ value: 'json', label: 'JSON' },
@ -280,9 +280,9 @@ const SETTINGS_SCHEMA = {
label: 'Theme',
category: 'UI',
requiresRestart: false,
default: undefined as string | undefined,
default: 'Qwen Dark' as string,
description: 'The color theme for the UI.',
showInDialog: false,
showInDialog: true,
},
customThemes: {
type: 'object',
@ -300,7 +300,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: false,
description: 'Hide the window title bar',
showInDialog: true,
showInDialog: false,
},
showStatusInTitle: {
type: 'boolean',
@ -310,7 +310,7 @@ const SETTINGS_SCHEMA = {
default: false,
description:
'Show Qwen Code status and thoughts in the terminal window title',
showInDialog: true,
showInDialog: false,
},
hideTips: {
type: 'boolean',
@ -323,11 +323,11 @@ const SETTINGS_SCHEMA = {
},
showLineNumbers: {
type: 'boolean',
label: 'Show Line Numbers',
label: 'Show Line Numbers in Code',
category: 'UI',
requiresRestart: false,
default: false,
description: 'Show line numbers in the chat.',
description: 'Show line numbers in the code output.',
showInDialog: true,
},
showCitations: {
@ -337,7 +337,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: false,
description: 'Show citations for generated text in the chat.',
showInDialog: true,
showInDialog: false,
},
customWittyPhrases: {
type: 'array',
@ -350,7 +350,7 @@ const SETTINGS_SCHEMA = {
},
enableWelcomeBack: {
type: 'boolean',
label: 'Enable Welcome Back',
label: 'Show Welcome Back Dialog',
category: 'UI',
requiresRestart: false,
default: true,
@ -374,7 +374,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: false,
description: 'Disable loading phrases for accessibility',
showInDialog: true,
showInDialog: false,
},
screenReader: {
type: 'boolean',
@ -384,7 +384,7 @@ const SETTINGS_SCHEMA = {
default: undefined as boolean | undefined,
description:
'Render output in plain-text to be more screen reader accessible',
showInDialog: true,
showInDialog: false,
},
},
},
@ -402,7 +402,7 @@ const SETTINGS_SCHEMA = {
properties: {
enabled: {
type: 'boolean',
label: 'IDE Mode',
label: 'Auto-connect to IDE',
category: 'IDE',
requiresRestart: true,
default: false,
@ -437,7 +437,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: true,
description: 'Enable collection of usage statistics',
showInDialog: false,
showInDialog: true,
},
},
},
@ -478,7 +478,7 @@ const SETTINGS_SCHEMA = {
default: -1,
description:
'Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.',
showInDialog: true,
showInDialog: false,
},
summarizeToolOutput: {
type: 'object',
@ -516,7 +516,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: true,
description: 'Skip the next speaker check.',
showInDialog: true,
showInDialog: false,
},
skipLoopDetection: {
type: 'boolean',
@ -525,7 +525,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: false,
description: 'Disable all loop detection checks (streaming and LLM).',
showInDialog: true,
showInDialog: false,
},
skipStartupContext: {
type: 'boolean',
@ -535,7 +535,7 @@ const SETTINGS_SCHEMA = {
default: false,
description:
'Avoid sending the workspace startup context at the beginning of each session.',
showInDialog: true,
showInDialog: false,
},
enableOpenAILogging: {
type: 'boolean',
@ -544,7 +544,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: false,
description: 'Enable OpenAI logging.',
showInDialog: true,
showInDialog: false,
},
openAILoggingDir: {
type: 'string',
@ -554,7 +554,7 @@ const SETTINGS_SCHEMA = {
default: undefined as string | undefined,
description:
'Custom directory path for OpenAI API logs. If not specified, defaults to logs/openai in the current working directory.',
showInDialog: true,
showInDialog: false,
},
generationConfig: {
type: 'object',
@ -574,7 +574,7 @@ const SETTINGS_SCHEMA = {
description: 'Request timeout in milliseconds.',
parentKey: 'generationConfig',
childKey: 'timeout',
showInDialog: true,
showInDialog: false,
},
maxRetries: {
type: 'number',
@ -585,7 +585,7 @@ const SETTINGS_SCHEMA = {
description: 'Maximum number of retries for failed requests.',
parentKey: 'generationConfig',
childKey: 'maxRetries',
showInDialog: true,
showInDialog: false,
},
disableCacheControl: {
type: 'boolean',
@ -596,7 +596,7 @@ const SETTINGS_SCHEMA = {
description: 'Disable cache control for DashScope providers.',
parentKey: 'generationConfig',
childKey: 'disableCacheControl',
showInDialog: true,
showInDialog: false,
},
schemaCompliance: {
type: 'enum',
@ -608,7 +608,7 @@ const SETTINGS_SCHEMA = {
'The compliance mode for tool schemas sent to the model. Use "openapi_30" for strict OpenAPI 3.0 compatibility (e.g., for Gemini).',
parentKey: 'generationConfig',
childKey: 'schemaCompliance',
showInDialog: true,
showInDialog: false,
options: [
{ value: 'auto', label: 'Auto (Default)' },
{ value: 'openapi_30', label: 'OpenAPI 3.0 Strict' },
@ -653,7 +653,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: 200,
description: 'Maximum number of directories to search for memory.',
showInDialog: true,
showInDialog: false,
},
includeDirectories: {
type: 'array',
@ -673,7 +673,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: false,
description: 'Whether to load memory files from include directories.',
showInDialog: true,
showInDialog: false,
},
fileFiltering: {
type: 'object',
@ -709,7 +709,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: true,
description: 'Enable recursive file search functionality',
showInDialog: true,
showInDialog: false,
},
disableFuzzySearch: {
type: 'boolean',
@ -718,7 +718,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: false,
description: 'Disable fuzzy search when searching for files.',
showInDialog: true,
showInDialog: false,
},
},
},
@ -755,7 +755,7 @@ const SETTINGS_SCHEMA = {
properties: {
enableInteractiveShell: {
type: 'boolean',
label: 'Enable Interactive Shell',
label: 'Interactive Shell (PTY)',
category: 'Tools',
requiresRestart: true,
default: false,
@ -780,20 +780,10 @@ const SETTINGS_SCHEMA = {
requiresRestart: false,
default: false,
description: 'Show color in shell output.',
showInDialog: true,
showInDialog: false,
},
},
},
autoAccept: {
type: 'boolean',
label: 'Auto Accept',
category: 'Tools',
requiresRestart: false,
default: false,
description:
'Automatically accept and execute tool calls that are considered safe (e.g., read-only operations).',
showInDialog: true,
},
core: {
type: 'array',
label: 'Core Tools',
@ -825,7 +815,7 @@ const SETTINGS_SCHEMA = {
},
approvalMode: {
type: 'enum',
label: 'Approval Mode',
label: 'Tool Approval Mode',
category: 'Tools',
requiresRestart: false,
default: ApprovalMode.DEFAULT,
@ -839,6 +829,16 @@ const SETTINGS_SCHEMA = {
{ value: ApprovalMode.YOLO, label: 'YOLO' },
],
},
autoAccept: {
type: 'boolean',
label: 'Auto Accept',
category: 'Tools',
requiresRestart: false,
default: false,
description:
'Automatically accept and execute tool calls that are considered safe (e.g., read-only operations) without explicit user confirmation.',
showInDialog: false,
},
discoveryCommand: {
type: 'string',
label: 'Tool Discovery Command',
@ -865,7 +865,7 @@ const SETTINGS_SCHEMA = {
default: true,
description:
'Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.',
showInDialog: true,
showInDialog: false,
},
useBuiltinRipgrep: {
type: 'boolean',
@ -875,7 +875,7 @@ const SETTINGS_SCHEMA = {
default: true,
description:
'Use the bundled ripgrep binary. When set to false, the system-level "rg" command will be used instead. This setting is only effective when useRipgrep is true.',
showInDialog: true,
showInDialog: false,
},
enableToolOutputTruncation: {
type: 'boolean',
@ -884,7 +884,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: true,
description: 'Enable truncation of large tool outputs.',
showInDialog: true,
showInDialog: false,
},
truncateToolOutputThreshold: {
type: 'number',
@ -894,7 +894,7 @@ const SETTINGS_SCHEMA = {
default: DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
description:
'Truncate tool output if it is larger than this many characters. Set to -1 to disable.',
showInDialog: true,
showInDialog: false,
},
truncateToolOutputLines: {
type: 'number',
@ -903,7 +903,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
description: 'The number of lines to keep when truncating tool output.',
showInDialog: true,
showInDialog: false,
},
},
},
@ -980,7 +980,7 @@ const SETTINGS_SCHEMA = {
requiresRestart: true,
default: false,
description: 'Setting to track whether Folder trust is enabled.',
showInDialog: true,
showInDialog: false,
},
},
},
@ -1148,7 +1148,7 @@ const SETTINGS_SCHEMA = {
default: true,
description:
'Enable vision model support and auto-switching functionality. When disabled, vision models like qwen-vl-max-latest will be hidden and auto-switching will not occur.',
showInDialog: true,
showInDialog: false,
},
vlmSwitchMode: {
type: 'string',