diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx index d01eadfd61..ebbaa1f810 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx @@ -510,7 +510,6 @@ function WorkflowPreviewBlockInner({ data }: NodeProps { { { expect(lightTag).toHaveStyle({ background: '#FFFFFF' }) expect(lightTag).toHaveClass('text-[#000000]') }) + + /** + * The label used to drop out whenever the block's title already said the same + * word, so a freshly dropped Wait showed a bare icon and its second copy — + * named "Wait 2" — showed "Wait". The tag names the block's kind; it is not a + * badge that appears on rename. + */ + it('names the block type even when the title already says it', () => { + const host = document.createElement('div') + document.body.appendChild(host) + const root = createRoot(host) + mountedRoots.add(root) + mountedHosts.add(host) + + act(() => + root.render() + ) + + expect(host.querySelector('[data-workflow-type-accent]')).toHaveTextContent('Wait') + }) }) diff --git a/packages/workflow-renderer/src/workflow-block/workflow-block-view.tsx b/packages/workflow-renderer/src/workflow-block/workflow-block-view.tsx index d7c145ccfa..47412a805a 100644 --- a/packages/workflow-renderer/src/workflow-block/workflow-block-view.tsx +++ b/packages/workflow-renderer/src/workflow-block/workflow-block-view.tsx @@ -205,7 +205,6 @@ export function WorkflowTypeIcon({ type, Icon, className, ...props }: WorkflowTy export interface WorkflowTypeTagProps { type: string typeLabel?: string - blockName: string Icon: ComponentType<{ className?: string }> iconBgColor: string isIntegration?: boolean @@ -216,7 +215,6 @@ export interface WorkflowTypeTagProps { export function WorkflowTypeTag({ type, typeLabel, - blockName, Icon, iconBgColor, isIntegration = false, @@ -227,7 +225,14 @@ export function WorkflowTypeTag({ 'flex-shrink-0 justify-center transition-opacity duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)]', !isEnabled && 'opacity-50' ) - const label = typeLabel && typeLabel !== blockName ? typeLabel : null + /* + * The tag names the block's kind, and it says so whether or not the title + * happens to repeat it. Dropping the label when the two matched meant a card + * changed shape the moment it was renamed — a freshly dropped Wait showed a + * bare icon, its second copy showed "Wait" — so the tag read as a badge that + * came and went rather than as one fixed part of the header. + */ + const label = typeLabel || null if (isIntegration) { return ( @@ -927,7 +932,6 @@ export function WorkflowBlockView({