Skip to content

Commit 74e0bf8

Browse files
waleedlatif1claude
andcommitted
fix(emcn/toast): inset on the /w index route; stronger, unified intent tints
- Positioning: the workflow-list index route /workspace/[id]/w renders the panel + terminal but failed includes('/w/'), so a toast there rendered under the panel. Match /\/w(\/|$)/ so both the editor and the index inset. - Tint: unify all four intent icons onto the badge palette and use --badge-success-text (a darker green) so success isn't ~1.9:1 / washed out on the light card; error/success now match warning/info's token family. - Gate the card enter animation on reduceMotion for consistency with the rest of the file (behaviour was already correct via duration 0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 86c3b59 commit 74e0bf8

2 files changed

Lines changed: 6 additions & 43 deletions

File tree

apps/sim/components/emcn/components/toast/countdown-ring.tsx

Lines changed: 0 additions & 37 deletions
This file was deleted.

apps/sim/components/emcn/components/toast/toast.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ const VARIANT_ICON: Record<ToastVariant, ComponentType<SVGProps<SVGSVGElement>>>
7171
error: CircleAlert,
7272
}
7373

74-
/** Per-variant icon tint from the shared intent palette; `default` stays neutral. */
74+
/** Per-variant icon tint from the shared badge intent palette; `default` stays neutral. */
7575
const VARIANT_ICON_COLOR: Record<ToastVariant, string> = {
7676
default: 'text-[var(--text-icon)]',
7777
info: 'text-[var(--badge-blue-text)]',
78-
success: 'text-[var(--text-success)]',
78+
success: 'text-[var(--badge-success-text)]',
7979
warning: 'text-[var(--badge-amber-text)]',
80-
error: 'text-[var(--text-error)]',
80+
error: 'text-[var(--badge-error-text)]',
8181
}
8282

8383
interface ToastAction {
@@ -309,7 +309,7 @@ function ToastItem({ toast: t, geometry, reduceMotion, onDismiss, onMeasure }: T
309309
<motion.li
310310
onMouseEnter={() => setHovered(true)}
311311
onMouseLeave={() => setHovered(false)}
312-
initial={{ opacity: 0, y: height }}
312+
initial={reduceMotion ? false : { opacity: 0, y: height }}
313313
animate={{ opacity: 1, y, scale, height }}
314314
exit={{
315315
opacity: 0,
@@ -499,8 +499,8 @@ function StackDismiss({
499499
export function ToastProvider({ children }: { children?: ReactNode }) {
500500
const pathname = usePathname()
501501
const reduceMotion = useReducedMotion() ?? false
502-
/** On workflow pages the stack insets by `--panel-width` / `--terminal-height` so it clears the panel and terminal. */
503-
const isWorkflowPage = pathname?.includes('/w/') ?? false
502+
/** On the workflow editor (`/w/[id]` and the `/w` index) the stack insets by `--panel-width` / `--terminal-height` to clear the panel and terminal. */
503+
const isWorkflowPage = pathname ? /\/w(\/|$)/.test(pathname) : false
504504

505505
const [toasts, setToasts] = useState<ToastData[]>([])
506506
const [heights, setHeights] = useState<Record<string, number>>({})

0 commit comments

Comments
 (0)