@@ -244,25 +244,27 @@ struct ChatSettingsView: View {
244244 @StateObject var settings = Settings ( )
245245
246246 var body : some View {
247+ SettingsDivider ( " Scopes " )
248+
247249 VStack {
248- Scope (
250+ SubSection (
249251 title: Text ( " File Scope " ) ,
250252 description: " Enable the bot to read the metadata of the editing file. "
251253 ) {
252254 Form {
253255 Toggle ( isOn: $settings. enableFileScopeByDefaultInChatContext) {
254- Text ( " Enable @file scope by default in chat context. " )
256+ Text ( " Enable by default " )
255257 }
256258 }
257259 }
258260
259- Scope (
261+ SubSection (
260262 title: Text ( " Code Scope " ) ,
261263 description: " Enable the bot to read the code and metadata in the editing file. "
262264 ) {
263265 Form {
264266 Toggle ( isOn: $settings. enableCodeScopeByDefaultInChatContext) {
265- Text ( " Enable @code scope by default in chat context. " )
267+ Text ( " Enable by default " )
266268 }
267269
268270 HStack {
@@ -282,16 +284,16 @@ struct ChatSettingsView: View {
282284
283285 #if canImport(ProHostApp)
284286
285- Scope (
286- title: WithFeatureEnabled ( \. projectScopeInChat) {
287+ SubSection (
288+ title: WithFeatureEnabled ( \. projectScopeInChat, alignment : . trailing ) {
287289 Text ( " Sense Scope (Experimental) " )
288290 } ,
289291 description: " Experimental. Enable the bot to read the relevant code of the editing file in the project, third party packages and the SDK. "
290292 ) {
291293 WithFeatureEnabled ( \. projectScopeInChat, alignment: . hidden) {
292294 Form {
293295 Toggle ( isOn: $settings. enableSenseScopeByDefaultInChatContext) {
294- Text ( " Enable @sense scope by default in chat context. " )
296+ Text ( " Enable by default " )
295297 }
296298
297299 Picker (
@@ -321,16 +323,16 @@ struct ChatSettingsView: View {
321323 }
322324 }
323325
324- Scope (
325- title: WithFeatureEnabled ( \. projectScopeInChat) {
326+ SubSection (
327+ title: WithFeatureEnabled ( \. projectScopeInChat, alignment : . trailing ) {
326328 Text ( " Project Scope (Experimental) " )
327329 } ,
328- description: " Experimental. Enable the bot to search code symbols in the project, third party packages and the SDK. "
330+ description: " Experimental. Enable the bot to search code symbols in the project, third party packages and the SDK. "
329331 ) {
330332 WithFeatureEnabled ( \. projectScopeInChat, alignment: . hidden) {
331333 Form {
332334 Toggle ( isOn: $settings. enableProjectScopeByDefaultInChatContext) {
333- Text ( " Enable @project scope by default in chat context. " )
335+ Text ( " Enable by default " )
334336 }
335337
336338 Picker (
@@ -362,7 +364,7 @@ struct ChatSettingsView: View {
362364
363365 #endif
364366
365- Scope (
367+ SubSection (
366368 title: Text ( " Web Scope " ) ,
367369 description: " Allow the bot to search on Bing or read a web page. "
368370 ) {
@@ -398,28 +400,6 @@ struct ChatSettingsView: View {
398400 }
399401 }
400402 }
401-
402- struct Scope < Title: View , Content: View > : View {
403- let title : Title
404- let description : String
405- let content : ( ) -> Content
406-
407- var body : some View {
408- SettingsDivider ( title)
409- VStack {
410- Text ( description)
411- . multilineTextAlignment ( . center)
412- . foregroundStyle ( . secondary)
413- . frame ( maxWidth: . infinity)
414- . padding ( 8 )
415- . background {
416- RoundedRectangle ( cornerRadius: 8 )
417- . fill ( Color . secondary. opacity ( 0.1 ) )
418- }
419- content ( )
420- }
421- }
422- }
423403 }
424404}
425405
0 commit comments