Skip to content

fix(blocks): SubBlockConfig.tooltip field defined but not rendered in sub-block label #4071

@minijeong-log

Description

@minijeong-log

Bug Description

SubBlockConfig.tooltip is defined in blocks/types.ts but is never rendered in the renderLabel function of sub-block.tsx. The type was added in commit 8215a81 without the corresponding UI implementation.

Root Cause

In apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx, the renderLabel function reads config.title, config.required, etc., but never checks or renders config.tooltip.

Steps to Reproduce

  1. Add tooltip: 'some help text' to any subBlock definition in a block config
  2. Open the workflow editor and find that block
  3. Observe that no tooltip icon appears next to the field label

Expected Behavior

An Info icon should appear next to the field label. Hovering over it should show the tooltip text.

Fix

Add tooltip rendering in renderLabel after the required asterisk:

{config.tooltip && (
  <Tooltip.Root>
    <Tooltip.Trigger asChild>
      <span className='inline-flex'>
        <Info className='h-3 w-3 flex-shrink-0 cursor-pointer text-muted-foreground' />
      </span>
    </Tooltip.Trigger>
    <Tooltip.Content side='top'>
      <p>{config.tooltip}</p>
    </Tooltip.Content>
  </Tooltip.Root>
)}

The Tooltip component is already imported and the Tooltip.Root/Trigger/Content pattern is already used in the same file (for the invalid JSON warning).

Affected File

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions