File tree Expand file tree Collapse file tree
src/routes/chat/[agentId]/[conversationId] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 214214 let isHandlingQueue = $state (false );
215215 let isStopStreamClicked = $state (false );
216216
217- // let loadEditor = $derived(! isSendingMsg && ! isThinking && loadTextEditor && messageQueue.length === 0);
217+ let isWaiting = $derived (isSendingMsg || isThinking || messageQueue .length > 0 );
218218 let loadEditor = true ;
219219 let disableAction = $derived (! ADMIN_ROLES .includes (currentUser? .role || ' ' )
220220 && currentUser? .id !== conversationUser? .id
221221 || ! AgentExtensions .chatable (agent));
222222
223223 $effect (() => {
224- if (loadEditor ) {
224+ if (! isWaiting && ! disableAction ) {
225225 focusChatTextArea ();
226226 }
227227 });
280280 handleChatAction (e);
281281 }
282282 });
283-
284- await focusChatTextArea ();
285283 });
286284
287285 function handleLogoutAction () {
Original file line number Diff line number Diff line change 11<script >
2+ import { getContext } from ' svelte' ;
23 import collapse from ' svelte-collapse' ;
34
5+ const collapseDuration = 0.3 ;
6+ const { autoScrollToBottom } = getContext (' chat-window-context' );
7+
48 /**
59 * @type {{
610 * url?: string,
1822
1923 function toggleCollapse () {
2024 open = ! open;
25+ if (open) {
26+ setTimeout (() => autoScrollToBottom? .(), collapseDuration * 1000 );
27+ }
2128 }
2229< / script>
2330
3138 < i class = " bx bx-link-external" >< / i>
3239 < / a>
3340 < / div>
34- <div use:collapse ={{ open , duration : 0.3 , easing : ' ease' }} style =" width: 100%; margin-top: 8px;" >
41+ < div use: collapse= {{ open, duration: collapseDuration, easing: ' ease' }} style= " width: 100%; margin-top: 8px;" >
42+ {#if open}
3543 < div class = " rc-embedding-container" >
3644 {#if htmlTag === ' iframe' }
3745 < iframe
46+ class = " rc-embedding-iframe"
3847 src= {url}
3948 title= {title || ' ' }
4049 frameborder= " 0"
4150 allowfullscreen
51+ referrerpolicy= " no-referrer"
4252 sandbox= " allow-scripts allow-same-origin allow-popups allow-forms"
43- class =" rc-embedding-iframe"
4453 >< / iframe>
4554 {/ if }
4655 < / div>
56+ {/ if }
4757 < / div>
4858 < / div>
4959{/ if }
You can’t perform that action at this time.
0 commit comments