mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-07 10:17:43 +02:00
[eric] workflows: a refused delete keeps the card and says why instead of looking broken
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user