fix(onboarding): restore chat bubble styling
parent
9ccf80848d
commit
cd77dc9563
|
|
@ -1134,7 +1134,7 @@ struct OnboardingView: View {
|
||||||
.buttonStyle(.borderedProminent)
|
.buttonStyle(.borderedProminent)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 28)
|
.padding(.horizontal, 28)
|
||||||
.padding(.bottom, 36)
|
.padding(.bottom, 16)
|
||||||
.frame(minHeight: 60)
|
.frame(minHeight: 60)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,10 @@ private enum ChatUIConstants {
|
||||||
@MainActor
|
@MainActor
|
||||||
struct ChatMessageBubble: View {
|
struct ChatMessageBubble: View {
|
||||||
let message: ClawdisChatMessage
|
let message: ClawdisChatMessage
|
||||||
|
let style: ClawdisChatView.Style
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ChatMessageBody(message: self.message, isUser: self.isUser)
|
ChatMessageBody(message: self.message, isUser: self.isUser, style: self.style)
|
||||||
.frame(maxWidth: ChatUIConstants.bubbleMaxWidth, alignment: self.isUser ? .trailing : .leading)
|
.frame(maxWidth: ChatUIConstants.bubbleMaxWidth, alignment: self.isUser ? .trailing : .leading)
|
||||||
.frame(maxWidth: .infinity, alignment: self.isUser ? .trailing : .leading)
|
.frame(maxWidth: .infinity, alignment: self.isUser ? .trailing : .leading)
|
||||||
.padding(.horizontal, 2)
|
.padding(.horizontal, 2)
|
||||||
|
|
@ -24,6 +25,7 @@ struct ChatMessageBubble: View {
|
||||||
private struct ChatMessageBody: View {
|
private struct ChatMessageBody: View {
|
||||||
let message: ClawdisChatMessage
|
let message: ClawdisChatMessage
|
||||||
let isUser: Bool
|
let isUser: Bool
|
||||||
|
let style: ClawdisChatView.Style
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
let text = self.primaryText
|
let text = self.primaryText
|
||||||
|
|
@ -87,7 +89,14 @@ private struct ChatMessageBody: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private var bubbleBackground: AnyShapeStyle {
|
private var bubbleBackground: AnyShapeStyle {
|
||||||
let fill = self.isUser ? ClawdisChatTheme.userBubble : ClawdisChatTheme.assistantBubble
|
let fill: Color
|
||||||
|
if self.isUser {
|
||||||
|
fill = ClawdisChatTheme.userBubble
|
||||||
|
} else if self.style == .onboarding {
|
||||||
|
fill = ClawdisChatTheme.card
|
||||||
|
} else {
|
||||||
|
fill = ClawdisChatTheme.assistantBubble
|
||||||
|
}
|
||||||
return AnyShapeStyle(fill)
|
return AnyShapeStyle(fill)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public struct ClawdisChatView: View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(spacing: Layout.messageSpacing) {
|
LazyVStack(spacing: Layout.messageSpacing) {
|
||||||
ForEach(self.visibleMessages) { msg in
|
ForEach(self.visibleMessages) { msg in
|
||||||
ChatMessageBubble(message: msg)
|
ChatMessageBubble(message: msg, style: self.style)
|
||||||
.frame(
|
.frame(
|
||||||
maxWidth: .infinity,
|
maxWidth: .infinity,
|
||||||
alignment: msg.role.lowercased() == "user" ? .trailing : .leading)
|
alignment: msg.role.lowercased() == "user" ? .trailing : .leading)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue