fix(onboarding): restore bubbles and spacing
parent
cd77dc9563
commit
9076d543f3
|
|
@ -93,7 +93,7 @@ private struct ChatMessageBody: View {
|
|||
if self.isUser {
|
||||
fill = ClawdisChatTheme.userBubble
|
||||
} else if self.style == .onboarding {
|
||||
fill = ClawdisChatTheme.card
|
||||
fill = ClawdisChatTheme.onboardingAssistantBubble
|
||||
} else {
|
||||
fill = ClawdisChatTheme.assistantBubble
|
||||
}
|
||||
|
|
@ -239,12 +239,16 @@ private struct MarkdownTextView: View {
|
|||
let textColor: Color
|
||||
|
||||
var body: some View {
|
||||
if let attributed = try? AttributedString(markdown: self.text) {
|
||||
let normalized = self.text.replacingOccurrences(
|
||||
of: "(?<!\\n)\\n(?!\\n)",
|
||||
with: " \\n",
|
||||
options: .regularExpression)
|
||||
if let attributed = try? AttributedString(markdown: normalized) {
|
||||
Text(attributed)
|
||||
.font(.system(size: 14))
|
||||
.foregroundStyle(self.textColor)
|
||||
} else {
|
||||
Text(self.text)
|
||||
Text(normalized)
|
||||
.font(.system(size: 14))
|
||||
.foregroundStyle(self.textColor)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,14 @@ enum ClawdisChatTheme {
|
|||
#endif
|
||||
}
|
||||
|
||||
static var onboardingAssistantBubble: Color {
|
||||
#if os(macOS)
|
||||
Color(nsColor: .controlBackgroundColor).opacity(0.92)
|
||||
#else
|
||||
Color(uiColor: .secondarySystemBackground)
|
||||
#endif
|
||||
}
|
||||
|
||||
static var userText: Color { .white }
|
||||
|
||||
static var assistantText: Color {
|
||||
|
|
|
|||
Loading…
Reference in New Issue