fix(onboarding): restore bubbles and spacing
parent
cd77dc9563
commit
9076d543f3
|
|
@ -93,7 +93,7 @@ private struct ChatMessageBody: View {
|
||||||
if self.isUser {
|
if self.isUser {
|
||||||
fill = ClawdisChatTheme.userBubble
|
fill = ClawdisChatTheme.userBubble
|
||||||
} else if self.style == .onboarding {
|
} else if self.style == .onboarding {
|
||||||
fill = ClawdisChatTheme.card
|
fill = ClawdisChatTheme.onboardingAssistantBubble
|
||||||
} else {
|
} else {
|
||||||
fill = ClawdisChatTheme.assistantBubble
|
fill = ClawdisChatTheme.assistantBubble
|
||||||
}
|
}
|
||||||
|
|
@ -239,12 +239,16 @@ private struct MarkdownTextView: View {
|
||||||
let textColor: Color
|
let textColor: Color
|
||||||
|
|
||||||
var body: some View {
|
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)
|
Text(attributed)
|
||||||
.font(.system(size: 14))
|
.font(.system(size: 14))
|
||||||
.foregroundStyle(self.textColor)
|
.foregroundStyle(self.textColor)
|
||||||
} else {
|
} else {
|
||||||
Text(self.text)
|
Text(normalized)
|
||||||
.font(.system(size: 14))
|
.font(.system(size: 14))
|
||||||
.foregroundStyle(self.textColor)
|
.foregroundStyle(self.textColor)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,14 @@ enum ClawdisChatTheme {
|
||||||
#endif
|
#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 userText: Color { .white }
|
||||||
|
|
||||||
static var assistantText: Color {
|
static var assistantText: Color {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue