refactor: remove unused UI and execution configuration

Remove unused configuration options that were not consumed by the UI:

- Remove UI configuration (UI_FONT_FAMILY, UI_FONT_SIZE, UI_PRODUCTION_ID_INPUT_WIDTH)
  - No UI components were using these settings
  - Settings page had no inputs for these options

- Remove execution configuration (EXECUTION_DRYRUN)
  - Dry run mode is controlled by Cleaner page UI toggle
  - State is managed via sessionStorage, not config file

Files modified:
- src/main/types/settings.types.ts: Remove UiConfig and ExecutionConfig interfaces
- src/main/services/config/config-manager.ts: Remove config read/write logic
- src/main/ipc/settings-handler.ts: Remove filtered fields
This commit is contained in:
Misaka
2026-03-05 22:02:53 +08:00
parent 5977254180
commit 48f1f51d76
3 changed files with 108 additions and 101 deletions

View File

@@ -61,14 +61,6 @@ const DEFAULT_SETTINGS: SettingsData = {
matchMode: 'substring',
enableCrud: false,
defaultManager: ''
},
ui: {
fontFamily: 'Microsoft YaHei UI',
fontSize: 10,
productionIdInputWidth: 20
},
execution: {
dryRun: false
}
}
@@ -371,29 +363,6 @@ export class ConfigManager {
)
lines.push('')
// UI Configuration
lines.push('# ===========================')
lines.push('# UI 配置')
lines.push('# ===========================')
lines.push(
`UI_FONT_FAMILY=${this.configCache.get('UI_FONT_FAMILY') || DEFAULT_SETTINGS.ui.fontFamily}`
)
lines.push(
`UI_FONT_SIZE=${this.configCache.get('UI_FONT_SIZE') || DEFAULT_SETTINGS.ui.fontSize}`
)
lines.push(
`UI_PRODUCTION_ID_INPUT_WIDTH=${this.configCache.get('UI_PRODUCTION_ID_INPUT_WIDTH') || DEFAULT_SETTINGS.ui.productionIdInputWidth}`
)
lines.push('')
// Execution Configuration
lines.push('# ===========================')
lines.push('# 执行配置')
lines.push('# ===========================')
lines.push(
`EXECUTION_DRYRUN=${this.configCache.get('EXECUTION_DRYRUN') || DEFAULT_SETTINGS.execution.dryRun}`
)
const content = lines.join('\n')
fs.writeFileSync(this.envPath, content, 'utf-8')
return true
@@ -472,17 +441,6 @@ export class ConfigManager {
'VALIDATION_DEFAULT_MANAGER',
DEFAULT_SETTINGS.validation.defaultManager
)
},
ui: {
fontFamily: this.get('UI_FONT_FAMILY', DEFAULT_SETTINGS.ui.fontFamily),
fontSize: this.getNumber('UI_FONT_SIZE', DEFAULT_SETTINGS.ui.fontSize),
productionIdInputWidth: this.getNumber(
'UI_PRODUCTION_ID_INPUT_WIDTH',
DEFAULT_SETTINGS.ui.productionIdInputWidth
)
},
execution: {
dryRun: this.getBoolean('EXECUTION_DRYRUN', DEFAULT_SETTINGS.execution.dryRun)
}
}
}
@@ -523,14 +481,6 @@ export class ConfigManager {
this.set('VALIDATION_ENABLE_CRUD', settings.validation.enableCrud)
this.set('VALIDATION_DEFAULT_MANAGER', settings.validation.defaultManager)
// UI settings
this.set('UI_FONT_FAMILY', settings.ui.fontFamily)
this.set('UI_FONT_SIZE', settings.ui.fontSize)
this.set('UI_PRODUCTION_ID_INPUT_WIDTH', settings.ui.productionIdInputWidth)
// Execution settings
this.set('EXECUTION_DRYRUN', settings.execution.dryRun)
return this.save()
}
@@ -646,12 +596,6 @@ export class ConfigManager {
this.set('VALIDATION_ENABLE_CRUD', DEFAULT_SETTINGS.validation.enableCrud)
this.set('VALIDATION_DEFAULT_MANAGER', DEFAULT_SETTINGS.validation.defaultManager)
this.set('UI_FONT_FAMILY', DEFAULT_SETTINGS.ui.fontFamily)
this.set('UI_FONT_SIZE', DEFAULT_SETTINGS.ui.fontSize)
this.set('UI_PRODUCTION_ID_INPUT_WIDTH', DEFAULT_SETTINGS.ui.productionIdInputWidth)
this.set('EXECUTION_DRYRUN', DEFAULT_SETTINGS.execution.dryRun)
return DEFAULT_SETTINGS
}