Skip to content

Commit eebff15

Browse files
committed
Adjust the position of stop responding button
1 parent 946e4b6 commit eebff15

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

Core/Sources/ChatGPTChatTab/ChatPanel.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,10 @@ struct ChatPanelMessages: View {
5858

5959
ChatHistory(chat: chat)
6060
.listItemTint(.clear)
61-
61+
6262
WithViewStore(chat, observe: \.isReceivingMessage) { viewStore in
6363
if viewStore.state {
64-
StopRespondingButton(chat: chat)
65-
.padding(.vertical, 4)
66-
.listRowInsets(EdgeInsets(
67-
top: 0,
68-
leading: -8,
69-
bottom: 0,
70-
trailing: -8
71-
))
64+
Spacer(minLength: 12)
7265
}
7366
}
7467

@@ -110,6 +103,16 @@ struct ChatPanelMessages: View {
110103
scrollOffset = value
111104
updatePinningState()
112105
}
106+
.overlay(alignment: .bottom) {
107+
WithViewStore(chat, observe: \.isReceivingMessage) { viewStore in
108+
StopRespondingButton(chat: chat)
109+
.padding(.bottom, 8)
110+
.opacity(viewStore.state ? 1 : 0)
111+
.disabled(!viewStore.state)
112+
.transformEffect(.init(translationX: 0, y: viewStore.state ? 0 : 20))
113+
.animation(.easeInOut(duration: 0.2), value: viewStore.state)
114+
}
115+
}
113116
.overlay(alignment: .bottomTrailing) {
114117
WithViewStore(chat, observe: \.history.last) { viewStore in
115118
Button(action: {

0 commit comments

Comments
 (0)