Skip to content

Commit 58ca513

Browse files
committed
refac
1 parent 308fa92 commit 58ca513

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

src/lib/components/chat/Messages/Markdown/ConsecutiveDetailsGroup.svelte

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,6 @@
107107
</script>
108108

109109
<div {id} class="w-full">
110-
{#if allEmbeds.length > 0}
111-
<!-- Embeds rendered directly above the collapsed group -->
112-
{#each allEmbeds as embedItem, idx}
113-
<div id={`${id}-embed-${idx}`}>
114-
<FullHeightIframe
115-
src={embedItem.embed}
116-
args={embedItem.args}
117-
allowScripts={true}
118-
allowForms={$settings?.iframeSandboxAllowForms ?? false}
119-
allowSameOrigin={$settings?.iframeSandboxAllowSameOrigin ?? false}
120-
allowPopups={true}
121-
/>
122-
</div>
123-
{/each}
124-
{/if}
125-
126110
<!-- svelte-ignore a11y-no-static-element-interactions -->
127111
<button
128112
class="w-fit text-left text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition cursor-pointer"
@@ -176,4 +160,19 @@
176160
</div>
177161
</div>
178162
{/if}
163+
164+
{#if allEmbeds.length > 0}
165+
{#each allEmbeds as embedItem, idx}
166+
<div id={`${id}-embed-${idx}`}>
167+
<FullHeightIframe
168+
src={embedItem.embed}
169+
args={embedItem.args}
170+
allowScripts={true}
171+
allowForms={$settings?.iframeSandboxAllowForms ?? false}
172+
allowSameOrigin={$settings?.iframeSandboxAllowSameOrigin ?? false}
173+
allowPopups={true}
174+
/>
175+
</div>
176+
{/each}
177+
{/if}
179178
</div>

src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@
380380
<ToolCallDisplay
381381
id={`${id}-${tokenIdx}-${detailIdx}-tc`}
382382
attributes={detailToken.attributes}
383+
grouped={true}
383384
open={false}
384385
className="w-full space-y-1"
385386
/>

src/lib/components/common/ToolCallDisplay.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
} = {};
3232
3333
export let open = false;
34+
export let grouped = false;
3435
export let className = '';
3536
3637
const RESULT_PREVIEW_LIMIT = 10000;
@@ -87,7 +88,7 @@
8788
</script>
8889

8990
<div {id} class={className}>
90-
{#if embeds && Array.isArray(embeds) && embeds.length > 0}
91+
{#if !grouped && embeds && Array.isArray(embeds) && embeds.length > 0}
9192
<!-- Embed Mode: Show iframes without collapsible behavior -->
9293
<div class="py-1 w-full cursor-pointer">
9394
<div class="w-full text-xs text-gray-500">

0 commit comments

Comments
 (0)