Skip to content

Commit 973387a

Browse files
authored
feat: Enhance toast display to improve user experience (huggingface#1689) (huggingface#1690)
1. Updated the Toast component to add a maximum width for the message to prevent it from stretching across the full screen. 2. Increased the timeout duration for error toasts from 3 seconds to 10 seconds to ensure long messages are readable.
1 parent 415831f commit 973387a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib/components/Toast.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
class="pointer-events-auto flex items-center rounded-full bg-white/90 px-3 py-1 shadow-sm dark:bg-gray-900/80"
1515
>
1616
<IconDazzled classNames="text-2xl mr-2" />
17-
<h2 class="font-semibold">{message}</h2>
17+
<h2 class="max-w-2xl font-semibold">{message}</h2>
1818
</div>
1919
</div>

src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
errorToastTimeout = setTimeout(() => {
4444
$error = null;
4545
currentError = null;
46-
}, 3000);
46+
}, 10000);
4747
}
4848
4949
async function deleteConversation(id: string) {

0 commit comments

Comments
 (0)