Skip to content

Commit 330cd5b

Browse files
committed
Merge branch 'feature/fix-widget-showing-in-the-sibling-display' into develop
2 parents 932e4bb + 033b6c3 commit 330cd5b

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionPanelView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct SuggestionPanelView: View {
118118
@Namespace var namespace
119119
120120
var body: some View {
121-
VStack {
121+
VStack(spacing: 0) {
122122
if !viewModel.alignTopToAnchor {
123123
Spacer()
124124
.frame(minHeight: 0, maxHeight: .infinity)
@@ -194,7 +194,7 @@ struct SuggestionPanelView: View {
194194
}
195195
}
196196
}
197-
.frame(maxWidth: .infinity, maxHeight: Style.panelHeight)
197+
.frame(maxWidth: .infinity)
198198
199199
if viewModel.alignTopToAnchor {
200200
Spacer()

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ extension SuggestionWidgetController {
279279
kAXResizedNotification,
280280
kAXMainWindowChangedNotification,
281281
kAXFocusedWindowChangedNotification,
282-
kAXFocusedUIElementChangedNotification
282+
kAXFocusedUIElementChangedNotification,
283+
kAXWindowMovedNotification,
284+
kAXWindowResizedNotification
283285
)
284286
for await notification in notifications {
285287
guard let self else { return }
@@ -322,7 +324,8 @@ extension SuggestionWidgetController {
322324
)
323325
let scroll = AXNotificationStream(
324326
app: app,
325-
element: scrollBar, notificationNames: kAXValueChangedNotification
327+
element: scrollBar,
328+
notificationNames: kAXValueChangedNotification
326329
)
327330

328331
if #available(macOS 13.0, *) {
@@ -332,8 +335,6 @@ extension SuggestionWidgetController {
332335
) {
333336
guard let self else { return }
334337
try Task.checkCancellation()
335-
let mode = UserDefaults.shared.value(for: \.suggestionWidgetPositionMode)
336-
if mode != .alignToTextCursor { break }
337338
self.updateWindowLocation(animated: false)
338339
}
339340
} else {
@@ -439,7 +440,7 @@ extension SuggestionWidgetController {
439440
} else {
440441
suggestionPanelViewModel.content = nil
441442
}
442-
443+
443444
if let chat = chatForFiles[fileURL] {
444445
suggestionPanelViewModel.chat = chat
445446
} else {

0 commit comments

Comments
 (0)