From ee866081953eeeb15aeca43f897e0fa78729e7fb Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Wed, 22 Apr 2026 17:23:51 +0800 Subject: [PATCH] fix(stage-ui): overflow chat bubble --- .../scenarios/chat/components/error-item.vue | 4 +++- .../chat/components/history.story.vue | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/stage-ui/src/components/scenarios/chat/components/error-item.vue b/packages/stage-ui/src/components/scenarios/chat/components/error-item.vue index c4609244b..07f7707a0 100644 --- a/packages/stage-ui/src/components/scenarios/chat/components/error-item.vue +++ b/packages/stage-ui/src/components/scenarios/chat/components/error-item.vue @@ -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 diff --git a/packages/stage-ui/src/components/scenarios/chat/components/history.story.vue b/packages/stage-ui/src/components/scenarios/chat/components/history.story.vue index 312876c05..85c6ced7a 100644 --- a/packages/stage-ui/src/components/scenarios/chat/components/history.story.vue +++ b/packages/stage-ui/src/components/scenarios/chat/components/history.story.vue @@ -104,6 +104,17 @@ const errorMessages = ref([ }, ]) +const errorOverflowMessages = ref([ + { + 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({ role: 'assistant', content: '', @@ -196,6 +207,18 @@ const streamingMessage = ref({ + +
+ +
+
+