Skip to content

Commit 892a041

Browse files
committed
Rename variables
1 parent 6bbc444 commit 892a041

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

Core/Sources/SuggestionWidget/FeatureReducers/PanelFeature.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct PanelFeature: ReducerProtocol {
6767
// looks like we need a delay.
6868
try await Task.sleep(nanoseconds: 150_000_000)
6969
await NSApplication.shared.activate(ignoringOtherApps: true)
70-
await windows.panelWindow.makeKey()
70+
await windows.sharedPanelWindow.makeKey()
7171
}
7272

7373
case let .presentPanelContent(content, shouldDisplay):

Core/Sources/SuggestionWidget/ModuleDependency.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ public final class Windows {
1818
var fullscreenDetector: NSWindow!
1919
var widgetWindow: NSWindow!
2020
var tabWindow: NSWindow!
21-
var panelWindow: NSWindow!
22-
var suggestionWindow: NSWindow!
23-
var chatWindow: NSWindow!
21+
var sharedPanelWindow: NSWindow!
22+
var suggestionPanelWindow: NSWindow!
23+
var chatPanelWindow: NSWindow!
2424

2525
nonisolated
2626
init() {}
2727

2828
func orderFront() {
2929
widgetWindow?.orderFrontRegardless()
3030
tabWindow?.orderFrontRegardless()
31-
panelWindow?.orderFrontRegardless()
32-
suggestionWindow?.orderFrontRegardless()
33-
chatWindow?.orderFrontRegardless()
31+
sharedPanelWindow?.orderFrontRegardless()
32+
suggestionPanelWindow?.orderFrontRegardless()
33+
chatPanelWindow?.orderFrontRegardless()
3434
}
3535
}
3636

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public final class SuggestionWidgetController: NSObject {
8181
return it
8282
}()
8383

84-
private lazy var panelWindow = {
84+
private lazy var sharedPanelWindow = {
8585
let it = CanBecomeKeyWindow(
8686
contentRect: .init(x: 0, y: 0, width: Style.panelWidth, height: Style.panelHeight),
8787
styleMask: .borderless,
@@ -117,7 +117,7 @@ public final class SuggestionWidgetController: NSObject {
117117
return it
118118
}()
119119

120-
private lazy var suggestionWindow = {
120+
private lazy var suggestionPanelWindow = {
121121
let it = CanBecomeKeyWindow(
122122
contentRect: .init(x: 0, y: 0, width: Style.panelWidth, height: Style.panelHeight),
123123
styleMask: .borderless,
@@ -146,7 +146,7 @@ public final class SuggestionWidgetController: NSObject {
146146
return it
147147
}()
148148

149-
private lazy var chatWindow = {
149+
private lazy var chatPanelWindow = {
150150
let it = ChatWindow(
151151
contentRect: .zero,
152152
styleMask: [.resizable],
@@ -202,10 +202,10 @@ public final class SuggestionWidgetController: NSObject {
202202

203203
Task { @MainActor in
204204

205-
windows.chatWindow = chatWindow
205+
windows.chatPanelWindow = chatPanelWindow
206206
windows.tabWindow = tabWindow
207-
windows.panelWindow = panelWindow
208-
windows.suggestionWindow = suggestionWindow
207+
windows.sharedPanelWindow = sharedPanelWindow
208+
windows.suggestionPanelWindow = suggestionPanelWindow
209209
windows.fullscreenDetector = fullscreenDetector
210210
windows.widgetWindow = widgetWindow
211211

@@ -262,19 +262,19 @@ public extension SuggestionWidgetController {
262262

263263
extension SuggestionWidgetController: NSWindowDelegate {
264264
public func windowWillMove(_ notification: Notification) {
265-
guard (notification.object as? NSWindow) === chatWindow else { return }
265+
guard (notification.object as? NSWindow) === chatPanelWindow else { return }
266266
Task { @MainActor in
267267
await Task.yield()
268268
store.send(.chatPanel(.detachChatPanel))
269269
}
270270
}
271271

272272
public func windowDidBecomeKey(_ notification: Notification) {
273-
guard (notification.object as? NSWindow) === chatWindow else { return }
273+
guard (notification.object as? NSWindow) === chatPanelWindow else { return }
274274
let screenFrame = NSScreen.screens.first(where: { $0.frame.origin == .zero })?
275275
.frame ?? .zero
276276
var mouseLocation = NSEvent.mouseLocation
277-
let windowFrame = chatWindow.frame
277+
let windowFrame = chatPanelWindow.frame
278278
if mouseLocation.y > windowFrame.maxY - 40,
279279
mouseLocation.y < windowFrame.maxY,
280280
mouseLocation.x > windowFrame.minX,
@@ -289,7 +289,7 @@ extension SuggestionWidgetController: NSWindowDelegate {
289289
),
290290
let event = NSEvent(cgEvent: cgEvent)
291291
{
292-
chatWindow.performDrag(with: event)
292+
chatPanelWindow.performDrag(with: event)
293293
}
294294
}
295295
}

0 commit comments

Comments
 (0)