From 2b98d2fa95b8aa6785b27b1ca579f39c71d4a9ef Mon Sep 17 00:00:00 2001 From: ciregenz Date: Thu, 21 May 2026 22:37:37 -0700 Subject: [PATCH] =?UTF-8?q?[eric]=20workflows:=20header=20=E2=80=94=20Hist?= =?UTF-8?q?ory=20+=20Run=20flush-right,=20drop=20Edit=20tab=20(now=20in=20?= =?UTF-8?q?footer)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/pages/Workflows/WorkflowCard.tsx | 83 +++---------------- 1 file changed, 13 insertions(+), 70 deletions(-) diff --git a/frontend/src/app/pages/Workflows/WorkflowCard.tsx b/frontend/src/app/pages/Workflows/WorkflowCard.tsx index 39535211..b6327d69 100644 --- a/frontend/src/app/pages/Workflows/WorkflowCard.tsx +++ b/frontend/src/app/pages/Workflows/WorkflowCard.tsx @@ -5,10 +5,8 @@ import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; import Snackbar from '@mui/material/Snackbar'; import CloseIcon from '@mui/icons-material/Close'; -import EditIcon from '@mui/icons-material/EditOutlined'; import HistoryIcon from '@mui/icons-material/HistoryRounded'; import PlayArrowIcon from '@mui/icons-material/PlayArrowRounded'; -import ScheduleIcon from '@mui/icons-material/ScheduleRounded'; import DragIndicatorIcon from '@mui/icons-material/DragIndicator'; import InputBase from '@mui/material/InputBase'; import { useClaudeTokens } from '@/shared/styles/ThemeContext'; @@ -458,27 +456,25 @@ const WorkflowCard: React.FC = ({ - {/* ===== Action bar ===== - Target #54 puts Run / Edit / History flush left and "Schedule - this task" flush right on the SAME row. We use justifyContent - + a flex spacer instead of wrap, so narrow widths shrink the - action group rather than dropping Schedule onto a second line. - Run is the only accent-colored button (it's the verb users - actually do) but its border weight matches the siblings. */} + {/* Action bar matches new design: History + Run flush-right (Edit moved to footer). + The flex spacer is the empty left side; History is a quiet text link, Run is the + accent pill. */} {isDraft && ( - } active={false} accent onClick={() => {}} /> - } active={false} onClick={() => {}} /> - } active={false} onClick={() => {}} /> - - - Schedule this task - + } active={false} onClick={() => {}} /> + } active={false} accent onClick={() => {}} /> )} {!isDraft && workflow && ( + + } + active={card.view === 'history' || card.view === 'history_detail'} + onClick={() => dispatch(updateWorkflowCard({ workflowId, patch: { view: 'history' } }))} + /> } @@ -493,9 +489,6 @@ const WorkflowCard: React.FC = ({ try { const result = await dispatch(runWorkflowNow(workflow.id)); await dispatch(fetchRuns(workflow.id)); - // Detect skipped manual runs so the user gets a real - // explanation instead of a silent button-flicker. The - // most common skip today is the monthly cost cap. if (runWorkflowNow.fulfilled.match(result)) { const payload = result.payload; if (payload.status === 'skipped' && payload.error) { @@ -503,61 +496,11 @@ const WorkflowCard: React.FC = ({ } } } finally { - // Hold the "Starting…" label briefly so the user sees the - // state change even on fast runs. Without this the button - // flickers and feels like nothing happened. + // Hold "Starting…" briefly so fast runs don't flicker invisibly. setTimeout(() => setRunStarting(false), 600); } }} /> - } - active={card.view === 'edit'} - dot={editDirty} - dotTooltip="You have unsaved changes in this tab." - onClick={() => dispatch(updateWorkflowCard({ workflowId, patch: { view: 'edit', editFacet: card.editFacet || 'General' } }))} - /> - } - active={card.view === 'history' || card.view === 'history_detail'} - onClick={() => dispatch(updateWorkflowCard({ workflowId, patch: { view: 'history' } }))} - /> - - {!workflow.schedule.enabled && ( - { - const sched = workflow.schedule; - const next = { - ...sched, - enabled: true, - repeat_unit: sched.repeat_unit || 'day', - repeat_every: sched.repeat_every || 1, - hour: sched.hour || 9, - minute: sched.minute || 0, - }; - dispatch(updateWorkflow({ - id: workflow.id, - patch: { schedule: next as any }, - ifMatch: workflow.updated_at || null, - })); - dispatch(updateWorkflowCard({ workflowId, patch: { view: 'edit', editFacet: 'Schedule' } })); - }} - onPointerDown={(e) => e.stopPropagation()} - sx={{ - display: 'inline-flex', alignItems: 'center', gap: 0.4, - fontSize: '0.82rem', fontWeight: 500, - color: c.text.secondary, - cursor: 'pointer', - '&:hover': { color: c.accent.primary }, - }}> - - Schedule this task - - )} )}