mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
fix(chat): improve thinking segment display and message bubble rendering
This commit is contained in:
parent
aa09345403
commit
e662cce91a
@ -132,7 +132,7 @@
|
||||
<!-- 停止指示器 -->
|
||||
<div v-if="status === 'stopped' || status === 'interrupted'" class="stopped-indicator">
|
||||
<el-icon><CloseBold /></el-icon>
|
||||
<span>{{ status === 'interrupted' ? ($t('chat.interrupted') || '已中断') : $t('chat.stopped') }}</span>
|
||||
<span>{{ status === 'interrupted' ? $t('chat.interrupted') : $t('chat.stopped') }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 错误卡片 -->
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { Opportunity, ArrowDown } from '@element-plus/icons-vue'
|
||||
import { useMarkdownRenderer } from '@/composables/useMarkdownRenderer'
|
||||
import type { MessageSegment } from '@/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps<{
|
||||
segment: MessageSegment
|
||||
}>()
|
||||
@ -22,7 +25,7 @@ watch(() => props.segment.status, (val) => {
|
||||
const lengthHint = computed(() => {
|
||||
const len = props.segment.thinkingText?.length || 0
|
||||
if (len < 100) return ''
|
||||
return len < 1000 ? `${len} 字` : `${(len / 1000).toFixed(1)}k 字`
|
||||
return len < 1000 ? `${len} chars` : `${(len / 1000).toFixed(1)}k chars`
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -32,7 +35,7 @@ const lengthHint = computed(() => {
|
||||
<span class="seg-thinking__icon">
|
||||
<el-icon :class="{ 'is-loading': isRunning }" :size="14"><Opportunity /></el-icon>
|
||||
</span>
|
||||
<span class="seg-thinking__label">{{ isRunning ? '思考中...' : '深度思考' }}</span>
|
||||
<span class="seg-thinking__label">{{ isRunning ? t('chat.thinkingInProgress') : t('chat.thinking') }}</span>
|
||||
<span v-if="lengthHint" class="seg-thinking__hint">{{ lengthHint }}</span>
|
||||
<el-icon class="seg-thinking__arrow" :class="{ 'is-open': expanded }" :size="12"><ArrowDown /></el-icon>
|
||||
</div>
|
||||
|
||||
@ -40,7 +40,9 @@ export default {
|
||||
error: 'Disconnected',
|
||||
},
|
||||
thinking: 'Thinking',
|
||||
thinkingInProgress: 'Thinking...',
|
||||
stopped: 'Generation stopped',
|
||||
interrupted: 'Interrupted',
|
||||
failed: 'Generation failed',
|
||||
retry: 'Retry',
|
||||
errorCode: 'Error code',
|
||||
|
||||
@ -40,7 +40,9 @@ export default {
|
||||
error: '连接断开',
|
||||
},
|
||||
thinking: '深度思考',
|
||||
thinkingInProgress: '思考中...',
|
||||
stopped: '已停止生成',
|
||||
interrupted: '已中断',
|
||||
failed: '生成失败',
|
||||
retry: '重试',
|
||||
errorCode: '错误码',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user