Skip to content

Commit 128425b

Browse files
committed
Rename types
1 parent d0ac2aa commit 128425b

19 files changed

+108
-108
lines changed

Core/Sources/Service/GUI/GraphicalUserInterfaceController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import ChatTabPersistent
2222
struct GUI {
2323
@ObservableState
2424
struct State: Equatable {
25-
var suggestionWidgetState = WidgetFeature.State()
25+
var suggestionWidgetState = Widget.State()
2626

27-
var chatTabGroup: ChatPanelFeature.ChatTabGroup {
27+
var chatTabGroup: ChatPanel.ChatTabGroup {
2828
get { suggestionWidgetState.chatPanelState.chatTabGroup }
2929
set { suggestionWidgetState.chatPanelState.chatTabGroup = newValue }
3030
}
@@ -64,7 +64,7 @@ struct GUI {
6464
case sendCustomCommandToActiveChat(CustomCommand)
6565
case toggleWidgetsHotkeyPressed
6666

67-
case suggestionWidget(WidgetFeature.Action)
67+
case suggestionWidget(Widget.Action)
6868

6969
static func promptToCodeGroup(_ action: PromptToCodeGroup.Action) -> Self {
7070
.suggestionWidget(.panel(.sharedPanel(.promptToCodeGroup(action))))

Core/Sources/SuggestionWidget/ChatPanelWindow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class ChatPanelWindow: WidgetWindow {
4141
}
4242

4343
init(
44-
store: StoreOf<ChatPanelFeature>,
44+
store: StoreOf<ChatPanel>,
4545
chatTabPool: ChatTabPool,
4646
minimizeWindow: @escaping () -> Void
4747
) {

Core/Sources/SuggestionWidget/ChatWindowView.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import SwiftUI
88
private let r: Double = 8
99

1010
struct ChatWindowView: View {
11-
let store: StoreOf<ChatPanelFeature>
11+
let store: StoreOf<ChatPanel>
1212
let toggleVisibility: (Bool) -> Void
1313

1414
var body: some View {
@@ -38,7 +38,7 @@ struct ChatWindowView: View {
3838
}
3939

4040
struct ChatTitleBar: View {
41-
let store: StoreOf<ChatPanelFeature>
41+
let store: StoreOf<ChatPanel>
4242
@State var isHovering = false
4343

4444
var body: some View {
@@ -136,7 +136,7 @@ private extension View {
136136
}
137137

138138
struct ChatTabBar: View {
139-
let store: StoreOf<ChatPanelFeature>
139+
let store: StoreOf<ChatPanel>
140140

141141
struct TabBarState: Equatable {
142142
var tabInfo: IdentifiedArray<String, ChatTabInfo>
@@ -160,7 +160,7 @@ struct ChatTabBar: View {
160160
}
161161

162162
struct Tabs: View {
163-
let store: StoreOf<ChatPanelFeature>
163+
let store: StoreOf<ChatPanel>
164164
@State var draggingTabId: String?
165165
@Environment(\.chatTabPool) var chatTabPool
166166

@@ -226,7 +226,7 @@ struct ChatTabBar: View {
226226
}
227227

228228
struct CreateButton: View {
229-
let store: StoreOf<ChatPanelFeature>
229+
let store: StoreOf<ChatPanel>
230230

231231
var body: some View {
232232
WithPerceptionTracking {
@@ -278,7 +278,7 @@ struct ChatTabBar: View {
278278
}
279279

280280
struct ChatTabBarDropDelegate: DropDelegate {
281-
let store: StoreOf<ChatPanelFeature>
281+
let store: StoreOf<ChatPanel>
282282
let tabs: IdentifiedArray<String, ChatTabInfo>
283283
let itemId: String
284284
@Binding var draggingTabId: String?
@@ -302,7 +302,7 @@ struct ChatTabBarDropDelegate: DropDelegate {
302302
}
303303

304304
struct ChatTabBarButton<Content: View, Icon: View>: View {
305-
let store: StoreOf<ChatPanelFeature>
305+
let store: StoreOf<ChatPanel>
306306
let info: ChatTabInfo
307307
let content: () -> Content
308308
let icon: () -> Icon
@@ -347,7 +347,7 @@ struct ChatTabBarButton<Content: View, Icon: View>: View {
347347
}
348348

349349
struct ChatTabContainer: View {
350-
let store: StoreOf<ChatPanelFeature>
350+
let store: StoreOf<ChatPanel>
351351
@Environment(\.chatTabPool) var chatTabPool
352352

353353
var body: some View {
@@ -406,8 +406,8 @@ struct ChatWindowView_Previews: PreviewProvider {
406406
"7": EmptyChatTab(id: "7"),
407407
])
408408

409-
static func createStore() -> StoreOf<ChatPanelFeature> {
410-
StoreOf<ChatPanelFeature>(
409+
static func createStore() -> StoreOf<ChatPanel> {
410+
StoreOf<ChatPanel>(
411411
initialState: .init(
412412
chatTabGroup: .init(
413413
tabInfo: [
@@ -422,7 +422,7 @@ struct ChatWindowView_Previews: PreviewProvider {
422422
),
423423
isPanelDisplayed: true
424424
),
425-
reducer: { ChatPanelFeature() }
425+
reducer: { ChatPanel() }
426426
)
427427
}
428428

Core/Sources/SuggestionWidget/FeatureReducers/ChatPanelFeature.swift renamed to Core/Sources/SuggestionWidget/FeatureReducers/ChatPanel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public struct ChatTabKind: Equatable {
2323
}
2424

2525
@Reducer
26-
public struct ChatPanelFeature {
26+
public struct ChatPanel {
2727
public struct ChatTabGroup: Equatable {
2828
public var tabInfo: IdentifiedArray<String, ChatTabInfo>
2929
public var tabCollection: [ChatTabBuilderCollection]

Core/Sources/SuggestionWidget/FeatureReducers/CircularWidgetFeature.swift renamed to Core/Sources/SuggestionWidget/FeatureReducers/CircularWidget.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SuggestionBasic
55
import SwiftUI
66

77
@Reducer
8-
public struct CircularWidgetFeature {
8+
public struct CircularWidget {
99
public struct IsProcessingCounter: Equatable {
1010
var expirationDate: TimeInterval
1111
}

Core/Sources/SuggestionWidget/FeatureReducers/PromptToCodeGroup.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import XcodeInspector
88
public struct PromptToCodeGroup {
99
@ObservableState
1010
public struct State: Equatable {
11-
public var promptToCodes: IdentifiedArrayOf<PromptToCode.State> = []
12-
public var activeDocumentURL: PromptToCode.State.ID? = XcodeInspector.shared
11+
public var promptToCodes: IdentifiedArrayOf<PromptToCodePanel.State> = []
12+
public var activeDocumentURL: PromptToCodePanel.State.ID? = XcodeInspector.shared
1313
.realtimeActiveDocumentURL
14-
public var activePromptToCode: PromptToCode.State? {
14+
public var activePromptToCode: PromptToCodePanel.State? {
1515
get {
1616
if let detached = promptToCodes.first(where: { !$0.isAttachedToSelectionRange }) {
1717
return detached
@@ -80,12 +80,12 @@ public struct PromptToCodeGroup {
8080
/// Activate the prompt to code if it exists or create it if it doesn't
8181
case activateOrCreatePromptToCode(PromptToCodeInitialState)
8282
case createPromptToCode(PromptToCodeInitialState)
83-
case updatePromptToCodeRange(id: PromptToCode.State.ID, range: CursorRange)
84-
case discardAcceptedPromptToCodeIfNotContinuous(id: PromptToCode.State.ID)
83+
case updatePromptToCodeRange(id: PromptToCodePanel.State.ID, range: CursorRange)
84+
case discardAcceptedPromptToCodeIfNotContinuous(id: PromptToCodePanel.State.ID)
8585
case updateActivePromptToCode(documentURL: URL)
8686
case discardExpiredPromptToCode(documentURLs: [URL])
87-
case promptToCode(PromptToCode.State.ID, PromptToCode.Action)
88-
case activePromptToCode(PromptToCode.Action)
87+
case promptToCode(PromptToCodePanel.State.ID, PromptToCodePanel.Action)
88+
case activePromptToCode(PromptToCodePanel.Action)
8989
}
9090

9191
@Dependency(\.promptToCodeServiceFactory) var promptToCodeServiceFactory
@@ -104,7 +104,7 @@ public struct PromptToCodeGroup {
104104
await send(.createPromptToCode(s))
105105
}
106106
case let .createPromptToCode(s):
107-
let newPromptToCode = PromptToCode.State(
107+
let newPromptToCode = PromptToCodePanel.State(
108108
code: s.code,
109109
prompt: s.defaultPrompt,
110110
language: s.language,
@@ -127,7 +127,7 @@ public struct PromptToCodeGroup {
127127
await send(.promptToCode(newPromptToCode.id, .modifyCodeButtonTapped))
128128
}
129129
}.cancellable(
130-
id: PromptToCode.CancellationKey.modifyCode(newPromptToCode.id),
130+
id: PromptToCodePanel.CancellationKey.modifyCode(newPromptToCode.id),
131131
cancelInFlight: true
132132
)
133133

@@ -159,11 +159,11 @@ public struct PromptToCodeGroup {
159159
}
160160
}
161161
.ifLet(\.activePromptToCode, action: \.activePromptToCode) {
162-
PromptToCode()
162+
PromptToCodePanel()
163163
.dependency(\.promptToCodeService, promptToCodeServiceFactory())
164164
}
165165
.forEach(\.promptToCodes, action: /Action.promptToCode, element: {
166-
PromptToCode()
166+
PromptToCodePanel()
167167
.dependency(\.promptToCodeService, promptToCodeServiceFactory())
168168
})
169169

Core/Sources/SuggestionWidget/FeatureReducers/PromptToCode.swift renamed to Core/Sources/SuggestionWidget/FeatureReducers/PromptToCodePanel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import PromptToCodeService
77
import SuggestionBasic
88

99
@Reducer
10-
public struct PromptToCode {
10+
public struct PromptToCodePanel {
1111
@ObservableState
1212
public struct State: Equatable, Identifiable {
1313
public indirect enum HistoryNode: Equatable {

Core/Sources/SuggestionWidget/FeatureReducers/SharedPanelFeature.swift renamed to Core/Sources/SuggestionWidget/FeatureReducers/SharedPanel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import Preferences
33
import SwiftUI
44

55
@Reducer
6-
public struct SharedPanelFeature {
6+
public struct SharedPanel {
77
public struct Content: Equatable {
88
public var promptToCodeGroup = PromptToCodeGroup.State()
99
var suggestion: PresentingCodeSuggestion?
10-
public var promptToCode: PromptToCode.State? { promptToCodeGroup.activePromptToCode }
10+
public var promptToCode: PromptToCodePanel.State? { promptToCodeGroup.activePromptToCode }
1111
var error: String?
1212
}
1313

Core/Sources/SuggestionWidget/FeatureReducers/SuggestionPanelFeature.swift renamed to Core/Sources/SuggestionWidget/FeatureReducers/SuggestionPanel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
import SwiftUI
44

55
@Reducer
6-
public struct SuggestionPanelFeature {
6+
public struct SuggestionPanel {
77
@ObservableState
88
public struct State: Equatable {
99
var content: PresentingCodeSuggestion?

Core/Sources/SuggestionWidget/FeatureReducers/WidgetFeature.swift renamed to Core/Sources/SuggestionWidget/FeatureReducers/Widget.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Toast
1010
import XcodeInspector
1111

1212
@Reducer
13-
public struct WidgetFeature {
13+
public struct Widget {
1414
public struct WindowState: Equatable {
1515
var alphaValue: Double = 0
1616
var frame: CGRect = .zero
@@ -30,21 +30,21 @@ public struct WidgetFeature {
3030

3131
// MARK: Panels
3232

33-
public var panelState = PanelFeature.State()
33+
public var panelState = WidgetPanel.State()
3434

3535
// MARK: ChatPanel
3636

37-
public var chatPanelState = ChatPanelFeature.State()
37+
public var chatPanelState = ChatPanel.State()
3838

3939
// MARK: CircularWidget
4040

4141
public struct CircularWidgetState: Equatable {
42-
var isProcessingCounters = [CircularWidgetFeature.IsProcessingCounter]()
42+
var isProcessingCounters = [CircularWidget.IsProcessingCounter]()
4343
var isProcessing: Bool = false
4444
}
4545

4646
public var circularWidgetState = CircularWidgetState()
47-
var _internalCircularWidgetState: CircularWidgetFeature.State {
47+
var _internalCircularWidgetState: CircularWidget.State {
4848
get {
4949
.init(
5050
isProcessingCounters: circularWidgetState.isProcessingCounters,
@@ -104,9 +104,9 @@ public struct WidgetFeature {
104104
case updateKeyWindow(WindowCanBecomeKey)
105105

106106
case toastPanel(ToastPanel.Action)
107-
case panel(PanelFeature.Action)
108-
case chatPanel(ChatPanelFeature.Action)
109-
case circularWidget(CircularWidgetFeature.Action)
107+
case panel(WidgetPanel.Action)
108+
case chatPanel(ChatPanel.Action)
109+
case circularWidget(CircularWidget.Action)
110110
}
111111

112112
var windowsController: WidgetWindowsController? {
@@ -132,7 +132,7 @@ public struct WidgetFeature {
132132
}
133133

134134
Scope(state: \._internalCircularWidgetState, action: \.circularWidget) {
135-
CircularWidgetFeature()
135+
CircularWidget()
136136
}
137137

138138
Reduce { state, action in
@@ -181,11 +181,11 @@ public struct WidgetFeature {
181181
}
182182

183183
Scope(state: \.panelState, action: \.panel) {
184-
PanelFeature()
184+
WidgetPanel()
185185
}
186186

187187
Scope(state: \.chatPanelState, action: \.chatPanel) {
188-
ChatPanelFeature()
188+
ChatPanel()
189189
}
190190

191191
Reduce { state, action in

0 commit comments

Comments
 (0)