feat(onboarding): hide kickoff bubble and tweak typing
parent
09d2165d36
commit
52a2dfe08b
|
|
@ -120,15 +120,20 @@ private struct AttachmentRow: View {
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
struct ChatTypingIndicatorBubble: View {
|
struct ChatTypingIndicatorBubble: View {
|
||||||
|
let style: ClawdisChatView.Style
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 10) {
|
HStack(spacing: 10) {
|
||||||
TypingDots()
|
TypingDots()
|
||||||
Text("Clawd is thinking…")
|
if self.style == .standard {
|
||||||
.font(.subheadline)
|
Text("Clawd is thinking…")
|
||||||
.foregroundStyle(.secondary)
|
.font(.subheadline)
|
||||||
Spacer()
|
.foregroundStyle(.secondary)
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding(12)
|
.padding(.vertical, self.style == .standard ? 12 : 10)
|
||||||
|
.padding(.horizontal, self.style == .standard ? 12 : 14)
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 16, style: .continuous)
|
RoundedRectangle(cornerRadius: 16, style: .continuous)
|
||||||
.fill(ClawdisChatTheme.assistantBubble))
|
.fill(ClawdisChatTheme.assistantBubble))
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public struct ClawdisChatView: View {
|
||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(spacing: Layout.messageSpacing) {
|
LazyVStack(spacing: Layout.messageSpacing) {
|
||||||
ForEach(self.viewModel.messages) { msg in
|
ForEach(self.visibleMessages) { msg in
|
||||||
ChatMessageBubble(message: msg)
|
ChatMessageBubble(message: msg)
|
||||||
.frame(
|
.frame(
|
||||||
maxWidth: .infinity,
|
maxWidth: .infinity,
|
||||||
|
|
@ -77,7 +77,7 @@ public struct ClawdisChatView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.viewModel.pendingRunCount > 0 {
|
if self.viewModel.pendingRunCount > 0 {
|
||||||
ChatTypingIndicatorBubble()
|
ChatTypingIndicatorBubble(style: self.style)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,4 +111,11 @@ public struct ClawdisChatView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var visibleMessages: [ClawdisChatMessage] {
|
||||||
|
guard self.style == .onboarding else { return self.viewModel.messages }
|
||||||
|
guard let first = self.viewModel.messages.first else { return [] }
|
||||||
|
guard first.role.lowercased() == "user" else { return self.viewModel.messages }
|
||||||
|
return Array(self.viewModel.messages.dropFirst())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue