Skip to content

Commit 9a158e1

Browse files
committed
Allow accepting suggestion when code is ready
1 parent 6f4208c commit 9a158e1

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct PromptToCodePanel: View {
1717
.padding()
1818
.background(Color.red)
1919
}
20-
20+
2121
if provider.code.isEmpty {
2222
Text(
2323
provider.isResponding
@@ -63,14 +63,14 @@ struct PromptToCodePanel: View {
6363
}
6464
}
6565
.overlay(alignment: .bottom) {
66-
Group {
66+
HStack {
6767
if provider.isResponding {
6868
Button(action: {
6969
provider.stopResponding()
7070
}) {
7171
HStack(spacing: 4) {
7272
Image(systemName: "stop.fill")
73-
Text("Stop Responding")
73+
Text("Stop")
7474
}
7575
.padding(8)
7676
.background(
@@ -83,7 +83,13 @@ struct PromptToCodePanel: View {
8383
}
8484
}
8585
.buttonStyle(.plain)
86-
} else {
86+
}
87+
88+
let isRespondingButCodeIsReady = provider.isResponding
89+
&& !provider.code.isEmpty
90+
&& !provider.description.isEmpty
91+
92+
if !provider.isResponding || isRespondingButCodeIsReady {
8793
HStack {
8894
Toggle(
8995
"Continuous Mode",

0 commit comments

Comments
 (0)