Skip to content

Commit 840a794

Browse files
committed
fix(blocks): render SubBlockConfig.tooltip in sub-block label
The tooltip field on SubBlockConfig was defined in blocks/types.ts but never rendered. renderLabel in sub-block.tsx reads title and required but ignored tooltip, so configs that set it (e.g. pi, textract) showed no help text. Render an Info icon with the tooltip text next to the field title, reusing the Tooltip pattern already used in this file for the invalid JSON warning.
1 parent 613e8ea commit 840a794

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Check,
88
Clipboard,
99
ExternalLink,
10+
Info,
1011
} from 'lucide-react'
1112
import { useParams } from 'next/navigation'
1213
import { Button, Input, Label, Tooltip } from '@/components/emcn/components'
@@ -252,6 +253,18 @@ const renderLabel = (
252253
<Label className='flex items-baseline gap-1.5 whitespace-nowrap'>
253254
{config.title}
254255
{required && <span className='ml-0.5'>*</span>}
256+
{config.tooltip && (
257+
<Tooltip.Root>
258+
<Tooltip.Trigger asChild>
259+
<span className='inline-flex'>
260+
<Info className='size-3 flex-shrink-0 cursor-pointer text-muted-foreground' />
261+
</span>
262+
</Tooltip.Trigger>
263+
<Tooltip.Content side='top'>
264+
<p>{config.tooltip}</p>
265+
</Tooltip.Content>
266+
</Tooltip.Root>
267+
)}
255268
{labelSuffix}
256269
{config.type === 'code' &&
257270
config.language === 'json' &&

0 commit comments

Comments
 (0)