feat(studio): show SQL snippet description#42090
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
WalkthroughPropagates new display props through the TreeView: Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| {element.name} | ||
| </span> | ||
| {!!visibility && ( | ||
| <span title={visibility} className="text-foreground-lighter text-xs"> |
There was a problem hiding this comment.
Redundant as it's always 'Private' or 'Shared'; never truncated.
| ...element, | ||
| name: ( | ||
| <span className="flex flex-col py-0.5"> | ||
| <span title={element.name} className="truncate"> |
There was a problem hiding this comment.
This and the below title collide with that on the parent row. Removing.
| name: string | ReactNode | ||
| /** Optional description of entity */ | ||
| description?: string | ||
| /** String name to use for title attribute when name is a ReactNode */ |
There was a problem hiding this comment.
Name comes through as a ReactNode on the SearchList.
| /> | ||
| ) | ||
| )} | ||
| <span className={cn(isEditing && 'hidden', 'truncate text-sm')} title={name}> |
There was a problem hiding this comment.
As above: removed to avoid clashing with title on parent row.
| const nameString = nameForTitle ?? (typeof name === 'string' ? name : '') | ||
| const [localValueState, setLocalValueState] = useState(nameString) |
There was a problem hiding this comment.
As above: needs to be checked as sometimes name is a ReactNode.
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › index-advisor.spec.ts › Index Advisor › Enable Index Advisor › should enable Index Advisor via Database > Extensions page Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
SaxonF
left a comment
There was a problem hiding this comment.
Tested in design system and in studio on snippets and edge function code
joshenlim
left a comment
There was a problem hiding this comment.
Verified changes on preview - although separately i reckon we look into consolidating how we wanna handle description tooltips like these - via title or Tooltip component
this and this PR does similar things, but deviates in how its presented - am presuming we might also opt to do something similar for table comments too
Braintrust eval report
|
What kind of change does this PR introduce?
What is the current behavior?
Some users add descriptions to their SQL snippets. We don’t show this description anywhere.
What is the new behavior?
We show this optional description when hovering over the snippet’s name on the sidebar.
Additional context
titleelement already is in use for thattitleis needed because some (many of my) snippets are truncatedTooltipcomponent is a too heavy-handed for thistitleelement has the perfect weight, I think, for this type of affordanceSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.