Skip to content

fix(blocks): render tooltip field in sub-block label#4072

Closed
minijeong-log wants to merge 12 commits intosimstudioai:stagingfrom
minijeong-log:fix/sub-block-tooltip-rendering
Closed

fix(blocks): render tooltip field in sub-block label#4072
minijeong-log wants to merge 12 commits intosimstudioai:stagingfrom
minijeong-log:fix/sub-block-tooltip-rendering

Conversation

@minijeong-log
Copy link
Copy Markdown
Contributor

Summary

  • SubBlockConfig.tooltip was typed in blocks/types.ts (added in commit 8215a81) but never rendered in sub-block.tsx
  • Adds an Info icon next to the field label that shows the tooltip text on hover
  • Reuses the existing Tooltip.Root/Trigger/Content pattern already present in the same file

Changes

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

  • Add Info to lucide-react imports
  • Render tooltip icon after the required asterisk in renderLabel

Test plan

  • Add tooltip: 'some help text' to a subBlock in any block config
  • Open the workflow editor and find that block
  • Verify an Info icon appears next to the field label
  • Hover over the icon and verify the tooltip text appears

Fixes #4071

🤖 Generated with Claude Code

waleedlatif1 and others added 11 commits April 3, 2026 23:30
…ership workflow edits via sockets, ui improvements
…ration, signup method feature flags, SSO improvements
* feat(posthog): Add tracking on mothership abort (simstudioai#4023)

Co-authored-by: Theodore Li <theo@sim.ai>

* fix(login): fix captcha headers for manual login  (simstudioai#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha
…nts, secrets performance, polling refactors, drag resources in mothership
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 9, 2026

PR Summary

Low Risk
Small, UI-only change limited to label rendering; minimal behavioral impact beyond showing an additional tooltip icon.

Overview
Sub-block field labels in the workflow editor now display SubBlockConfig.tooltip via an Info icon rendered next to the title/required marker, showing the tooltip text on hover using the existing Tooltip components.

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

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

@minijeong-log is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Apr 9, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
29606901 Triggered Generic High Entropy Secret a54dcbe apps/sim/providers/utils.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 9, 2026

Greptile Summary

This PR wires up the tooltip field that was already typed in SubBlockConfig but never rendered — adding an Info icon next to sub-block labels that shows the tooltip text on hover. The implementation correctly reuses the existing Tooltip.Root/Trigger/Content pattern already present in the same file.

Confidence Score: 5/5

Safe to merge — single-file change that correctly follows existing patterns with no logic or data risks.

Only finding is a P2 accessibility suggestion (missing tabIndex on tooltip trigger span), which is also consistent with pre-existing code. No logic, data, or security concerns.

No files require special attention.

Vulnerabilities

No security concerns identified. The tooltip text is sourced from static block config objects (not user input), so there is no XSS risk.

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 rendering for config.tooltip inside renderLabel, following the existing AlertTriangle tooltip pattern — clean and minimal change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["renderLabel(config, ...)"] --> B{config.title?}
    B -- No --> Z[return null]
    B -- Yes --> C[Render Label]
    C --> D{config.required?}
    D -- Yes --> E["Render asterisk *"]
    D -- No --> F{config.tooltip?}
    E --> F
    F -- Yes --> G["Render Info icon\n+ Tooltip.Root/Trigger/Content"]
    F -- No --> H{labelSuffix?}
    G --> H
    H -- Yes --> I[Render labelSuffix]
    H -- No --> J{code + invalid JSON?}
    I --> J
    J -- Yes --> K["Render AlertTriangle\n+ Tooltip.Root/Trigger/Content"]
    J -- No --> L[Return label JSX]
    K --> L
Loading

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

Comment on lines +255 to +258
<Tooltip.Trigger asChild>
<span className='inline-flex'>
<Info className='h-3 w-3 flex-shrink-0 cursor-pointer text-muted-foreground' />
</span>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tooltip trigger is not keyboard-accessible

The <span> wrapping the Info icon has no tabIndex or role, so keyboard-only users cannot reach the tooltip. Radix UI requires a focusable element as the trigger to work correctly with keyboard navigation. Adding tabIndex={0} and role="button" (or swapping for a <button>) would make it accessible.

Suggested change
<Tooltip.Trigger asChild>
<span className='inline-flex'>
<Info className='h-3 w-3 flex-shrink-0 cursor-pointer text-muted-foreground' />
</span>
<span className='inline-flex' tabIndex={0} role='button' aria-label={config.tooltip}>

Note: the existing AlertTriangle tooltip uses the same pattern, so this is a pre-existing gap rather than a regression introduced by this PR.

@minijeong-log
Copy link
Copy Markdown
Contributor Author

Closing in favor of a new PR based on upstream/staging to avoid unrelated commits.

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.

3 participants