Skip to content

Commit 31848ac

Browse files
committed
Update prompt to code settings
1 parent cebf7bd commit 31848ac

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

Core/Sources/HostApp/FeatureSettings/PromptToCodeSettingsView.swift

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ struct PromptToCodeSettingsView: View {
104104
Text("pt")
105105
}.disabled(true)
106106
}
107-
107+
108108
ScopeForm()
109109
}
110110
}
111-
111+
112112
struct ScopeForm: View {
113113
class Settings: ObservableObject {
114114
@AppStorage(\.enableSenseScopeByDefaultInPromptToCode)
@@ -125,18 +125,30 @@ struct PromptToCodeSettingsView: View {
125125
#if canImport(ProHostApp)
126126

127127
SubSection(
128-
title: WithFeatureEnabled(\.senseScopeInChat, alignment: .trailing) {
129-
Text("Sense Scope (Experimental)")
130-
},
131-
description: "Experimental. Enable the bot to read the relevant code of the editing file in the project, third party packages and the SDK."
132-
) {
133-
WithFeatureEnabled(\.projectScopeInChat, alignment: .hidden) {
134-
Form {
135-
Toggle(isOn: $settings.enableSenseScopeByDefaultInPromptToCode) {
136-
Text("Enable by default")
128+
title: Text("Sense Scope (Experimental)"),
129+
description: IfFeatureEnabled(\.senseScopeInChat) {
130+
Text("""
131+
Enable the bot to access the relevant code \
132+
of the editing document in the project, third party packages and the SDK.
133+
""")
134+
} else: {
135+
VStack(alignment: .leading) {
136+
Text("""
137+
Enable the bot to read the relevant code \
138+
of the editing document in the SDK, and
139+
""")
140+
141+
WithFeatureEnabled(\.senseScopeInChat, alignment: .inlineLeading) {
142+
Text("the project and third party packages.")
137143
}
138144
}
139145
}
146+
) {
147+
Form {
148+
Toggle(isOn: $settings.enableSenseScopeByDefaultInPromptToCode) {
149+
Text("Enable by default")
150+
}
151+
}
140152
}
141153

142154
#endif

0 commit comments

Comments
 (0)