Skip to content

Commit e54c85f

Browse files
committed
Update
1 parent f0b2a24 commit e54c85f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

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

0 commit comments

Comments
 (0)