|
108 | 108 |
|
109 | 109 | <div {id} class="w-full"> |
110 | 110 | {#if allEmbeds.length > 0} |
111 | | - <!-- Embed mode: render iframes directly like ToolCallDisplay --> |
| 111 | + <!-- Embeds rendered directly above the collapsed group --> |
112 | 112 | {#each allEmbeds as embedItem, idx} |
113 | 113 | <div id={`${id}-embed-${idx}`}> |
114 | 114 | <FullHeightIframe |
|
121 | 121 | /> |
122 | 122 | </div> |
123 | 123 | {/each} |
124 | | - {:else} |
125 | | - <!-- svelte-ignore a11y-no-static-element-interactions --> |
126 | | - <button |
127 | | - class="w-fit text-left text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition cursor-pointer" |
128 | | - aria-label={$i18n.t('Toggle details')} |
129 | | - aria-expanded={open} |
130 | | - on:click={() => { |
131 | | - open = !open; |
132 | | - }} |
133 | | - > |
134 | | - <div class="flex items-center gap-1.5"> |
135 | | - <!-- Status icon --> |
136 | | - {#if hasPending} |
137 | | - <div> |
138 | | - <Spinner className="size-4" /> |
139 | | - </div> |
140 | | - {:else if toolCallCount > 0} |
141 | | - <div class="text-emerald-500 dark:text-emerald-400"> |
142 | | - <CheckCircle className="size-4" strokeWidth="2" /> |
143 | | - </div> |
144 | | - {:else} |
145 | | - <div class="text-gray-400 dark:text-gray-500"> |
146 | | - <Sparkles className="size-3.5" /> |
147 | | - </div> |
148 | | - {/if} |
| 124 | + {/if} |
149 | 125 |
|
150 | | - <!-- Summary text --> |
151 | | - <div class="flex-1 line-clamp-1"> |
152 | | - <span class="text-gray-600 dark:text-gray-300 {hasPending ? 'shimmer' : ''}" |
153 | | - >{prefixText}</span |
154 | | - > |
155 | | - {#if summaryText} |
156 | | - <span class="text-gray-400 dark:text-gray-500">{summaryText}</span> |
157 | | - {/if} |
| 126 | + <!-- svelte-ignore a11y-no-static-element-interactions --> |
| 127 | + <button |
| 128 | + class="w-fit text-left text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition cursor-pointer" |
| 129 | + aria-label={$i18n.t('Toggle details')} |
| 130 | + aria-expanded={open} |
| 131 | + on:click={() => { |
| 132 | + open = !open; |
| 133 | + }} |
| 134 | + > |
| 135 | + <div class="flex items-center gap-1.5"> |
| 136 | + <!-- Status icon --> |
| 137 | + {#if hasPending} |
| 138 | + <div> |
| 139 | + <Spinner className="size-4" /> |
158 | 140 | </div> |
159 | | - |
160 | | - <!-- Chevron --> |
161 | | - <div class="flex shrink-0 self-center text-gray-400 dark:text-gray-500"> |
162 | | - {#if open} |
163 | | - <ChevronUp strokeWidth="3.5" className="size-3" /> |
164 | | - {:else} |
165 | | - <ChevronDown strokeWidth="3.5" className="size-3" /> |
166 | | - {/if} |
| 141 | + {:else if toolCallCount > 0} |
| 142 | + <div class="text-emerald-500 dark:text-emerald-400"> |
| 143 | + <CheckCircle className="size-4" strokeWidth="2" /> |
| 144 | + </div> |
| 145 | + {:else} |
| 146 | + <div class="text-gray-400 dark:text-gray-500"> |
| 147 | + <Sparkles className="size-3.5" /> |
167 | 148 | </div> |
| 149 | + {/if} |
| 150 | + |
| 151 | + <!-- Summary text --> |
| 152 | + <div class="flex-1 line-clamp-1"> |
| 153 | + <span class="text-gray-600 dark:text-gray-300 {hasPending ? 'shimmer' : ''}" |
| 154 | + >{prefixText}</span |
| 155 | + > |
| 156 | + {#if summaryText} |
| 157 | + <span class="text-gray-400 dark:text-gray-500">{summaryText}</span> |
| 158 | + {/if} |
168 | 159 | </div> |
169 | | - </button> |
170 | 160 |
|
171 | | - {#if open} |
172 | | - <div transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}> |
173 | | - <div class="mb-0.5 space-y-0.5"> |
174 | | - <slot name="content" /> |
175 | | - </div> |
| 161 | + <!-- Chevron --> |
| 162 | + <div class="flex shrink-0 self-center text-gray-400 dark:text-gray-500"> |
| 163 | + {#if open} |
| 164 | + <ChevronUp strokeWidth="3.5" className="size-3" /> |
| 165 | + {:else} |
| 166 | + <ChevronDown strokeWidth="3.5" className="size-3" /> |
| 167 | + {/if} |
| 168 | + </div> |
| 169 | + </div> |
| 170 | + </button> |
| 171 | + |
| 172 | + {#if open} |
| 173 | + <div transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}> |
| 174 | + <div class="mb-0.5 space-y-0.5"> |
| 175 | + <slot name="content" /> |
176 | 176 | </div> |
177 | | - {/if} |
| 177 | + </div> |
178 | 178 | {/if} |
179 | 179 | </div> |
0 commit comments