From ea7e72bfb8f59a6c55d3482a0c75822b14866340 Mon Sep 17 00:00:00 2001 From: RoshanNagaram-eng Date: Tue, 20 Aug 2024 17:41:09 -0700 Subject: [PATCH 1/4] Made changes --- .../CodeiumService/LanguageServer/CodeiumLanguageServer.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tool/Sources/CodeiumService/LanguageServer/CodeiumLanguageServer.swift b/Tool/Sources/CodeiumService/LanguageServer/CodeiumLanguageServer.swift index 62af56b19..c3f83118c 100644 --- a/Tool/Sources/CodeiumService/LanguageServer/CodeiumLanguageServer.swift +++ b/Tool/Sources/CodeiumService/LanguageServer/CodeiumLanguageServer.swift @@ -63,6 +63,8 @@ final class CodeiumLanguageServer { if isEnterpriseMode { process.arguments?.append("--enterprise_mode") + process.arguments?.append("--portal_url") + process.arguments?.append(UserDefaults.shared.value(for: \.codeiumPortalUrl)) } let indexEnabled = UserDefaults.shared.value(for: \.codeiumIndexEnabled) From a1e4df8a4b9d8d8706a54b31e9213a5750d49e40 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Wed, 21 Aug 2024 23:30:35 +0800 Subject: [PATCH 2/4] Bump version to 0.33.8 --- Version.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Version.xcconfig b/Version.xcconfig index 41110cc2c..10eba9dc0 100644 --- a/Version.xcconfig +++ b/Version.xcconfig @@ -1,3 +1,3 @@ -APP_VERSION = 0.33.7 -APP_BUILD = 399 +APP_VERSION = 0.33.8 +APP_BUILD = 402 From d6d957a4a21aef9f177c0b47134af0f82c6c83a9 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Wed, 21 Aug 2024 23:53:33 +0800 Subject: [PATCH 3/4] Fix window position on space change --- .../WidgetWindowsController.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Core/Sources/SuggestionWidget/WidgetWindowsController.swift b/Core/Sources/SuggestionWidget/WidgetWindowsController.swift index c906d312d..5fb49d2c8 100644 --- a/Core/Sources/SuggestionWidget/WidgetWindowsController.swift +++ b/Core/Sources/SuggestionWidget/WidgetWindowsController.swift @@ -419,7 +419,8 @@ extension WidgetWindowsController { 0 } else if previousAppIsXcode { if windows.chatPanelWindow.isFullscreen, - windows.chatPanelWindow.isOnActiveSpace { + windows.chatPanelWindow.isOnActiveSpace + { 0 } else { 1 @@ -513,7 +514,7 @@ extension WidgetWindowsController { ) updateWindowLocationTask = Task { - try await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000)) + try await Task.sleep(nanoseconds: UInt64(delay * 500_000_000)) try Task.checkCancellation() await update() } @@ -580,9 +581,8 @@ extension WidgetWindowsController { func handleXcodeFullscreenChange() async { let activeXcode = await XcodeInspector.shared.safe.activeXcode - let isFullscreen = if let xcode = activeXcode?.appElement, - let xcodeWindow = xcode.focusedWindow - { + let xcode = activeXcode?.appElement + let isFullscreen = if let xcode, let xcodeWindow = xcode.focusedWindow { xcodeWindow.isFullScreen && xcode.isFrontmost } else { false @@ -598,7 +598,7 @@ extension WidgetWindowsController { $0.send(.didChangeActiveSpace(fullscreen: isFullscreen)) } - if windows.fullscreenDetector.isOnActiveSpace, isFullscreen { + if windows.fullscreenDetector.isOnActiveSpace, xcode?.focusedWindow != nil { windows.orderFront() } } @@ -819,7 +819,9 @@ public final class WidgetWindows { toastWindow.orderFrontRegardless() sharedPanelWindow.orderFrontRegardless() suggestionPanelWindow.orderFrontRegardless() - if chatPanelWindow.level.rawValue > NSWindow.Level.normal.rawValue { + if chatPanelWindow.level.rawValue > NSWindow.Level.normal.rawValue, + store.withState({ !$0.chatPanelState.isDetached }) + { chatPanelWindow.orderFrontRegardless() } } From 02c742dabd1480902379ac635c1b0478ae1e1ee9 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Wed, 21 Aug 2024 23:54:56 +0800 Subject: [PATCH 4/4] Add todo --- Core/Sources/SuggestionWidget/WidgetWindowsController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/Sources/SuggestionWidget/WidgetWindowsController.swift b/Core/Sources/SuggestionWidget/WidgetWindowsController.swift index 5fb49d2c8..2cda76b69 100644 --- a/Core/Sources/SuggestionWidget/WidgetWindowsController.swift +++ b/Core/Sources/SuggestionWidget/WidgetWindowsController.swift @@ -8,6 +8,10 @@ import Foundation import SwiftUI import XcodeInspector +#warning(""" +TODO: This part is too messy, consider breaking it up, let each window handle their own things +""") + actor WidgetWindowsController: NSObject { let userDefaultsObservers = WidgetUserDefaultsObservers() var xcodeInspector: XcodeInspector { .shared }