Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/src/components/ui/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const anchoredToastManager = Toast.createToastManager<ThreadToastData>();
type ToastId = ReturnType<typeof toastManager.add>;
const threadToastVisibleTimeoutRemainingMs = new Map<ToastId, number>();

const DEFAULT_DISMISS_AFTER_VISIBLE_MS = 5_000;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium ui/toast.tsx:30

DEFAULT_DISMISS_AFTER_VISIBLE_MS is unconditionally applied to all toasts, including loading toasts. This causes loading toasts to auto-dismiss after 5 seconds even if the async operation is still running, leaving users without feedback and causing them to miss the eventual success/error state. Consider exempting loading toasts from the default timeout or requiring explicit durations only for non-loading types.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/components/ui/toast.tsx around line 30:

`DEFAULT_DISMISS_AFTER_VISIBLE_MS` is unconditionally applied to all toasts, including `loading` toasts. This causes loading toasts to auto-dismiss after 5 seconds even if the async operation is still running, leaving users without feedback and causing them to miss the eventual success/error state. Consider exempting `loading` toasts from the default timeout or requiring explicit durations only for non-loading types.

Evidence trail:
- apps/web/src/components/ui/toast.tsx line 30: `DEFAULT_DISMISS_AFTER_VISIBLE_MS = 5_000`
- apps/web/src/components/ui/toast.tsx lines 267-270: `ThreadToastVisibleAutoDismiss` rendered for ALL toasts with fallback to default timeout
- apps/web/src/components/ui/toast.tsx lines 64-143: `ThreadToastVisibleAutoDismiss` effect manages timer independent of base-ui's `timeout` property
- apps/web/src/components/GitActionsControl.tsx lines 154-157: `threadToastData` only contains `{ threadId: activeThreadId }`, no `dismissAfterVisibleMs`
- apps/web/src/components/GitActionsControl.tsx lines 308-311, 316-319, 328-330: Loading toasts created with `timeout: 0` but no `dismissAfterVisibleMs` in data


const TOAST_ICONS = {
error: CircleAlertIcon,
info: InfoIcon,
Expand Down Expand Up @@ -263,7 +265,7 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) {
toast={toast}
>
<ThreadToastVisibleAutoDismiss
dismissAfterVisibleMs={toast.data?.dismissAfterVisibleMs}
dismissAfterVisibleMs={toast.data?.dismissAfterVisibleMs ?? (toast.type === "loading" ? undefined : DEFAULT_DISMISS_AFTER_VISIBLE_MS)}
toastId={toast.id}
/>
<Toast.Content
Expand Down