|
@@ -81,7 +81,6 @@ const pinnedToBottom = ref(true)
|
|
|
const showJump = ref(false)
|
|
const showJump = ref(false)
|
|
|
const copiedMessageId = ref('')
|
|
const copiedMessageId = ref('')
|
|
|
const copyFailedMessageId = ref('')
|
|
const copyFailedMessageId = ref('')
|
|
|
-const thinkingElapsedMs = ref(0)
|
|
|
|
|
// Like OpenMausBot, mount the tail first and explicitly expand older content.
|
|
// Like OpenMausBot, mount the tail first and explicitly expand older content.
|
|
|
const windowStart = ref(0)
|
|
const windowStart = ref(0)
|
|
|
const windowSize = 120
|
|
const windowSize = 120
|
|
@@ -145,8 +144,6 @@ const thinkingAvatar = computed(() => {
|
|
|
return profile ? props.agentAvatars[profile] || '' : ''
|
|
return profile ? props.agentAvatars[profile] || '' : ''
|
|
|
})
|
|
})
|
|
|
let copyResetTimer: number | undefined
|
|
let copyResetTimer: number | undefined
|
|
|
-let thinkingTimer: number | undefined
|
|
|
|
|
-let thinkingStartedAt = 0
|
|
|
|
|
|
|
|
|
|
const formatTime = formatMessageTime
|
|
const formatTime = formatMessageTime
|
|
|
|
|
|
|
@@ -265,11 +262,6 @@ function deliveryLabel(status?: UiMessage['status']): string {
|
|
|
} as Partial<Record<NonNullable<UiMessage['status']>, string>>)[status || 'settled'] || ''
|
|
} as Partial<Record<NonNullable<UiMessage['status']>, string>>)[status || 'settled'] || ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function formatThinkingElapsed(value: number): string {
|
|
|
|
|
- const seconds = Math.max(0, Math.floor(value / 1000))
|
|
|
|
|
- return `${seconds} 秒`
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
watch(() => props.messages.length, async () => {
|
|
watch(() => props.messages.length, async () => {
|
|
|
if (!pinnedToBottom.value) return
|
|
if (!pinnedToBottom.value) return
|
|
|
await nextTick()
|
|
await nextTick()
|
|
@@ -282,17 +274,6 @@ watch(() => props.messages.at(-1)?.content, async () => {
|
|
|
scheduleFollow()
|
|
scheduleFollow()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-watch(showThinkingIndicator, visible => {
|
|
|
|
|
- if (thinkingTimer !== undefined) window.clearInterval(thinkingTimer)
|
|
|
|
|
- thinkingTimer = undefined
|
|
|
|
|
- if (!visible) {
|
|
|
|
|
- thinkingElapsedMs.value = 0
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- thinkingStartedAt = Date.now()
|
|
|
|
|
- thinkingTimer = window.setInterval(() => { thinkingElapsedMs.value = Date.now() - thinkingStartedAt }, 250)
|
|
|
|
|
-}, { immediate: true })
|
|
|
|
|
-
|
|
|
|
|
onMounted(() => nextTick(() => {
|
|
onMounted(() => nextTick(() => {
|
|
|
scheduleFollow()
|
|
scheduleFollow()
|
|
|
transcriptObserver = new ResizeObserver(scheduleFollow)
|
|
transcriptObserver = new ResizeObserver(scheduleFollow)
|
|
@@ -307,7 +288,6 @@ onBeforeUnmount(() => {
|
|
|
transcriptObserver?.disconnect()
|
|
transcriptObserver?.disconnect()
|
|
|
if (followFrame !== undefined) cancelAnimationFrame(followFrame)
|
|
if (followFrame !== undefined) cancelAnimationFrame(followFrame)
|
|
|
if (copyResetTimer !== undefined) window.clearTimeout(copyResetTimer)
|
|
if (copyResetTimer !== undefined) window.clearTimeout(copyResetTimer)
|
|
|
- if (thinkingTimer !== undefined) window.clearInterval(thinkingTimer)
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
defineExpose({ scrollToMessage, scrollToAnchor, scrollToBottom, isFollowingBottom: () => pinnedToBottom.value })
|
|
defineExpose({ scrollToMessage, scrollToAnchor, scrollToBottom, isFollowingBottom: () => pinnedToBottom.value })
|
|
@@ -483,7 +463,6 @@ defineExpose({ scrollToMessage, scrollToAnchor, scrollToBottom, isFollowingBotto
|
|
|
v-if="showThinkingIndicator"
|
|
v-if="showThinkingIndicator"
|
|
|
:avatar-name="thinkingAvatarName"
|
|
:avatar-name="thinkingAvatarName"
|
|
|
:avatar="thinkingAvatar"
|
|
:avatar="thinkingAvatar"
|
|
|
- :elapsed-label="formatThinkingElapsed(thinkingElapsedMs)"
|
|
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<WorkspaceApprovalCard v-if="interaction?.kind === 'approval'" :prompt="interaction.prompt" :agent-name="approvalAgentName" :busy="interactionBusy" :error="interactionError" @choose="emit('approvalChoice', $event)" />
|
|
<WorkspaceApprovalCard v-if="interaction?.kind === 'approval'" :prompt="interaction.prompt" :agent-name="approvalAgentName" :busy="interactionBusy" :error="interactionError" @choose="emit('approvalChoice', $event)" />
|