Skip to content

Commit c8f9e0c

Browse files
committed
fix: update style for the tool call renderer
1 parent 35cdc73 commit c8f9e0c

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

custom/ToolRenderer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl p-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
3+
class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl px-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
44
@click="isInputOutputExpanded = !isInputOutputExpanded"
55
>
66
<div class="flex items-center gap-3">

custom/ToolsGroup.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<template v-for="group in props.toolGroup" :key="group.title">
33
<div v-if="group.groupedTools.length > 1" class="flex flex-col">
4-
<div class="flex items-center gap-2 p-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5-
<IconMinusOutline class="w-6 h-6 p-1"/>
4+
<div class="flex items-center gap-2 px-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5+
<IconCheckOutline class="w-6 h-6 p-1"/>
66
{{ group.title }} {{ 'x' + group.groupedTools.length }}
77
<IconAngleDownOutline
88
class="transition-transform duration-200 hover:scale-105 hover:opacity-75"
@@ -24,7 +24,7 @@
2424
import ToolRenderer from './ToolRenderer.vue';
2525
import type { IPart } from './types';
2626
import { ref } from 'vue';
27-
import { IconAngleDownOutline, IconMinusOutline } from '@iconify-prerendered/vue-flowbite';
27+
import { IconAngleDownOutline, IconCheckOutline } from '@iconify-prerendered/vue-flowbite';
2828
2929
const props = defineProps<{
3030
toolGroup: {

custom/composables/useAgentStore.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Chat } from '../chat';
77
import { DefaultChatTransport } from 'ai';
88
import { useCoreStore } from '@/stores/core';
99
import { useAgentTransitions } from './useAgentTransitions';
10+
import { useWindowSize } from '@vueuse/core';
1011

1112
type AgentMode = {
1213
name: string;
@@ -48,6 +49,7 @@ export const useAgentStore = defineStore('agent', () => {
4849
const availableModes = ref<AgentMode[]>([]);
4950
const activeModeName = ref<string | null>(null);
5051
const hasTypedMessageInPageSession = ref(false);
52+
const { width: windowWidth } = useWindowSize();
5153
let placeholderAnimationTimer: ReturnType<typeof setTimeout> | null = null;
5254

5355
function setLocalStorageItem(key: string, value: string) {
@@ -56,6 +58,11 @@ export const useAgentStore = defineStore('agent', () => {
5658
function getLocalStorageItem(key: string) {
5759
return window.localStorage.getItem(`${coreStore.config.brandName || 'adminforth'}-${key}`);
5860
}
61+
watch(windowWidth, (newWidth: number) => {
62+
if (isFullScreen.value) {
63+
setChatWidth(newWidth, false);
64+
}
65+
})
5966
watch(isTeleportedToBody, (newVal: boolean) => {
6067
setLocalStorageItem('isTeleportedToBody', newVal ? 'true' : 'false');
6168
})
@@ -85,7 +92,14 @@ export const useAgentStore = defineStore('agent', () => {
8592
if (chatWidthBeforeFullScreen) {
8693
chatWidth.value = chatWidthBeforeFullScreen;
8794
} else {
88-
chatWidth.value = parseInt(getLocalStorageItem('chatWidth') || DEFAULT_CHAT_WIDTH.toString(), 10);
95+
const savedChatWidth = parseInt(getLocalStorageItem('chatWidth') || '0', 10);
96+
if (savedChatWidth) {
97+
if (savedChatWidth > MAX_WIDTH || savedChatWidth < MIN_WIDTH) {
98+
chatWidth.value = DEFAULT_CHAT_WIDTH;
99+
} else {
100+
chatWidth.value = savedChatWidth;
101+
}
102+
}
89103
}
90104
isTeleportedToBody.value = getLocalStorageItem('isTeleportedToBody') === 'true';
91105
lastSessionId.value = getLocalStorageItem('lastSessionId');

0 commit comments

Comments
 (0)