File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -219,19 +219,22 @@ public final class SuggestionWidgetController {
219219 }
220220
221221 Task { @MainActor in
222- suggestionPanelViewModel. onActiveTabChanged = { [ weak self ] activeTab in
222+ suggestionPanelViewModel. onActiveTabChanged = { activeTab in
223223 #warning("""
224224 TODO: There should be a better way for that
225225 Currently, we have to make the app an accessory so that we can type thin gs in the chat mode.
226226 But in other modes, we want to keep it prohibited so the helper app won't take over the focus.
227227 """ )
228- if case .chat = activeTab, NSApp.activationPolicy() != .accessory {
229- NSApp.setActivationPolicy(.accessory)
230- } else if NSApp.activationPolicy() != .prohibited {
228+ switch activeTab {
229+ case .suggestion:
230+ guard NSApp.activationPolicy() != .prohibited else { return }
231231 Task {
232232 try await Environment.makeXcodeActive()
233233 NSApp.setActivationPolicy(.prohibited)
234234 }
235+ case .chat:
236+ guard NSApp.activationPolicy() != .accessory else { return }
237+ NSApp.setActivationPolicy(.accessory)
235238 }
236239 }
237240 }
You can’t perform that action at this time.
0 commit comments