Skip to content

Commit cee3f35

Browse files
committed
Merge branch 'release/0.28.3'
2 parents 8613f35 + 447cb12 commit cee3f35

20 files changed

Lines changed: 251 additions & 75 deletions

File tree

.github/workflows/close_inactive_issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
days-before-issue-stale: 30
1616
days-before-issue-close: 14
1717
stale-issue-label: "stale"
18-
exempt-issue-labels: "low priority, help wanted, planned"
18+
exempt-issue-labels: "low priority, help wanted, planned, investigating, blocked"
1919
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
2020
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
2121
days-before-pr-stale: -1

Core/Sources/ChatGPTChatTab/Chat.swift

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,26 @@ public struct DisplayedChatMessage: Equatable {
1414
}
1515

1616
public struct Reference: Equatable {
17+
public typealias Kind = ChatMessage.Reference.Kind
18+
1719
public var title: String
1820
public var subtitle: String
1921
public var uri: String
2022
public var startLine: Int?
21-
22-
public init(title: String, subtitle: String, uri: String, startLine: Int?) {
23+
public var kind: Kind
24+
25+
public init(
26+
title: String,
27+
subtitle: String,
28+
uri: String,
29+
startLine: Int?,
30+
kind: Kind
31+
) {
2332
self.title = title
2433
self.subtitle = subtitle
2534
self.uri = uri
2635
self.startLine = startLine
36+
self.kind = kind
2737
}
2838
}
2939

@@ -304,7 +314,8 @@ struct Chat: ReducerProtocol {
304314
title: $0.title,
305315
subtitle: $0.subTitle,
306316
uri: $0.uri,
307-
startLine: $0.startLine
317+
startLine: $0.startLine,
318+
kind: $0.kind
308319
)
309320
}
310321
)

Core/Sources/ChatGPTChatTab/ChatPanel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ struct ChatPanel_Preview: PreviewProvider {
440440
title: "Hello Hello Hello Hello",
441441
subtitle: "Hi Hi Hi Hi",
442442
uri: "https://google.com",
443-
startLine: nil
443+
startLine: nil,
444+
kind: .class
444445
),
445446
]
446447
),

Core/Sources/ChatGPTChatTab/Views/BotMessage.swift

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,20 @@ struct ReferenceList: View {
108108
chat.send(.referenceClicked(reference))
109109
}) {
110110
HStack(spacing: 8) {
111+
ReferenceIcon(kind: reference.kind)
112+
.layoutPriority(2)
111113
Text(reference.title)
112114
.truncationMode(.middle)
113115
.lineLimit(1)
116+
.layoutPriority(1)
114117
Text(reference.subtitle)
115118
.lineLimit(1)
116119
.truncationMode(.middle)
117-
.layoutPriority(/*@START_MENU_TOKEN@*/0/*@END_MENU_TOKEN@*/)
118120
.foregroundStyle(.tertiary)
121+
.layoutPriority(0)
119122
}
120-
.padding(.vertical, 6)
121-
.padding(.horizontal, 8)
123+
.padding(.vertical, 4)
124+
.padding(.horizontal, 4)
122125
.frame(maxWidth: .infinity, alignment: .leading)
123126
.overlay {
124127
RoundedRectangle(cornerRadius: 4)
@@ -134,6 +137,83 @@ struct ReferenceList: View {
134137
}
135138
}
136139

140+
struct ReferenceIcon: View {
141+
let kind: DisplayedChatMessage.Reference.Kind
142+
143+
var body: some View {
144+
RoundedRectangle(cornerRadius: 4)
145+
.fill({
146+
switch kind {
147+
case .class:
148+
Color.purple
149+
case .struct:
150+
Color.purple
151+
case .enum:
152+
Color.purple
153+
case .actor:
154+
Color.purple
155+
case .protocol:
156+
Color.purple
157+
case .extension:
158+
Color.indigo
159+
case .case:
160+
Color.green
161+
case .property:
162+
Color.teal
163+
case .typealias:
164+
Color.orange
165+
case .function:
166+
Color.teal
167+
case .method:
168+
Color.blue
169+
case .text:
170+
Color.gray
171+
case .webpage:
172+
Color.blue
173+
case .other:
174+
Color.gray
175+
}
176+
}())
177+
.frame(width: 22, height: 22)
178+
.overlay(alignment: .center) {
179+
Group {
180+
switch kind {
181+
case .class:
182+
Text("C")
183+
case .struct:
184+
Text("S")
185+
case .enum:
186+
Text("E")
187+
case .actor:
188+
Text("A")
189+
case .protocol:
190+
Text("Pr")
191+
case .extension:
192+
Text("Ex")
193+
case .case:
194+
Text("K")
195+
case .property:
196+
Text("P")
197+
case .typealias:
198+
Text("T")
199+
case .function:
200+
Text("𝑓")
201+
case .method:
202+
Text("M")
203+
case .text:
204+
Text("Tx")
205+
case .webpage:
206+
Text("Wb")
207+
case .other:
208+
Text("Ot")
209+
}
210+
}
211+
.font(.system(size: 12).monospaced())
212+
.foregroundColor(.white)
213+
}
214+
}
215+
}
216+
137217
#Preview("Bot Message") {
138218
BotMessage(
139219
id: "1",
@@ -147,7 +227,8 @@ struct ReferenceList: View {
147227
title: "ReferenceList",
148228
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
149229
uri: "https://google.com",
150-
startLine: nil
230+
startLine: nil,
231+
kind: .class
151232
), count: 20),
152233
chat: .init(initialState: .init(), reducer: Chat(service: .init()))
153234
)
@@ -161,37 +242,43 @@ struct ReferenceList: View {
161242
title: "ReferenceList",
162243
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
163244
uri: "https://google.com",
164-
startLine: nil
245+
startLine: nil,
246+
kind: .class
165247
),
166248
.init(
167249
title: "BotMessage.swift:100-102",
168250
subtitle: "/Core/Sources/ChatGPTChatTab/Views",
169251
uri: "https://google.com",
170-
startLine: nil
252+
startLine: nil,
253+
kind: .struct
171254
),
172255
.init(
173256
title: "ReferenceList",
174257
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
175258
uri: "https://google.com",
176-
startLine: nil
259+
startLine: nil,
260+
kind: .function
177261
),
178262
.init(
179263
title: "ReferenceList",
180264
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
181265
uri: "https://google.com",
182-
startLine: nil
266+
startLine: nil,
267+
kind: .case
183268
),
184269
.init(
185270
title: "ReferenceList",
186271
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
187272
uri: "https://google.com",
188-
startLine: nil
273+
startLine: nil,
274+
kind: .extension
189275
),
190276
.init(
191277
title: "ReferenceList",
192278
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
193279
uri: "https://google.com",
194-
startLine: nil
280+
startLine: nil,
281+
kind: .webpage
195282
),
196283
], chat: .init(initialState: .init(), reducer: Chat(service: .init())))
197284
}

Core/Sources/HostApp/DebugView.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ final class DebugSettings: ObservableObject {
1717
@AppStorage(\.useUserDefaultsBaseAPIKeychain) var useUserDefaultsBaseAPIKeychain
1818
@AppStorage(\.disableEnhancedWorkspace) var disableEnhancedWorkspace
1919
@AppStorage(\.disableGitIgnoreCheck) var disableGitIgnoreCheck
20+
@AppStorage(\.disableFileContentManipulationByCheatsheet)
21+
var disableFileContentManipulationByCheatsheet
2022
init() {}
2123
}
2224

@@ -60,19 +62,23 @@ struct DebugSettingsView: View {
6062
Toggle(isOn: $settings.useUserDefaultsBaseAPIKeychain) {
6163
Text("Store API keys in UserDefaults")
6264
}
63-
65+
6466
Toggle(isOn: $settings.disableEnhancedWorkspace) {
6567
Text("Disable enhanced workspace")
6668
}
67-
69+
6870
Toggle(isOn: $settings.disableGitIgnoreCheck) {
6971
Text("Disable git ignore check")
7072
}
71-
73+
74+
Toggle(isOn: $settings.disableFileContentManipulationByCheatsheet) {
75+
Text("Disable file content manipulation by cheatsheet")
76+
}
77+
7278
Button("Reset migration version to 0") {
7379
UserDefaults.shared.set(nil, forKey: "OldMigrationVersion")
7480
}
75-
81+
7682
Button("Reset 0.23.0 migration") {
7783
UserDefaults.shared.set("239", forKey: "OldMigrationVersion")
7884
UserDefaults.shared.set(nil, forKey: "MigrateTo240Finished")
@@ -92,4 +98,3 @@ struct DebugSettingsView_Preview: PreviewProvider {
9298
}
9399
}
94100

95-

Core/Sources/SuggestionWidget/FeatureReducers/PanelFeature.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public struct PanelFeature: ReducerProtocol {
111111

112112
case .removeDisplayedContent:
113113
state.content.error = nil
114-
state.content.promptToCodeGroup.activeDocumentURL = nil
115114
state.content.suggestion = nil
116115
return .none
117116

Core/Sources/SuggestionWidget/FeatureReducers/PromptToCodeGroup.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public struct PromptToCodeGroup: ReducerProtocol {
1919
return promptToCodes[id: id]
2020
}
2121
set {
22-
activeDocumentURL = newValue?.id
2322
if let id = newValue?.id {
2423
promptToCodes[id: id] = newValue
2524
}

0 commit comments

Comments
 (0)