Skip to content

Commit 3a8606e

Browse files
committed
feat(devtools): add option to enable/disable diff viewer in settings #352
- Add checkbox for enabling/disabling diff viewer in AutoDevCoder settings - Implement functionality to show/hide diff viewer based on setting - Update AutoDevCoderConfigurable and AutoDevCoderSettingService to include new setting
1 parent 2dd564d commit 3a8606e

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

core/src/main/kotlin/cc/unitmesh/devti/settings/coder/AutoDevCoderConfigurable.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ class AutoDevCoderConfigurable(private val project: Project) : BoundConfigurable
165165
)
166166
}
167167

168+
row(jLabel("settings.autodev.coder.enableDiffViewer")) {
169+
fullWidthCell(JCheckBox())
170+
.bind(
171+
componentGet = { it.isSelected },
172+
componentSet = { component, value -> component.isSelected = value },
173+
prop = state::enableDiffViewer.toMutableProperty()
174+
)
175+
}
176+
168177
row(jLabel("settings.external.team.prompts.path")) {
169178
fullWidthCell(teamPromptsField)
170179
.bind(
@@ -190,6 +199,7 @@ class AutoDevCoderConfigurable(private val project: Project) : BoundConfigurable
190199
it.enableAutoLintCode = state.enableAutoLintCode
191200
it.enableRenderWebview = state.enableRenderWebview
192201
it.enableAutoScrollInSketch = state.enableAutoScrollInSketch
202+
it.enableDiffViewer = state.enableDiffViewer
193203
}
194204
}
195205
}

core/src/main/kotlin/cc/unitmesh/devti/settings/coder/AutoDevCoderSettingService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class AutoDevCoderSettingService(
3333
var enableAutoLintCode by property(false)
3434
var enableRenderWebview by property(false)
3535
var enableAutoScrollInSketch by property(false)
36+
var enableDiffViewer by property(false)
3637
var teamPromptsDir by property("prompts") { it.isEmpty() }
3738

3839
override fun copy(): AutoDevCoderSettings {

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/SingleFileDiffSketch.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@ class SingleFileDiffSketch(
157157
contentPanel.add(fileContainer, BorderLayout.CENTER)
158158
mainPanel.add(myHeaderPanel)
159159
mainPanel.add(contentPanel)
160-
invokeLater {
161-
val diffPanel = createDiffViewer()
162-
mainPanel.add(diffPanel)
160+
if (myProject.coderSetting.state.enableDiffViewer) {
161+
invokeLater {
162+
val diffPanel = createDiffViewer()
163+
mainPanel.add(diffPanel)
164+
}
163165
}
164166
}
165167

0 commit comments

Comments
 (0)