@@ -29,6 +29,7 @@ struct GeneralView: View {
2929 Spacer ( ) . frame ( height: 40 )
3030 rightsView
3131 . padding ( . horizontal, 20 )
32+ . padding ( . bottom, 20 )
3233 }
3334 . frame ( maxWidth: . infinity)
3435 }
@@ -123,7 +124,8 @@ struct GeneralSettingsView: View {
123124 @StateObject var settings = Settings ( )
124125 @Environment ( \. updateChecker) var updateChecker
125126 @AppStorage ( \. realtimeSuggestionToggle) var isCopilotEnabled : Bool
126- @State private var shouldPresentInstructionSheet = false
127+ @AppStorage ( \. extensionPermissionShown) var extensionPermissionShown : Bool
128+ @State private var shouldPresentExtensionPermissionAlert = false
127129 @State private var shouldPresentTurnoffSheet = false
128130
129131 let store : StoreOf < General >
@@ -151,17 +153,15 @@ struct GeneralSettingsView: View {
151153 VStack ( alignment: . leading) {
152154 let grantedStatus : String = {
153155 guard let granted = store. isAccessibilityPermissionGranted else { return StringConstants . loading }
154- return granted ? " Granted " : " Not Granted "
156+ return granted ? " Granted " : " Not Granted. Required to run. Click to open System Preferences. "
155157 } ( )
156- Text ( StringConstants . accessibilityPermissions )
158+ Text ( StringConstants . accessibilityPermission )
157159 . font ( . body)
158- Text ( " \( StringConstants . status) \( grantedStatus) ⓘ " )
160+ Text ( " \( StringConstants . status) \( grantedStatus) " )
159161 . font ( . footnote)
160162 }
161163 Spacer ( )
162-
163- Image ( systemName: " control " )
164- . rotationEffect ( . degrees( 90 ) )
164+ Image ( systemName: " chevron.right " )
165165 }
166166 }
167167 . foregroundStyle ( . primary)
@@ -170,23 +170,19 @@ struct GeneralSettingsView: View {
170170 Divider ( )
171171 HStack {
172172 VStack ( alignment: . leading) {
173- let grantedStatus : String = {
174- guard let granted = store. isAccessibilityPermissionGranted else { return StringConstants . loading }
175- return granted ? " Granted " : " Not Granted "
176- } ( )
177- Text ( StringConstants . extensionPermissions)
173+ Text ( StringConstants . extensionPermission)
178174 . font ( . body)
179- Text ( " \( StringConstants . status ) \( grantedStatus ) ⓘ " )
180- . font ( . footnote )
181- . onTapGesture {
182- shouldPresentInstructionSheet = true
183- }
175+ Text ( """
176+ Check for GitHub Copilot in Xcode's Editor menu. \
177+ Restart Xcode if greyed out.
178+ """ )
179+ . font ( . footnote )
184180 }
185181 Spacer ( )
186- Link ( destination : URL ( string : " x-apple.systempreferences:com.apple.ExtensionsPreferences " ) ! ) {
187- Image ( systemName : " control " )
188- . rotationEffect ( . degrees ( 90 ) )
189- }
182+ Image ( systemName : " chevron.right " )
183+ }
184+ . onTapGesture {
185+ shouldPresentExtensionPermissionAlert = true
190186 }
191187 . foregroundStyle ( . primary)
192188 . padding ( . horizontal, 8 )
@@ -210,11 +206,17 @@ struct GeneralSettingsView: View {
210206 }
211207 }
212208 . padding ( . horizontal, 20 )
213- . sheet ( isPresented: $shouldPresentInstructionSheet) {
214- } content: {
215- InstructionSheet {
216- shouldPresentInstructionSheet = false
217- }
209+ . alert (
210+ " Enable Extension Permission " ,
211+ isPresented: $shouldPresentExtensionPermissionAlert
212+ ) {
213+ Button ( " Open System Preferences " , action: {
214+ let url = " x-apple.systempreferences:com.apple.ExtensionsPreferences "
215+ NSWorkspace . shared. open ( URL ( string: url) !)
216+ } ) . keyboardShortcut ( . defaultAction)
217+ Button ( " Close " , role: . cancel, action: { } )
218+ } message: {
219+ Text ( " Enable GitHub Copilot under Xcode Source Editor extensions " )
218220 }
219221 . alert ( isPresented: $shouldPresentTurnoffSheet) {
220222 Alert (
@@ -229,6 +231,11 @@ struct GeneralSettingsView: View {
229231 }
230232 )
231233 }
234+ . task {
235+ if extensionPermissionShown { return }
236+ extensionPermissionShown = true
237+ shouldPresentExtensionPermissionAlert = true
238+ }
232239 }
233240}
234241
@@ -314,8 +321,7 @@ struct CopilotConnectionView: View {
314321 . font ( . body)
315322 Spacer ( )
316323
317- Image ( systemName: " control " )
318- . rotationEffect ( . degrees( 90 ) )
324+ Image ( systemName: " chevron.right " )
319325 }
320326 }
321327 . foregroundStyle ( . primary)
@@ -327,7 +333,6 @@ struct CopilotConnectionView: View {
327333 }
328334 . padding ( . horizontal, 20 )
329335 . onAppear {
330- store. send ( . reloadStatus)
331336 viewModel. checkStatus ( )
332337 }
333338 }
@@ -345,8 +350,7 @@ struct CopilotConnectionView: View {
345350 Text ( StringConstants . copilotDocumentation)
346351 . font ( . body)
347352 Spacer ( )
348- Image ( systemName: " control " )
349- . rotationEffect ( . degrees( 90 ) )
353+ Image ( systemName: " chevron.right " )
350354 }
351355 }
352356 . foregroundStyle ( . primary)
@@ -361,8 +365,7 @@ struct CopilotConnectionView: View {
361365 Text ( StringConstants . copilotFeedbackForum)
362366 . font ( . body)
363367 Spacer ( )
364- Image ( systemName: " control " )
365- . rotationEffect ( . degrees( 90 ) )
368+ Image ( systemName: " chevron.right " )
366369 }
367370 }
368371 . foregroundStyle ( . primary)
0 commit comments