fix(blocks): render SubBlockConfig.tooltip in sub-block label#5234
fix(blocks): render SubBlockConfig.tooltip in sub-block label#5234sanidhyasin wants to merge 1 commit into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview When Reviewed by Cursor Bugbot for commit 840a794. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR renders configured sub-block tooltips in the editor label area. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(blocks): render SubBlockConfig.toolt..." | Re-trigger Greptile |
Summary
SubBlockConfig.tooltipis defined inapps/sim/blocks/types.ts(tooltip?: string // Tooltip text displayed via info icon next to the title) but was never rendered.renderLabelinsub-block.tsxreadsconfig.titleandconfig.requiredbut ignoredconfig.tooltip, so block configs that set it — e.g.pi.tsandtextract.ts— showed no help text in the editor.This wires up the field: when
config.tooltipis set, anInfoicon is rendered next to the field title, and hovering it shows the tooltip text. It reuses theTooltip.Root/Trigger/Contentpattern already used a few lines below in the samerenderLabelfor the invalid-JSON warning, and matches its icon styling (size-3,flex-shrink-0,text-muted-foreground).Fixes #4071
Type of Change
Testing
bunx @biomejs/biome checkon the changed file passes with no fixes/warnings.tooltip(pi.ts,textract.ts) now surface an info icon with their help text next to the corresponding field label; fields without atooltipare unchanged.renderLabel, so no test was added.Reviewers: the only behavioral change is the new conditional block inside
renderLabel; everything else (required asterisk, label suffix, invalid-JSON warning, copy/wand/toggle controls) is untouched.Checklist
Screenshots/Videos
With a sub-block that sets
tooltip(e.g. the PI block's "Personal access token" field), an info icon now appears immediately after the field title; hovering it shows the configured text. Fields with notooltiprender exactly as before.