Skip to content

Commit 48f90bd

Browse files
committed
Only show real-time suggestion indicator in comment mode
1 parent e1e972e commit 48f90bd

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Core/Sources/Service/GUI/RealtimeSuggestionIndicatorController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,12 @@ final class RealtimeSuggestionIndicatorController {
238238
private func updateIndicatorVisibility() async {
239239
let isVisible = await {
240240
let isOn = UserDefaults.shared.bool(forKey: SettingsKey.realtimeSuggestionToggle)
241+
let isCommentMode = (PresentationMode(
242+
rawValue: UserDefaults.shared
243+
.integer(forKey: SettingsKey.suggestionPresentationMode)
244+
) ?? .comment) == .comment
241245
let isXcodeActive = await Environment.isXcodeActive()
242-
return isOn && isXcodeActive
246+
return isOn && isXcodeActive && isCommentMode
243247
}()
244248

245249
guard window.isVisible != isVisible else { return }

Core/Sources/Service/SuggestionCommandHandler/WindowBaseCommandHandler.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ struct WindowBaseCommandHandler: SuggestionCommandHandler {
2727
presenter.markAsProcessing(true)
2828
defer {
2929
presenter.markAsProcessing(false)
30-
Task {
31-
await GraphicalUserInterfaceController.shared
32-
.realtimeSuggestionIndicatorController
33-
.endPrefetchAnimation()
34-
}
3530
}
3631
let fileURL = try await Environment.fetchCurrentFileURL()
3732
let (workspace, filespace) = try await Workspace
@@ -162,8 +157,6 @@ struct WindowBaseCommandHandler: SuggestionCommandHandler {
162157
}
163158

164159
func generateRealtimeSuggestions(editor: EditorContent) async throws -> UpdatedContent? {
165-
await GraphicalUserInterfaceController.shared.realtimeSuggestionIndicatorController
166-
.triggerPrefetchAnimation()
167160
return try await presentSuggestions(editor: editor)
168161
}
169162
}

0 commit comments

Comments
 (0)