Skip to content

Commit 6a92e05

Browse files
authored
fix(mothership): use a spinner while workflow resources load (#8756)
1 parent 69d9ac6 commit 6a92e05

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content

‎apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
FileX,
1616
Folder as FolderIcon,
1717
Library,
18+
Loader,
1819
Square,
1920
SquareArrowUpRight,
2021
Workflow as WorkflowIcon,
@@ -74,6 +75,13 @@ import type { WorkflowMetadata } from '@/stores/workflows/registry/types'
7475

7576
const Workflow = lazy(() => import('@/app/workspace/[workspaceId]/w/[workflowId]/workflow'))
7677

78+
const WORKFLOW_LOADING = (
79+
<div role='status' className='flex h-full items-center justify-center'>
80+
<Loader animate className='size-[18px] text-[var(--text-icon)]' />
81+
<span className='sr-only'>Loading workflow</span>
82+
</div>
83+
)
84+
7785
const LOADING_SKELETON = (
7886
<div className='flex h-full flex-col gap-2 p-6'>
7987
<Skeleton className='h-[16px] w-[60%]' />
@@ -717,7 +725,7 @@ function EmbeddedWorkflow({ workspaceId, workflowId }: EmbeddedWorkflowProps) {
717725
}
718726

719727
return (
720-
<Suspense fallback={LOADING_SKELETON}>
728+
<Suspense fallback={WORKFLOW_LOADING}>
721729
<Workflow workspaceId={workspaceId} workflowId={workflowId} embedded />
722730
</Suspense>
723731
)
@@ -749,7 +757,7 @@ function ResolveEmbeddedWorkflow({ workspaceId, workflowId }: EmbeddedWorkflowPr
749757
)
750758
}, [canonical, queryClient, workflowId, workspaceId])
751759

752-
if (isCanonicalPending) return LOADING_SKELETON
760+
if (isCanonicalPending) return WORKFLOW_LOADING
753761

754762
if (canonical?.workspaceId && canonical.workspaceId !== workspaceId) {
755763
return (
@@ -766,7 +774,7 @@ function ResolveEmbeddedWorkflow({ workspaceId, workflowId }: EmbeddedWorkflowPr
766774
)
767775
}
768776

769-
if (canonical?.workspaceId === workspaceId && !canonical.archivedAt) return LOADING_SKELETON
777+
if (canonical?.workspaceId === workspaceId && !canonical.archivedAt) return WORKFLOW_LOADING
770778

771779
return (
772780
<div className='flex h-full flex-col items-center justify-center gap-3'>

0 commit comments

Comments
 (0)