Spaces:
Runtime error
Runtime error
Thomas G. Lopes
commited on
Commit
Β·
539f4bc
1
Parent(s):
cdc312f
fix responsiveness
Browse files
src/lib/components/inference-playground/message.svelte
CHANGED
|
@@ -99,6 +99,7 @@
|
|
| 99 |
>
|
| 100 |
{message?.role}
|
| 101 |
</div>
|
|
|
|
| 102 |
<div class="flex w-full gap-4">
|
| 103 |
{#if conversation.data.parseMarkdown && message?.role === "assistant"}
|
| 104 |
<div
|
|
@@ -179,105 +180,106 @@
|
|
| 179 |
{/if}
|
| 180 |
|
| 181 |
<!-- Sticky wrapper for action buttons -->
|
| 182 |
-
<div
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
|
|
|
|
|
|
| 193 |
hover:bg-gray-100
|
| 194 |
hover:text-blue-700 focus:z-10 focus:ring-4
|
| 195 |
focus:ring-gray-100 focus:outline-hidden dark:border-gray-600
|
| 196 |
dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
hover:text-blue-700
|
| 221 |
focus:z-10 focus:ring-4 focus:ring-gray-100
|
| 222 |
focus:outline-hidden dark:border-gray-600 dark:bg-gray-800
|
| 223 |
dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
hover:text-blue-700
|
| 243 |
focus:z-10 focus:ring-4 focus:ring-gray-100
|
| 244 |
focus:outline-hidden dark:border-gray-600 dark:bg-gray-800
|
| 245 |
dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
hover:text-blue-700
|
| 270 |
focus:z-10 focus:ring-4 focus:ring-gray-100
|
| 271 |
focus:outline-hidden dark:border-gray-600 dark:bg-gray-800
|
| 272 |
dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
</div>
|
| 281 |
</div>
|
| 282 |
</div>
|
| 283 |
</div>
|
|
|
|
| 99 |
>
|
| 100 |
{message?.role}
|
| 101 |
</div>
|
| 102 |
+
|
| 103 |
<div class="flex w-full gap-4">
|
| 104 |
{#if conversation.data.parseMarkdown && message?.role === "assistant"}
|
| 105 |
<div
|
|
|
|
| 180 |
{/if}
|
| 181 |
|
| 182 |
<!-- Sticky wrapper for action buttons -->
|
| 183 |
+
<div
|
| 184 |
+
class={[
|
| 185 |
+
"top-8 z-10 flex flex-none flex-col items-start self-start @2xl:flex-row @max-2xl:[&>button]:-my-px @2xl:[&>button]:-mx-px @max-2xl:[&>button:first-of-type]:rounded-t-md @2xl:[&>button:first-of-type]:rounded-l-md @max-2xl:[&>button:last-of-type]:rounded-b-md @2xl:[&>button:last-of-type]:rounded-r-md",
|
| 186 |
+
shouldStick && "sticky",
|
| 187 |
+
]}
|
| 188 |
+
>
|
| 189 |
+
{#if canUploadImgs}
|
| 190 |
+
<Tooltip openDelay={250}>
|
| 191 |
+
{#snippet trigger(tooltip)}
|
| 192 |
+
<button
|
| 193 |
+
tabindex="0"
|
| 194 |
+
type="button"
|
| 195 |
+
class="grid size-7 place-items-center border border-gray-200 bg-white text-xs font-medium text-gray-900
|
| 196 |
hover:bg-gray-100
|
| 197 |
hover:text-blue-700 focus:z-10 focus:ring-4
|
| 198 |
focus:ring-gray-100 focus:outline-hidden dark:border-gray-600
|
| 199 |
dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 200 |
+
{...tooltip.trigger}
|
| 201 |
+
{...fileUpload.trigger}
|
| 202 |
+
>
|
| 203 |
+
<IconImage />
|
| 204 |
+
</button>
|
| 205 |
+
<input {...fileUpload.input} />
|
| 206 |
+
{/snippet}
|
| 207 |
+
Add image
|
| 208 |
+
</Tooltip>
|
| 209 |
+
{/if}
|
| 210 |
|
| 211 |
+
<Tooltip>
|
| 212 |
+
{#snippet trigger(tooltip)}
|
| 213 |
+
<LocalToasts>
|
| 214 |
+
{#snippet children({ trigger, addToast })}
|
| 215 |
+
<button
|
| 216 |
+
tabindex="0"
|
| 217 |
+
onclick={() => {
|
| 218 |
+
copyToClipboard(message.content ?? "");
|
| 219 |
+
addToast({ data: { content: "β", variant: "info" } });
|
| 220 |
+
}}
|
| 221 |
+
type="button"
|
| 222 |
+
class="grid size-7 place-items-center border border-gray-200 bg-white text-xs font-medium text-gray-900 hover:bg-gray-100
|
| 223 |
hover:text-blue-700
|
| 224 |
focus:z-10 focus:ring-4 focus:ring-gray-100
|
| 225 |
focus:outline-hidden dark:border-gray-600 dark:bg-gray-800
|
| 226 |
dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 227 |
+
{...tooltip.trigger}
|
| 228 |
+
{...trigger}
|
| 229 |
+
>
|
| 230 |
+
<IconCopy />
|
| 231 |
+
</button>
|
| 232 |
+
{/snippet}
|
| 233 |
+
</LocalToasts>
|
| 234 |
+
{/snippet}
|
| 235 |
+
Copy
|
| 236 |
+
</Tooltip>
|
| 237 |
|
| 238 |
+
<Tooltip>
|
| 239 |
+
{#snippet trigger(tooltip)}
|
| 240 |
+
<button
|
| 241 |
+
tabindex="0"
|
| 242 |
+
onclick={onRegen}
|
| 243 |
+
type="button"
|
| 244 |
+
class="grid size-7 place-items-center border border-gray-200 bg-white text-xs font-medium text-gray-900 hover:bg-gray-100
|
| 245 |
hover:text-blue-700
|
| 246 |
focus:z-10 focus:ring-4 focus:ring-gray-100
|
| 247 |
focus:outline-hidden dark:border-gray-600 dark:bg-gray-800
|
| 248 |
dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 249 |
+
{...tooltip.trigger}
|
| 250 |
+
>
|
| 251 |
+
<IconCustom icon={message.role === "user" ? "regen" : "refresh"} />
|
| 252 |
+
</button>
|
| 253 |
+
{/snippet}
|
| 254 |
+
<div class="flex items-center gap-2">
|
| 255 |
+
{regenLabel}
|
| 256 |
|
| 257 |
+
<span
|
| 258 |
+
class="inline-flex items-center gap-0.5 rounded-sm border border-white/20 bg-white/10 px-0.5 text-xs text-white/70"
|
| 259 |
+
>
|
| 260 |
+
{cmdOrCtrl}<span class="">G</span>
|
| 261 |
+
</span>
|
| 262 |
+
</div>
|
| 263 |
+
</Tooltip>
|
| 264 |
|
| 265 |
+
<Tooltip>
|
| 266 |
+
{#snippet trigger(tooltip)}
|
| 267 |
+
<button
|
| 268 |
+
tabindex="0"
|
| 269 |
+
onclick={onDelete}
|
| 270 |
+
type="button"
|
| 271 |
+
class="grid size-7 place-items-center border border-gray-200 bg-white text-xs font-medium text-gray-900 hover:bg-gray-100
|
| 272 |
hover:text-blue-700
|
| 273 |
focus:z-10 focus:ring-4 focus:ring-gray-100
|
| 274 |
focus:outline-hidden dark:border-gray-600 dark:bg-gray-800
|
| 275 |
dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
| 276 |
+
{...tooltip.trigger}
|
| 277 |
+
>
|
| 278 |
+
β
|
| 279 |
+
</button>
|
| 280 |
+
{/snippet}
|
| 281 |
+
Delete
|
| 282 |
+
</Tooltip>
|
|
|
|
| 283 |
</div>
|
| 284 |
</div>
|
| 285 |
</div>
|
src/lib/components/tooltip.svelte
CHANGED
|
@@ -45,7 +45,6 @@
|
|
| 45 |
[data-melt-tooltip-content] {
|
| 46 |
border: 0;
|
| 47 |
|
| 48 |
-
position: absolute;
|
| 49 |
pointer-events: none;
|
| 50 |
opacity: 0;
|
| 51 |
|
|
|
|
| 45 |
[data-melt-tooltip-content] {
|
| 46 |
border: 0;
|
| 47 |
|
|
|
|
| 48 |
pointer-events: none;
|
| 49 |
opacity: 0;
|
| 50 |
|