fix(stage-ui): overflow chat bubble

This commit is contained in:
Neko Ayaka
2026-04-23 01:09:45 +08:00
parent 567fd6666e
commit ee86608195
2 changed files with 26 additions and 1 deletions
@@ -24,6 +24,8 @@ const emit = defineEmits<{
}>()
const boxClasses = computed(() => [
'min-w-0',
'max-w-full',
props.variant === 'mobile' ? 'px-2 py-2 text-sm' : 'px-3 py-3',
])
const copyText = computed(() => getChatHistoryItemCopyText(props.message as ChatHistoryItem))
@@ -58,7 +60,7 @@ const copyText = computed(() => getChatHistoryItemCopyText(props.message as Chat
<MarkdownRenderer
v-else
:content="message.content"
class="break-words text-violet-500 dark:text-violet-300"
class="whitespace-pre-wrap break-all text-violet-500 dark:text-violet-300"
/>
</div>
</template>
@@ -104,6 +104,17 @@ const errorMessages = ref<ChatHistoryItem[]>([
},
])
const errorOverflowMessages = ref<ChatHistoryItem[]>([
{
role: 'user',
content: 'Retry the provider call and tell me exactly what failed.',
},
{
role: 'error',
content: 'Remote sent 400 response: {"error":{"message":"This model is not available in your region.","type":"invalid_request_error","param":"model","code":"region_not_supported"},"request_id":"req_01K8F0R7X1W2Y3Z4A5B6C7D8E9","endpoint":"https://api.example.invalid/v1/chat/completions","provider":"openai-compatible"}',
},
])
const streamingMessage = ref<ChatAssistantMessage>({
role: 'assistant',
content: '',
@@ -196,6 +207,18 @@ const streamingMessage = ref<ChatAssistantMessage>({
</div>
</Variant>
<Variant
id="error-overflow"
title="Error (Overflow)"
>
<div :class="['font-cute', 'w-72', 'max-w-full']">
<ChatHistory
:messages="errorOverflowMessages"
variant="mobile"
/>
</div>
</Variant>
<Variant
id="scroll-visualizer"
title="Scroll Visualizer"