[eric] workflows: a refused delete keeps the card and says why instead of looking broken

This commit is contained in:
ciregenz
2026-07-31 23:39:46 -07:00
parent dad66c9b20
commit 69a42693da
2 changed files with 40 additions and 0 deletions
@@ -6,6 +6,7 @@ import HelpPill from '../desktop/HelpPill';
import CardSearchPalette from '../controls/CardSearchPalette';
import DirectionHints from '../controls/DirectionHints';
import WorkflowRunningToast from '@/app/pages/Workflows/WorkflowRunningToast';
import WorkflowNoticeToast from '@/app/pages/Workflows/WorkflowNoticeToast';
import MissedRunsToast from '@/app/pages/Workflows/MissedRunsToast';
import ProviderHealthToast from '@/app/components/overlays/ProviderHealthToast';
import ScheduleOfferToast from '@/app/components/nudges/ScheduleOfferToast';
@@ -172,6 +173,7 @@ const DashboardOverlays: React.FC<DashboardOverlaysProps> = ({
{/* Scheduled-run nudge: "your {workflow} is running now" + jump-to-canvas */}
<WorkflowRunningToast />
<WorkflowNoticeToast />
{/* Launch nudge when scheduled runs elapsed while the app was closed */}
<MissedRunsToast />
@@ -0,0 +1,38 @@
// The server's own words when it refuses something the user asked for. Today that is a delete the
// cloud would not let go of; without it the card simply stays put and the click looks broken.
import React from 'react';
import Snackbar from '@mui/material/Snackbar';
import Alert from '@mui/material/Alert';
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
import { useAppDispatch, useAppSelector } from '@/shared/hooks';
import { dismissNoticeToast } from '@/shared/state/workflowsSlice';
export default function WorkflowNoticeToast() {
const c = useClaudeTokens();
const dispatch = useAppDispatch();
const notice = useAppSelector((s) => s.workflows.noticeToast);
return (
<Snackbar
open={Boolean(notice)}
autoHideDuration={9000}
onClose={(_, reason) => { if (reason !== 'clickaway') dispatch(dismissNoticeToast()); }}
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
>
<Alert
icon={false}
severity="warning"
onClose={() => dispatch(dismissNoticeToast())}
sx={{
bgcolor: c.bg.surface,
color: c.text.primary,
border: `1px solid ${c.border.medium}`,
maxWidth: 420,
}}
>
{notice}
</Alert>
</Snackbar>
);
}