Skip to content

fix(sub-block): render tooltip field as Info icon in label#4703

Open
serhiizghama wants to merge 1 commit into
simstudioai:mainfrom
serhiizghama:fix/sub-block-tooltip-rendering
Open

fix(sub-block): render tooltip field as Info icon in label#4703
serhiizghama wants to merge 1 commit into
simstudioai:mainfrom
serhiizghama:fix/sub-block-tooltip-rendering

Conversation

@serhiizghama
Copy link
Copy Markdown

Problem

SubBlockConfig.tooltip is defined in blocks/types.ts but was never rendered in the renderLabel function of sub-block.tsx. Adding tooltip: 'some help text' to any sub-block definition had no visible effect in the UI.

Solution

Added an Info icon from lucide-react that appears inline next to the field label (after the required asterisk). Hovering it shows the tooltip text via the existing Tooltip.Root/Trigger/Content pattern already used in the same file.

The tooltip renders inside the <Label> element, consistent with how the invalid-JSON AlertTriangle warning is handled in the same function.

Testing

  1. Add tooltip: 'some help text' to any sub-block definition in a block config
  2. Open the workflow editor and find that block in the panel
  3. An Info icon appears next to the field label
  4. Hovering it shows the tooltip text

Closes #4071

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 21, 2026 8:45pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 21, 2026

PR Summary

Low Risk
Low risk UI-only change that surfaces existing SubBlockConfig.tooltip text via a hover tooltip; no data flow or behavior changes beyond label rendering.

Overview
Sub-block field labels now render SubBlockConfig.tooltip. When a sub-block config provides tooltip, the editor label shows an inline Info icon that displays the tooltip text on hover using the existing Tooltip pattern.

Reviewed by Cursor Bugbot for commit bf99932. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR fixes a long-standing gap where SubBlockConfig.tooltip was defined in blocks/types.ts but had no rendering path—adding a tooltip to any sub-block definition was silently ignored. The fix adds an Info icon to renderLabel that shows the tooltip text on hover.

  • An Info icon from lucide-react is added after the required-asterisk span, wrapped in the same Tooltip.Root/Trigger/Content pattern already used for the AlertTriangle JSON-validation warning and copy/wand controls in the same function.
  • The tooltip is conditionally rendered only when config.tooltip is truthy, with no layout impact when absent.

Confidence Score: 5/5

Safe to merge — the change is additive, touches only the label render path, and is conditionally active only when a block config sets tooltip.

The implementation exactly mirrors the existing AlertTriangle tooltip pattern in the same function: same Tooltip.Root/Trigger/Content structure, same asChild + span wrapper, same icon sizing. No state, no new dependencies, and no change to existing rendering when config.tooltip is absent.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx Adds Info icon tooltip inside renderLabel, following the identical AlertTriangle pattern already in the same function. No logic changes to existing paths.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[renderLabel called] --> B{config.title?}
    B -- No --> Z[return null]
    B -- Yes --> C[Render Label element]
    C --> D{isSearchHighlighted?}
    D -- Yes --> E[Render highlighted mark]
    D -- No --> F[Render plain title text]
    E --> G{required?}
    F --> G
    G -- Yes --> H[Render asterisk span]
    G -- No --> I{config.tooltip?}
    H --> I
    I -- Yes --> J[Render Info icon + Tooltip.Root]
    I -- No --> K[Render labelSuffix]
    J --> K
    K --> L{code type + invalid JSON?}
    L -- Yes --> M[Render AlertTriangle + Tooltip.Root]
    L -- No --> N[Render action buttons wand/copy/etc.]
    M --> N
Loading

Reviews (1): Last reviewed commit: "fix(sub-block): render tooltip field as ..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant