Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.2.0] 쿠링봇 1차 QA 수정 #226

Merged
merged 4 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package-kuring/Sources/UIKit/BotUI/BotView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public struct BotView: View {
isPopoverVisible.toggle()
} label: {
Image("icon_info_circle", bundle: Bundle.bots)
.renderingMode(.template)
.foregroundStyle(Color.Kuring.gray200)
}
.popover(isPresented: $isPopoverVisible, arrowEdge: .top) {
popoverContent
Expand Down Expand Up @@ -112,6 +114,7 @@ public struct BotView: View {
private var inputView: some View {
HStack(alignment: .bottom, spacing: 12) {
TextField("질문을 입력해주세요", text: $tempInputText, axis: .vertical)
.font(.system(size: 15, weight: .medium))
.lineLimit(5)
.focused($isInputFocused)
.padding(.horizontal)
Expand Down
28 changes: 19 additions & 9 deletions package-kuring/Sources/UIKit/BotUI/ChatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,26 @@ struct ChatView: View {
@Query(FetchDescriptor<ChatInfo>()) var chatQuery: [ChatInfo]

var body: some View {
ScrollView {
VStack(alignment: .center, spacing: 16) {
ForEach(store.chatHistory) { chat in
chatRow(for: chat)
if chat.type == .answer {
/// 질문 가능 횟수
possibleCountText(for: calculateSendCount(for: chat.index))
ScrollViewReader { proxy in
ScrollView {
LazyVStack(alignment: .center, spacing: 16) {
ForEach(store.chatHistory) { chat in
chatRow(for: chat)
if chat.type == .answer {
possibleCountText(for: calculateSendCount(for: chat.index))
.id(chat.index)
}
}
Spacer()
}
.padding(.bottom, 5)
}
.onChange(of: store.chatHistory) { _, value in
withAnimation {
proxy.scrollTo(value.last?.index, anchor: .center)

}
Spacer()
}
.padding(.bottom, 5)
}
.onChange(of: self.chatQuery, initial: true) { _, newValue in
store.send(.queryChanged(newValue))
Expand Down Expand Up @@ -70,6 +78,8 @@ struct ChatView: View {
let maxWidth = UIScreen.main.bounds.width * 0.7

return Text(message.text)
.font(.system(size: 15, weight: .medium))
.textSelection(.enabled)
.padding()
.background(message.type == .question
? Color.Kuring.gray100 : Color.Kuring.primarySelected)
Expand Down