Skip to content

Commit c599826

Browse files
committed
Release 0.25.0
1 parent fa57697 commit c599826

File tree

17 files changed

+414
-136
lines changed

17 files changed

+414
-136
lines changed

Copilot for Xcode/App.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ struct VisualEffect: NSViewRepresentable {
1111
func updateNSView(_ nsView: NSView, context: Context) { }
1212
}
1313

14+
class AppDelegate: NSObject, NSApplicationDelegate {
15+
func applicationShouldTerminateAfterLastWindowClosed(_: NSApplication) -> Bool { true }
16+
}
17+
1418
@main
1519
struct CopilotForXcodeApp: App {
20+
@NSApplicationDelegateAdaptor private var appDelegate: AppDelegate
21+
1622
var body: some Scene {
1723
WindowGroup {
1824
TabContainer()

Core/Sources/HostApp/FeatureSettings/Suggestion/SuggestionFeatureDisabledLanguageListView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct SuggestionFeatureDisabledLanguageListView: View {
8787
if settings.suggestionFeatureDisabledLanguageList.isEmpty {
8888
Text("""
8989
Empty
90-
Disable the language of a file by right clicking the circular widget.
90+
Disable the language of a file from the Copilot menu in the status bar.
9191
""")
9292
.multilineTextAlignment(.center)
9393
.padding()

Core/Sources/HostApp/GeneralView.swift

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

Core/Sources/HostApp/InstructionSheet.swift

Lines changed: 0 additions & 82 deletions
This file was deleted.

Core/Sources/HostApp/StringConstants.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ struct StringConstants {
77
static let installPreReleases = "Install pre-releases"
88
static let general = "General"
99
static let quitCopilot = "Quit GitHub Copilot when Xcode App is closed"
10-
static let accessibilityPermissions = "Accessibility Permissions"
11-
static let extensionPermissions = "Extension Permissions"
10+
static let accessibilityPermission = "Accessibility Permission"
11+
static let extensionPermission = "Extension Permission"
1212
static let status = "Status:"
1313
static let cancel = "Cancel"
1414
static let turnOff = "Turn off"

Core/Sources/XcodeThemeController/PreferenceKey+Theme.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public extension UserDefaultPreferenceKeys {
1717
}
1818

1919
var darkXcodeTheme: PreferenceKey<UserDefaultsStorageBox<XcodeTheme?>> {
20-
.init(defaultValue: .init(nil), key: "LightXcodeTheme")
20+
.init(defaultValue: .init(nil), key: "DarkXcodeTheme")
2121
}
2222

2323
var lastSyncedHighlightJSThemeCreatedAt: PreferenceKey<TimeInterval> {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy