Skip to content

Commit 8e32d13

Browse files
committed
Add missing WithPerceptionTracking
1 parent 8f71a6e commit 8e32d13

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

Core/Sources/ChatGPTChatTab/ChatPanel.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,7 @@ struct ChatPanelMessages: View {
226226
let scrollToBottom: () -> Void
227227

228228
@State var isInitialLoad = true
229-
230-
struct PinToBottomRelatedState: Equatable {
231-
var isReceivingMessage: Bool
232-
var lastMessage: DisplayedChatMessage?
233-
}
234-
229+
235230
var body: some View {
236231
WithPerceptionTracking {
237232
EmptyView()

Core/Sources/ChatGPTChatTab/Views/BotMessage.swift

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -89,41 +89,45 @@ struct ReferenceList: View {
8989
let chat: StoreOf<Chat>
9090

9191
var body: some View {
92-
ScrollView {
93-
VStack(alignment: .leading, spacing: 8) {
94-
ForEach(0..<references.endIndex, id: \.self) { index in
95-
let reference = references[index]
92+
WithPerceptionTracking {
93+
ScrollView {
94+
VStack(alignment: .leading, spacing: 8) {
95+
ForEach(0..<references.endIndex, id: \.self) { index in
96+
WithPerceptionTracking {
97+
let reference = references[index]
9698

97-
Button(action: {
98-
chat.send(.referenceClicked(reference))
99-
}) {
100-
HStack(spacing: 8) {
101-
ReferenceIcon(kind: reference.kind)
102-
.layoutPriority(2)
103-
Text(reference.title)
104-
.truncationMode(.middle)
105-
.lineLimit(1)
106-
.layoutPriority(1)
107-
Text(reference.subtitle)
108-
.lineLimit(1)
109-
.truncationMode(.middle)
110-
.foregroundStyle(.tertiary)
111-
.layoutPriority(0)
112-
}
113-
.padding(.vertical, 4)
114-
.padding(.horizontal, 4)
115-
.frame(maxWidth: .infinity, alignment: .leading)
116-
.overlay {
117-
RoundedRectangle(cornerRadius: 4)
118-
.stroke(Color(nsColor: .separatorColor), lineWidth: 1)
99+
Button(action: {
100+
chat.send(.referenceClicked(reference))
101+
}) {
102+
HStack(spacing: 8) {
103+
ReferenceIcon(kind: reference.kind)
104+
.layoutPriority(2)
105+
Text(reference.title)
106+
.truncationMode(.middle)
107+
.lineLimit(1)
108+
.layoutPriority(1)
109+
Text(reference.subtitle)
110+
.lineLimit(1)
111+
.truncationMode(.middle)
112+
.foregroundStyle(.tertiary)
113+
.layoutPriority(0)
114+
}
115+
.padding(.vertical, 4)
116+
.padding(.horizontal, 4)
117+
.frame(maxWidth: .infinity, alignment: .leading)
118+
.overlay {
119+
RoundedRectangle(cornerRadius: 4)
120+
.stroke(Color(nsColor: .separatorColor), lineWidth: 1)
121+
}
122+
}
123+
.buttonStyle(.plain)
119124
}
120125
}
121-
.buttonStyle(.plain)
122126
}
127+
.padding()
123128
}
124-
.padding()
129+
.frame(maxWidth: 500, maxHeight: 500)
125130
}
126-
.frame(maxWidth: 500, maxHeight: 500)
127131
}
128132
}
129133

0 commit comments

Comments
 (0)