From 004c4c37fce72bc1b5229fef7b57294b0b44f55e Mon Sep 17 00:00:00 2001 From: ciregenz Date: Sat, 1 Aug 2026 03:39:04 -0700 Subject: [PATCH] [eric] cloud: a refusal keeps the way out of it, and Try again actually clears it --- .../app/pages/Workflows/app/CloudRunSection.tsx | 16 +++++++++++++++- .../app/pages/Workflows/app/useCloudStatus.ts | 8 +++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/pages/Workflows/app/CloudRunSection.tsx b/frontend/src/app/pages/Workflows/app/CloudRunSection.tsx index 114c5aa0..13736877 100644 --- a/frontend/src/app/pages/Workflows/app/CloudRunSection.tsx +++ b/frontend/src/app/pages/Workflows/app/CloudRunSection.tsx @@ -97,7 +97,21 @@ const CloudRunSection: React.FC<{ workflow: Workflow; cloud: CloudStatusHandle } {cloud.pending && Talking to the cloud…} - {!cloud.pending && cloud.refusal && {cloud.refusal}} + {/* A refusal used to swallow every other branch, including the one holding the upgrade link, so being told you need Pro removed the way to get Pro. Carry the action through. */} + {!cloud.pending && cloud.refusal && ( + + + {cloud.refusal} + {availability.kind === 'blocked' && availability.action === 'sign_in' && ( + + )} + {availability.kind === 'blocked' && availability.action === 'plans' && ( + + )} + + + + )} {!cloud.pending && !cloud.refusal && availability.kind === 'checking' && ( Checking what your account allows… diff --git a/frontend/src/app/pages/Workflows/app/useCloudStatus.ts b/frontend/src/app/pages/Workflows/app/useCloudStatus.ts index f38e3b1c..d11b8314 100644 --- a/frontend/src/app/pages/Workflows/app/useCloudStatus.ts +++ b/frontend/src/app/pages/Workflows/app/useCloudStatus.ts @@ -12,6 +12,7 @@ export interface CloudStatusHandle { pending: boolean; /** Set only by a refused flip, and cleared by the next attempt. */ refusal: string | null; + retry: () => void; choose: (target: CloudTarget, enabled: boolean) => void; refresh: () => void; } @@ -59,5 +60,10 @@ export function useCloudStatus(workflow: Workflow): CloudStatusHandle { }); }, [dispatch, pending, refresh, workflowId, dashboardId]); - return { probe, pending, refusal, choose, refresh }; + // refresh() deliberately leaves `refusal` alone: choose() calls it right after setting one, and + // clearing there would wipe the message before it rendered. A user-driven retry is a different + // intent, so it gets its own door; without it a refusal outlived the thing that caused it. + const retry = useCallback(() => { setRefusal(null); refresh(); }, [refresh]); + + return { probe, pending, refusal, choose, refresh, retry }; }