refactor: restructure settings modules, rename Intelligent tab, group panel sections#725
Conversation
|
📦 Plugin has been packaged for this PR. You can download |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #725 +/- ##
=============================================
+ Coverage 63.937% 63.961% +0.024%
=============================================
Files 362 363 +1
Lines 20750 20750
Branches 5108 5110 +2
=============================================
+ Hits 13267 13272 +5
- Misses 5609 5610 +1
+ Partials 1874 1868 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
… panel sections Resolve long-standing structural smells in the settings UI and consolidate duplicated TitledBorder boilerplate. Backwards-compatible: existing users migrate from ApplicationSettingsState/ProjectSettingsState on next startup (no unified-state release has shipped yet). ## Field moves (eliminate cross-module leaks) * `enumFieldAutoInferEnabled`: GeneralSettings -> ParsingOutputSettings. It is enum inference, lived in the Intelligent panel, but was stored in GeneralSettings via bespoke resetEnumFieldFrom/applyEnumFieldTo/ isEnumFieldModified shims. Folded into the standard resetFrom/applyTo/isModified flow; shims deleted. * `globalEnvironments`: IntelligentSettings -> EnvironmentSettings. It is edited in the Environments tab but was parked in IntelligentSettings because EnvironmentSettings was PROJECT-only. EnvironmentSettings is now mixed APP+PROJ scope (modeled on RuleFileSettings). EnvironmentSettingsPanel's resetGlobalEnvsFrom/applyGlobalEnvsTo/ isGlobalEnvsModified shims deleted; EnvironmentService.load/persist now touch only EnvironmentSettings. ## Migration SettingsMigrationActivity: MIGRATION_VERSION 2 -> 3. Both fields are written to their new module keys. Legacy ApplicationSettingsState/ProjectSettingsState retained as the migration source. Orphaned unified-state keys are harmless (never read). ## Class & tab rename IntelligentSettings -> ParsingOutputSettings (file renamed via `git mv`, history preserved). The old name described only one of six fields. Tab label "Intelligent" -> "Parsing & Output"; "Other" -> "Backup". Module FQN is the persistence key, but no release has shipped the unified-state code yet, so every user migrates from legacy state directly to the new key. ## Panel layout restructuring * New shared helper SettingsUiKit.titledPanel / labeledRow consolidates the TitledBorder boilerplate that was inlined 3x in GrpcSettingsPanel, 1x in EnvironmentSettingsPanel, 2x in GeneralSettingsPanel. * GeneralSettingsPanel: flat list of 11 controls + 2 trailing titled boxes -> 6 titled groups in concept order: Framework Support, Scanning, Editor, Output, Diagnostics, Cache Management. Log Level moved out of the Output cluster into its own Diagnostics group. * ParsingOutputSettingsPanel: 6 interleaved toggles -> two titled groups (Inference, Output Format) matching the new tab name. Path Multi stays as a labeled row outside. * GrpcSettingsPanel / EnvironmentSettingsPanel / createRepositoryPanel: inlined TitledBorder blocks replaced with SettingsUiKit.titledPanel. * Removed private createTitledPanel and AiAssistantSection.compactRow in favor of SettingsUiKit. ## Tests Updated: EasyApiSettingsConfigurableTest (constants), SettingsDefaultsTest (parity assertions moved + new EnvironmentSettings.globalEnvironments parity), SettingsPanelsParityTest, SettingsPanelsCoverageTest, EnvironmentSettingsPanelPlatformTest (rewired to single EnvironmentSettings), EnhancedSettingsPanelsLogicTest, and the two PSI enum tests that flip enumFieldAutoInferEnabled via settingBinder.update. Layout tests check resetFrom/applyTo/isModified semantics, not component structure, so the restructuring is transparent to them. Verification: ./gradlew compileKotlin compileTestKotlin clean; all settings, EnvironmentService, and enum-resolution tests pass.
88d3ec3 to
77b5580
Compare
|
📦 Plugin has been packaged for this PR. You can download |
Summary
Resolves long-standing structural smells in the settings UI and consolidates duplicated
TitledBorderboilerplate. Backwards-compatible: existing users migrate fromApplicationSettingsState/ProjectSettingsStateon next startup (no unified-state release has shipped yet).1. Field moves (eliminate cross-module leaks)
Two settings were stored in a different module from the panel that edited them, requiring bespoke cross-module shims:
enumFieldAutoInferEnabled:GeneralSettings→ParsingOutputSettings. It's enum inference, lives in the Parsing & Output panel, but was stored inGeneralSettingsviaresetEnumFieldFrom/applyEnumFieldTo/isEnumFieldModifiedshims. Folded into the standardresetFrom/applyTo/isModifiedflow; shims deleted.globalEnvironments:IntelligentSettings→EnvironmentSettings. Edited in the Environments tab but parked inIntelligentSettingsbecauseEnvironmentSettingswas PROJECT-only.EnvironmentSettingsis now mixed APP+PROJ scope (modeled onRuleFileSettings). The panel'sresetGlobalEnvsFrom/applyGlobalEnvsTo/isGlobalEnvsModifiedshims are deleted;EnvironmentServicenow touches onlyEnvironmentSettings.2. Migration
SettingsMigrationActivity:MIGRATION_VERSION2 → 3. Both fields are written to their new module keys. LegacyApplicationSettingsState/ProjectSettingsStateretained as the migration source. Orphaned unified-state keys are harmless (never read).3. Class & tab rename
IntelligentSettings→ParsingOutputSettings(file renamed viagit mv, history preserved). The old name described only one of six fields.4. Panel layout restructuring
SettingsUiKit(titledPanel/labeledRow) consolidates theTitledBorderboilerplate that was inlined 3× inGrpcSettingsPanel, 1× inEnvironmentSettingsPanel, 2× inGeneralSettingsPanel.GeneralSettingsPanel: flat list of 11 controls + 2 trailing titled boxes → 6 titled groups in concept order: Framework Support, Scanning, Editor, Output, Diagnostics, Cache Management. Log Level moved out of the Output cluster into its own Diagnostics group.ParsingOutputSettingsPanel: 6 interleaved toggles → two titled groups (Inference,Output Format) matching the new tab name. Path Multi stays as a labeled row outside.GrpcSettingsPanel/EnvironmentSettingsPanel/createRepositoryPanel: inlinedTitledBorderblocks replaced withSettingsUiKit.titledPanel.createTitledPanelandAiAssistantSection.compactRowin favor ofSettingsUiKit.Test plan
./gradlew compileKotlin compileTestKotlin— clean./gradlew test --tests "com.itangcent.easyapi.settings.*"— pass./gradlew test --tests "*EnvironmentService*"— pass./gradlew test --tests "*Case2_SeeWithAutoMatch*" --tests "*Case1_IntelligentMode*" --tests "*Case2_IntelligentModeAutoMatch*" --tests "*ComprehensiveEnumCasesTest*"— pass (the cases that exerciseenumFieldAutoInferEnabled = true)runIde: confirm General tab shows 6 titled groups, Parsing & Output shows 2, Backup renamed, enum checkbox persists, global environments editor persists across restart.Out of scope (deferred Tier 3)
outputDemoout ofGeneralSettingsinto a Markdown-exporter module.TAB_RULES/TAB_POSTMANconstants.EnumValueResolver's unrelatedINTELLIGENTmode concept (Source.INTELLIGENT_SINGLE, etc.) intentionally not renamed — that's enum-resolution domain vocabulary from issue #1383, unrelated to the settings class.