Skip to content

Commit b608637

Browse files
committed
fix: correct max-width of tool call container, when tool was called with collapsed reasoning container
AdminForth/1642/(
1 parent f075250 commit b608637

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

custom/conversation_area/ProcessingTimeline.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
</p>
1919

2020
<span v-if="thinkingDuration > 0">({{ (thinkingDuration/1000).toFixed(2) }} s)</span>
21-
<!-- <ThreeDotsAnimation v-if="inProgress" /> -->
2221
<IconAngleDownOutline
2322
v-if="ToolOrReasoningParts.length > 0"
2423
:class="isExpanded ? 'rotate-180' : 'rotate-0'"
@@ -41,7 +40,7 @@
4140
<ol class="ml-8 my-2 relative border-l border-l-2 border-black border-default border-listTableHeadingText dark:border-darkListTableHeadingText">
4241
<template v-for="(part, index) in ToolOrReasoningParts" :key="index">
4342
<ReasoningRenderer v-if="part.type === 'reasoning'" :state="part.state" :text="part.text" />
44-
<ToolsGroup v-else-if="part.type==='data-tool-call'" :toolGroup="groupToolCallParts(message, part)" />
43+
<ToolsGroup v-else-if="part.type==='data-tool-call'" :toolGroup="groupToolCallParts(message, part)" :isExpanded="isExpanded" />
4544
<li v-else-if="part.type === 'data-rendering'" class="mb-6 mx-2 mt-2 px-2 z-50 overflow-hidden">
4645
<span class="bg-lightNavbar dark:bg-darkNavbar absolute flex items-center text-listTableHeadingText dark:text-darkListTableHeadingText justify-center w-5 h-5 rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar">
4746
<div class="w-2 h-2 rounded-full bg-current animate-pulse"></div>

custom/conversation_area/ToolRenderer.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</template>
6060

6161
<script setup lang="ts">
62-
import { computed, ref, watch, onMounted } from 'vue';
62+
import { computed, ref, watch, onMounted, nextTick } from 'vue';
6363
import { type IFormattedToolCallPart } from '../types';
6464
import { Spinner } from '@/afcl';
6565
import { IconAngleDownOutline, IconCheckOutline, IconCloseOutline } from '@iconify-prerendered/vue-flowbite';
@@ -109,7 +109,8 @@
109109
});
110110
const hasToolSections = computed(() => toolSections.value.length > 0);
111111
112-
onMounted(() => {
112+
onMounted(async () => {
113+
await nextTick();
113114
if (toolRendererRef.value && props.data.toolInfo) {
114115
toolRendererInitialWidth.value = toolRendererRef.value.offsetWidth;
115116
}

custom/conversation_area/ToolsGroup.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
</h3>
1414
<div class="flex flex-wrap">
1515
<template v-for="group in props.toolGroup" :key="group.title">
16-
<ToolRenderer
16+
<ToolRenderer
17+
v-if="isExpanded"
1718
v-for="part in group.groupedTools"
1819
:key="part.toolInfo.toolCallId"
1920
:data="part"
@@ -31,6 +32,7 @@ import { IconWrenchSolid } from '@iconify-prerendered/vue-heroicons';
3132
3233
const props = defineProps<{
3334
toolGroup: IToolGroup[]
35+
isExpanded: boolean
3436
}>();
3537
3638
</script>

0 commit comments

Comments
 (0)