Skip to content

Commit 75aa71a

Browse files
committed
Pre-release 0.43.140
1 parent 4381034 commit 75aa71a

File tree

50 files changed

+1122
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1122
-355
lines changed

.github/actions/set-xcode-version/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
Xcode version to use, in semver(ish)-style matching the format on the Actions runner image.
77
See available versions at https://github.com/actions/runner-images/blame/main/images/macos/macos-14-Readme.md#xcode
88
required: false
9-
default: '16.2'
9+
default: '26.0'
1010
outputs:
1111
xcode-path:
1212
description: "Path to current Xcode version"

Copilot-for-Xcode-Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@
3030
<string>$(TeamIdentifierPrefix)</string>
3131
<key>STANDARD_TELEMETRY_CHANNEL_KEY</key>
3232
<string>$(STANDARD_TELEMETRY_CHANNEL_KEY)</string>
33+
<key>GITHUB_APP_ID</key>
34+
<string>$(GITHUB_APP_ID)</string>
3335
</dict>
3436
</plist>

Core/Sources/ConversationTab/ChatPanel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public struct ChatPanel: View {
5858
}
5959
.padding(.leading, 16)
6060
.padding(.bottom, 16)
61-
.background(Color(nsColor: .windowBackgroundColor))
61+
.background(.ultraThinMaterial)
6262
.onAppear {
6363
chat.send(.appear)
6464
}
@@ -686,7 +686,7 @@ struct ChatPanelInputArea: View {
686686
}
687687
.overlay {
688688
RoundedRectangle(cornerRadius: 6)
689-
.stroke(Color(nsColor: .controlColor), lineWidth: 1)
689+
.stroke(Color(nsColor: .separatorColor), lineWidth: 1)
690690
}
691691
.background {
692692
Button(action: {

Core/Sources/ConversationTab/ModelPicker/ModelPicker.swift

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct ModelPicker: View {
2323
@State private var agentScopeCache: ScopeCache = ScopeCache()
2424

2525
@State var isMCPFFEnabled: Bool
26+
@State var isBYOKFFEnabled: Bool
2627
@State private var cancellables = Set<AnyCancellable>()
2728

2829
@StateObject private var fontScaleManager = FontScaleManager.shared
@@ -47,12 +48,14 @@ struct ModelPicker: View {
4748
CopilotModelManager.getDefaultChatModel()
4849
self._selectedModel = State(initialValue: initialModel)
4950
self.isMCPFFEnabled = FeatureFlagNotifierImpl.shared.featureFlags.mcp
51+
self.isBYOKFFEnabled = FeatureFlagNotifierImpl.shared.featureFlags.byok
5052
updateAgentPicker()
5153
}
5254

5355
private func subscribeToFeatureFlagsDidChangeEvent() {
5456
FeatureFlagNotifierImpl.shared.featureFlagsDidChange.sink(receiveValue: { featureFlags in
5557
isMCPFFEnabled = featureFlags.mcp
58+
isBYOKFFEnabled = featureFlags.byok
5659
})
5760
.store(in: &cancellables)
5861
}
@@ -142,7 +145,10 @@ struct ModelPicker: View {
142145

143146
func updateCurrentModel() {
144147
let currentModel = AppState.shared.getSelectedModel()
145-
let allAvailableModels = copilotModels + byokModels
148+
var allAvailableModels = copilotModels
149+
if isBYOKFFEnabled {
150+
allAvailableModels += byokModels
151+
}
146152

147153
// Check if current model exists in available models for current scope using model comparison
148154
let modelExists = allAvailableModels.contains { model in
@@ -207,11 +213,13 @@ struct ModelPicker: View {
207213
// Display premium models section if available
208214
modelSection(title: "Premium Models", models: premiumModels)
209215

210-
// Display byok models section if available
211-
modelSection(title: "Other Models", models: byokModels)
212-
213-
Button("Manage Models...") {
214-
try? launchHostAppBYOKSettings()
216+
if isBYOKFFEnabled {
217+
// Display byok models section if available
218+
modelSection(title: "Other Models", models: byokModels)
219+
220+
Button("Manage Models...") {
221+
try? launchHostAppBYOKSettings()
222+
}
215223
}
216224

217225
if standardModels.isEmpty {
@@ -342,6 +350,9 @@ struct ModelPicker: View {
342350
.onChange(of: chatMode) { _ in
343351
updateCurrentModel()
344352
}
353+
.onChange(of: isBYOKFFEnabled) { _ in
354+
updateCurrentModel()
355+
}
345356
.onReceive(NotificationCenter.default.publisher(for: .gitHubCopilotSelectedModelDidChange)) { _ in
346357
updateCurrentModel()
347358
}

Core/Sources/ConversationTab/TerminalViews/RunInTerminalToolView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct RunInTerminalToolView: View {
7474
.scaledFrame(width: 16, height: 16)
7575

7676
Text(self.title)
77-
.scaledFont(.system(size: chatFontSize, weight: .semibold))
77+
.scaledFont(size: chatFontSize, weight: .semibold)
7878
.foregroundStyle(.primary)
7979
.background(Color.clear)
8080
.frame(maxWidth: .infinity, alignment: .leading)
@@ -122,7 +122,7 @@ struct RunInTerminalToolView: View {
122122

123123
Text(command!)
124124
.textSelection(.enabled)
125-
.scaledFont(.system(size: chatFontSize, design: .monospaced))
125+
.scaledFont(size: chatFontSize, design: .monospaced)
126126
.padding(8)
127127
.frame(maxWidth: .infinity, alignment: .leading)
128128
.foregroundStyle(codeForegroundColor)

Core/Sources/ConversationTab/Views/WorkingSetView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ struct FileEditView: View {
139139
switch imageType {
140140
case .system(let name):
141141
Image(systemName: name)
142-
.scaledFont(.system(size: 15, weight: .regular))
142+
.scaledFont(size: 15, weight: .regular)
143143
case .asset(let name):
144144
Image(name)
145145
.renderingMode(.template)

Core/Sources/HostApp/AdvancedSettings/ChatSection.swift

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import SwiftUI
44
import Toast
55
import XcodeInspector
66
import SharedUIComponents
7+
import Logger
78

89
struct ChatSection: View {
910
@AppStorage(\.autoAttachChatToXcode) var autoAttachChatToXcode
1011
@AppStorage(\.enableFixError) var enableFixError
12+
@State private var isEditorPreviewEnabled: Bool = false
1113

1214
var body: some View {
1315
SettingsSection(title: "Chat Settings") {
@@ -23,11 +25,13 @@ struct ChatSection: View {
2325

2426
Divider()
2527

26-
// Custom Prompts - .github/prompts/*.prompt.md
27-
PromptFileSetting(promptType: .prompt)
28-
.padding(SettingsToggle.defaultPadding)
29-
30-
Divider()
28+
if isEditorPreviewEnabled {
29+
// Custom Prompts - .github/prompts/*.prompt.md
30+
PromptFileSetting(promptType: .prompt)
31+
.padding(SettingsToggle.defaultPadding)
32+
33+
Divider()
34+
}
3135

3236
// Auto Attach toggle
3337
SettingsToggle(
@@ -55,6 +59,28 @@ struct ChatSection: View {
5559
FontSizeSetting()
5660
.padding(SettingsToggle.defaultPadding)
5761
}
62+
.onAppear {
63+
Task {
64+
await updateEditorPreviewFeatureFlag()
65+
}
66+
}
67+
.onReceive(DistributedNotificationCenter.default()
68+
.publisher(for: .gitHubCopilotFeatureFlagsDidChange)) { _ in
69+
Task {
70+
await updateEditorPreviewFeatureFlag()
71+
}
72+
}
73+
}
74+
75+
private func updateEditorPreviewFeatureFlag() async {
76+
do {
77+
let service = try getService()
78+
if let featureFlags = try await service.getCopilotFeatureFlags() {
79+
isEditorPreviewEnabled = featureFlags.editorPreviewFeatures
80+
}
81+
} catch {
82+
Logger.client.error("Failed to get copilot feature flags: \(error)")
83+
}
5884
}
5985
}
6086

@@ -112,7 +138,7 @@ struct ResponseLanguageSetting: View {
112138
Text(option.displayName).tag(option.localeCode)
113139
}
114140
}
115-
.frame(maxWidth: 200, alignment: .leading)
141+
.frame(maxWidth: 200, alignment: .trailing)
116142
}
117143
}
118144
}
@@ -198,7 +224,7 @@ struct FontSizeSetting: View {
198224
}
199225
}
200226
)
201-
.padding(.leading, calculateDefaultMarkerXPosition() + 2)
227+
.padding(.leading, calculateDefaultMarkerXPosition() + 6)
202228
.onHover {
203229
if $0 {
204230
NSCursor.pointingHand.push()

Core/Sources/HostApp/BYOKConfigView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct BYOKConfigView: View {
2222

2323
private func expansionBinding(for provider: BYOKProvider) -> Binding<Bool> {
2424
Binding(
25-
get: { expansionStates[provider] ?? true },
25+
get: { expansionStates[provider] ?? false },
2626
set: { expansionStates[provider] = $0 }
2727
)
2828
}

Core/Sources/HostApp/BYOKSettings/ProviderConfigView.swift

Lines changed: 41 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -97,72 +97,53 @@ struct BYOKProviderConfigView: View {
9797
// MARK: - UI Components
9898

9999
private var ProviderLabelView: some View {
100-
HStack(spacing: 8) {
101-
Image(systemName: "chevron.right").font(.footnote.bold())
102-
.foregroundColor(.secondary)
103-
.rotationEffect(.degrees(isExpanded ? 90 : 0))
104-
.animation(.easeInOut(duration: 0.3), value: isExpanded)
105-
.buttonStyle(.borderless)
106-
.opacity(hasApiKey ? 1 : 0)
107-
.allowsHitTesting(hasApiKey)
108-
109-
HStack(spacing: 8) {
110-
Text(provider.title)
111-
.foregroundColor(
112-
hasApiKey ? .primary : Color(
113-
nsColor: colorScheme == .light ? .tertiaryLabelColor : .secondaryLabelColor
114-
)
115-
)
116-
.bold() +
117-
Text(hasModels ? " (\(allModels.filter { $0.isRegistered }.count) of \(allModels.count) Enabled)" : "")
118-
.foregroundColor(.primary)
119-
}
120-
.padding(.vertical, 4)
121-
}
100+
Text(provider.title)
101+
.foregroundColor(
102+
hasApiKey ? .primary : Color(
103+
nsColor: colorScheme == .light ? .tertiaryLabelColor : .secondaryLabelColor
104+
)
105+
)
106+
.bold() +
107+
Text(hasModels ? " (\(allModels.filter { $0.isRegistered }.count) of \(allModels.count) Enabled)" : "")
108+
.foregroundColor(.primary)
122109
}
123110

124111
private var ProviderHeaderRowView: some View {
125-
HStack(alignment: .center, spacing: 16) {
126-
ProviderLabelView
127-
128-
Spacer()
129-
130-
if let errorMessage = errorMessage {
131-
Badge(text: "Can't connect. Check your API key or network.", level: .danger, icon: "xmark.circle.fill")
132-
.help("Unable to connect to \(provider.title). \(errorMessage) Refresh or recheck your key setup.")
133-
}
134-
135-
if hasApiKey {
136-
if dataManager.isLoadingProvider(provider) {
137-
ProgressView().controlSize(.small)
138-
} else {
139-
ConfiguredProviderActions
112+
DisclosureSettingsRow(
113+
isExpanded: $isExpanded,
114+
isEnabled: hasApiKey,
115+
accessibilityLabel: { expanded in "\(provider.title) \(expanded ? "collapse" : "expand")" },
116+
onToggle: { wasExpanded, nowExpanded in
117+
if wasExpanded && !nowExpanded && isSearchBarVisible {
118+
searchText = ""
119+
withAnimation(.easeInOut) { isSearchBarVisible = false }
140120
}
141-
} else {
142-
UnconfiguredProviderAction
143-
}
144-
}
145-
.padding(.leading, 20)
146-
.padding(.trailing, 24)
147-
.padding(.vertical, 8)
148-
.background(QuaternarySystemFillColor.opacity(0.75))
149-
.contentShape(Rectangle())
150-
.onTapGesture {
151-
guard hasApiKey else { return }
152-
let wasExpanded = isExpanded
153-
withAnimation(.easeInOut) {
154-
isExpanded.toggle()
155-
}
156-
// If we just collapsed, and the search bar was open, reset it.
157-
if wasExpanded && !isExpanded && isSearchBarVisible {
158-
searchText = ""
159-
withAnimation(.easeInOut) {
160-
isSearchBarVisible = false
121+
},
122+
title: { ProviderLabelView },
123+
actions: {
124+
Group {
125+
if let errorMessage = errorMessage {
126+
Badge(
127+
text: "Can't connect. Check your API key or network.",
128+
level: .danger,
129+
icon: "xmark.circle.fill"
130+
)
131+
.help("Unable to connect to \(provider.title). \(errorMessage) Refresh or recheck your key setup.")
132+
}
133+
if hasApiKey {
134+
if dataManager.isLoadingProvider(provider) {
135+
ProgressView().controlSize(.small)
136+
} else {
137+
ConfiguredProviderActions
138+
}
139+
} else {
140+
UnconfiguredProviderAction
141+
}
161142
}
143+
.padding(.trailing, 4)
144+
.frame(height: 30)
162145
}
163-
}
164-
.accessibilityAddTraits(.isButton)
165-
.accessibilityLabel("\(provider.title) \(isExpanded ? "collapse" : "expand")")
146+
)
166147
}
167148

168149
@ViewBuilder

0 commit comments

Comments
 (0)