Skip to content

Commit 63af3b4

Browse files
committed
Merge tag '0.27.0' into develop
2 parents 78809ef + fa7dc18 commit 63af3b4

8 files changed

Lines changed: 41 additions & 14 deletions

File tree

Core/Sources/ChatGPTChatTab/ChatPanel.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct ChatPanelMessages: View {
4848
@Namespace var scrollSpace
4949
@State var scrollOffset: Double = 0
5050
@State var listHeight: Double = 0
51-
5251
@Environment(\.isEnabled) var isEnabled
5352

5453
var body: some View {
@@ -137,11 +136,14 @@ struct ChatPanelMessages: View {
137136

138137
func trackScrollWheel() {
139138
NSApplication.shared.publisher(for: \.currentEvent)
140-
.filter { _ in isEnabled }
141-
.filter { event in event?.type == .scrollWheel }
139+
.filter {
140+
if !isEnabled { return false }
141+
return $0?.type == .scrollWheel
142+
}
143+
.compactMap { $0 }
142144
.sink { event in
143-
guard isEnabled, isPinnedToBottom else { return }
144-
let delta = event?.deltaY ?? 0
145+
guard isPinnedToBottom else { return }
146+
let delta = event.deltaY
145147
let scrollUp = delta > 0
146148
if scrollUp {
147149
isPinnedToBottom = false
@@ -607,6 +609,7 @@ struct ChatPanelInputArea: View {
607609
let availableFeatures = plugins + [
608610
"/exit",
609611
"@code",
612+
"@sense",
610613
"@project",
611614
"@web",
612615
]

Core/Sources/Service/Service.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class Service {
5252
ProService()
5353
}
5454
#endif
55-
55+
5656
scheduledCleaner.service = self
5757
}
5858

@@ -83,9 +83,16 @@ final class GlobalShortcutManager {
8383
setupShortcutIfNeeded()
8484

8585
KeyboardShortcuts.onKeyUp(for: .showHideWidget) { [guiController] in
86-
guiController.viewStore.send(.suggestionWidget(.circularWidget(.widgetClicked)))
86+
if XcodeInspector.shared.activeXcode == nil,
87+
!guiController.viewStore.state.suggestionWidgetState.chatPanelState.isPanelDisplayed,
88+
UserDefaults.shared.value(for: \.showHideWidgetShortcutGlobally)
89+
{
90+
guiController.viewStore.send(.openChatPanel(forceDetach: true))
91+
} else {
92+
guiController.viewStore.send(.suggestionWidget(.circularWidget(.widgetClicked)))
93+
}
8794
}
88-
95+
8996
XcodeInspector.shared.$activeApplication.sink { app in
9097
if !UserDefaults.shared.value(for: \.showHideWidgetShortcutGlobally) {
9198
let shouldBeEnabled = if let app, app.isXcode || app.isExtensionService {

Core/Sources/SuggestionWidget/FeatureReducers/ChatPanelFeature.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct ChatPanelFeature: ReducerProtocol {
4747
public struct State: Equatable {
4848
public var chatTabGroup = ChatTabGroup()
4949
var colorScheme: ColorScheme = .light
50-
var isPanelDisplayed = false
50+
public internal(set) var isPanelDisplayed = false
5151
var chatPanelInASeparateWindow = false
5252
}
5353

Core/Sources/SuggestionWidget/FeatureReducers/WidgetFeature.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ public struct WidgetFeature: ReducerProtocol {
454454
state.focusingDocumentURL = xcodeInspector.realtimeActiveDocumentURL
455455
return .none
456456

457+
#warning("TODO: use function instead of action for high rate actions like this")
457458
case let .updateWindowLocation(animated):
458459
guard let widgetLocation = generateWidgetLocation() else { return .none }
459460
state.panelState.sharedPanelState.alignTopToAnchor = widgetLocation
@@ -523,6 +524,7 @@ public struct WidgetFeature: ReducerProtocol {
523524
if shouldDebounce {
524525
try await mainQueue.sleep(for: .seconds(0.2))
525526
}
527+
try Task.checkCancellation()
526528
let task = Task { @MainActor in
527529
if let app = activeApplicationMonitor.activeApplication, app.isXcode {
528530
let application = AXUIElementCreateApplication(app.processIdentifier)

Pro

Submodule Pro updated from 5e0a145 to ce6f163

Tool/Sources/OpenAIService/Configuration/UserPreferenceChatGPTConfiguration.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ public class OverridingChatGPTConfiguration: ChatGPTConfiguration {
107107
}
108108

109109
public var maxTokens: Int {
110-
overriding.maxTokens ?? configuration.maxTokens
110+
if let maxTokens = overriding.maxTokens { return maxTokens }
111+
if let model { return model.info.maxTokens }
112+
return configuration.maxTokens
111113
}
112114

113115
public var minimumReplyTokens: Int {
114-
overriding.minimumReplyTokens ?? configuration.minimumReplyTokens
116+
if let minimumReplyTokens = overriding.minimumReplyTokens { return minimumReplyTokens }
117+
return maxTokens / 5
115118
}
116119

117120
public var runFunctionsAutomatically: Bool {

Version.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
APP_VERSION = 0.26.0
2-
APP_BUILD = 272
1+
APP_VERSION = 0.27.0
2+
APP_BUILD = 280
33

appcast.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
<channel>
44
<title>Copilot for Xcode</title>
55

6+
<item>
7+
<title>0.27.0</title>
8+
<pubDate>Fri, 10 Nov 2023 02:34:25 +0800</pubDate>
9+
<sparkle:version>280</sparkle:version>
10+
<sparkle:shortVersionString>0.27.0</sparkle:shortVersionString>
11+
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
12+
<sparkle:releaseNotesLink>
13+
https://github.com/intitni/CopilotForXcode/releases/tag/0.27.0
14+
</sparkle:releaseNotesLink>
15+
<enclosure url="https://github.com/intitni/CopilotForXcode/releases/download/0.27.0/Copilot.for.Xcode.app.zip" length="36494349" type="application/octet-stream" sparkle:edSignature="vAXfqq8ElSr4/0QnVx3J4ooUKTF6XkIUNIAGhwPFFgExXbZa5OcEJayYt3J3Mri22aHiSU8OpDY/xisdUEzhBQ=="/>
16+
</item>
17+
618
<item>
719
<title>0.26.0</title>
820
<pubDate>Sun, 22 Oct 2023 18:58:49 +0800</pubDate>

0 commit comments

Comments
 (0)