Implement tooltip on custom call type#182
Conversation
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
✅ Deploy Preview for swf-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR replaces the browser default title tooltip for unknown task badges with the app’s Tooltip component to provide a consistent UI.
Changes:
- Adds Tooltip UI components to
Nodes.tsx - Wraps custom/unknown badges with
TooltipTriggerandTooltipContent - Introduces inline color styling based on
prefers-color-scheme
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@lornakelly Please review this. |
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
|
@kumaradityaraj also make sure to add changeset |
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
|
@lornakelly @fantonangeli @handreyrc @cheryl7114 please review this again. |
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@serverlessworkflow/diagram-editor": patch | |||
There was a problem hiding this comment.
this should be minor as well and please update the file name
| @@ -17,7 +17,7 @@ catalogs: | |||
| version: 5.2.1 | |||
| '@playwright/test': | |||
There was a problem hiding this comment.
Seem to still have an issue with the pnpm lock as there shouldnt be any changes, as Handrey mentioned you might be out of sync and need to update this with the main pnpm lock
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@serverlessworkflow/diagram-editor": patch | |||
There was a problem hiding this comment.
Let's use minor
https://semver.org/#summary
| "@serverlessworkflow/diagram-editor": patch | |
| "@serverlessworkflow/diagram-editor": minor |
| --background: hsl(0 0% 100%); | ||
|
|
||
| --foreground: hsl(222.2 84% 4.9%); |
There was a problem hiding this comment.
Could you please use more specific names for these new variables, following the code style already here?
| --background: hsl(0 0% 100%); | |
| --foreground: hsl(222.2 84% 4.9%); | |
| --tooltip-background: hsl(0 0% 100%); | |
| --tooltip-foreground: hsl(222.2 84% 4.9%); |
| --background: hsl(222.2 84% 4.9%); | ||
|
|
||
| --foreground: hsl(210 40% 98%); |
There was a problem hiding this comment.
| --background: hsl(222.2 84% 4.9%); | |
| --foreground: hsl(210 40% 98%); | |
| --tooltip-background: hsl(222.2 84% 4.9%); | |
| --tooltip-foreground: hsl(210 40% 98%); |
| --color-background: var(--background); | ||
|
|
||
| --color-foreground: var(--foreground); |
There was a problem hiding this comment.
| --color-background: var(--background); | |
| --color-foreground: var(--foreground); | |
| --color-tooltip-background: var(--background); | |
| --color-tooltip-foreground: var(--foreground); |
| <TooltipPrimitive.Arrow className="dec:z-50 dec:size-2.5 dec:translate-y-[calc(-50%_-_2px)] dec:rotate-45 dec:rounded-[2px] dec:bg-foreground dec:fill-foreground" /> | ||
| </TooltipPrimitive.Content> | ||
| </TooltipPrimitive.Portal> | ||
| <TooltipPrimitive.Content |
There was a problem hiding this comment.
I saw in the official implementation they use Tooltip.Portal (https://www.radix-ui.com/primitives/docs/components/tooltip#anatomy).
The docs say "When used, portals the content part into the body," and I can see this UI issue with selected edges. As you can see, the tooltip is under the edge.
Maybe the Portal can help with this, anyway I would follow the official examples.
| const callBadge = screen.getByTestId("call-node-n1-badge-custom"); | ||
|
|
||
| expect(callBadge).toBeInTheDocument(); | ||
| expect(callBadge).toHaveTextContent("customCall"); |
There was a problem hiding this comment.
I think this is already tested by the previous test
| expect(callBadge).toHaveTextContent("customCall"); |
Closes
A small, reusable tooltip component and use it to replace the native browser title tooltip currently shown on custom call type badges.