studio: toast UX -- 5s auto-dismiss with close button
- Default toast duration 5s (was infinite for loading toasts) - Add closeButton to Sonner Toaster for manual dismiss via X - Sonner pauses dismiss timer on hover automatically
This commit is contained in:
parent
050240b27a
commit
ac99649c47
2 changed files with 5 additions and 4 deletions
|
|
@ -19,7 +19,8 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|||
<Sonner
|
||||
theme={theme as ToasterProps["theme"]}
|
||||
className="toaster group"
|
||||
duration={10000}
|
||||
duration={5000}
|
||||
closeButton={true}
|
||||
icons={{
|
||||
success: (
|
||||
<HugeiconsIcon
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ export function useChatModelRuntime() {
|
|||
isDownloaded ? "Loading model…" : "Downloading model…",
|
||||
{
|
||||
description: loadingDescription,
|
||||
duration: 10000,
|
||||
duration: 5000,
|
||||
action: {
|
||||
label: "Cancel",
|
||||
onClick: () => {
|
||||
|
|
@ -346,7 +346,7 @@ export function useChatModelRuntime() {
|
|||
{
|
||||
id: toastId,
|
||||
description: `${dlGb.toFixed(1)} / ${totalGb.toFixed(1)} GB`,
|
||||
duration: 10000,
|
||||
duration: 5000,
|
||||
action: {
|
||||
label: "Cancel",
|
||||
onClick: () => {
|
||||
|
|
@ -368,7 +368,7 @@ export function useChatModelRuntime() {
|
|||
toast.loading("Loading model…", {
|
||||
id: toastId,
|
||||
description: "Download complete. Starting inference server…",
|
||||
duration: 10000,
|
||||
duration: 5000,
|
||||
});
|
||||
if (progressInterval) clearInterval(progressInterval);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue