From 7d73cc4a16746845f96b8a42a6c94920fe741c26 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Thu, 21 May 2026 22:34:43 -0700 Subject: [PATCH] [eric] workflows: clean SavedView to match new design (step list + schedule chip + edit) --- .../pages/Workflows/WorkflowCardSubviews.tsx | 93 ++++++++----------- 1 file changed, 38 insertions(+), 55 deletions(-) diff --git a/frontend/src/app/pages/Workflows/WorkflowCardSubviews.tsx b/frontend/src/app/pages/Workflows/WorkflowCardSubviews.tsx index 8fefe6cd..7eba9da7 100644 --- a/frontend/src/app/pages/Workflows/WorkflowCardSubviews.tsx +++ b/frontend/src/app/pages/Workflows/WorkflowCardSubviews.tsx @@ -5,6 +5,8 @@ import Popover from '@mui/material/Popover'; import Tooltip from '@mui/material/Tooltip'; import InputBase from '@mui/material/InputBase'; import HistoryIcon from '@mui/icons-material/HistoryToggleOffRounded'; +import CalendarTodayRounded from '@mui/icons-material/CalendarTodayRounded'; +import EditOutlined from '@mui/icons-material/EditOutlined'; import { useClaudeTokens } from '@/shared/styles/ThemeContext'; import { useAppDispatch, useAppSelector } from '@/shared/hooks'; import { @@ -283,54 +285,14 @@ export function SavedView({ workflow, steps, runs, activeRunId }: { workflow: Wo ifMatch: workflow.updated_at || null, })); }, [habitSuggestion, dispatch, workflow.id, workflow.schedule, workflow.updated_at]); - // Audit trigger lazy-loads the edit log; only show it when the - // workflow has actually been edited. Skips the noisy "0 edits" link - // on freshly created cards. We trigger the fetch on mount once so the - // "edits"/no-edits decision is honest by the time the user reads. - // minHeight: 100% lets the bottom-right cluster pin to the bottom of - // the card body via mt:auto below. + const openEdit = useCallback(() => { + dispatch(updateWorkflowCard({ workflowId: workflow.id, patch: { view: 'edit', editFacet: 'Schedule' } })); + }, [dispatch, workflow.id]); + + const scheduleLine = workflow.schedule.enabled ? describeSchedule(workflow) : 'Schedule this workflow'; + return ( - {/* Prose lines per target #54: "Scheduled:" + "Permissions:". - Reads like a sentence the user can skim instead of a pill row - that needs hovering to decode. Cost stays as a small inline - chip on the right when there's anything to say. */} - - - Scheduled: - {describeSchedule(workflow)} - - {workflow.cost_estimate && workflow.cost_estimate.fires_per_month > 0 && ( - - )} - - - Permissions: - {describePermissions(workflow)} - - - - {habitSuggestion && ( - - - You've run this {habitSuggestion.count}× this week. Schedule it {habitSuggestion.label}? - - - Yes - - - )} - {workflow.description && ( - - {workflow.description} - - )} - {/* Bottom-right cluster matching target image #63. Discard + Save - only surface when the user has actually edited the first step - inline; otherwise we don't crowd the card with idle buttons. */} - {firstStepDirty ? ( - + {firstStepDirty && ( + - ) : ( - - - )} + + + + + {scheduleLine} + + + + Edit + + ); } +// kept on file for legacy uses; once the audit popover migrates, this and +// the StreakBadge / habit-suggestion blocks above can be deleted entirely. +void StreakBadgeRow; + // Splits StreakBadge out so the SavedView body doesn't have to ferry // the runs array through both the chip row (gone) and the step list. function StreakBadgeRow({ runs }: { runs?: WorkflowRun[] }) {