Skip to content

Implement tooltip on custom call type#182

Open
kumaradityaraj wants to merge 11 commits into
serverlessworkflow:mainfrom
kumaradityaraj:hoverTooltip
Open

Implement tooltip on custom call type#182
kumaradityaraj wants to merge 11 commits into
serverlessworkflow:mainfrom
kumaradityaraj:hoverTooltip

Conversation

@kumaradityaraj

@kumaradityaraj kumaradityaraj commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Closes

A small, reusable tooltip component and use it to replace the native browser title tooltip currently shown on custom call type badges.

Screenshot 2026-06-24 at 1 12 23 PM

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings June 17, 2026 09:42
@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for swf-editor ready!

Name Link
🔨 Latest commit daf11e7
🔍 Latest deploy log https://app.netlify.com/projects/swf-editor/deploys/6a46309db256cd0008f37241
😎 Deploy Preview https://deploy-preview-182--swf-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

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.

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 TooltipTrigger and TooltipContent
  • Introduces inline color styling based on prefers-color-scheme

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
@kumaradityaraj

Copy link
Copy Markdown
Contributor Author

@lornakelly Please review this.

Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
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>
Copilot AI review requested due to automatic review settings June 24, 2026 07:40

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.css Outdated
Comment thread pnpm-lock.yaml
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings June 24, 2026 08:03

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.css Outdated
Comment thread pnpm-lock.yaml
@lornakelly

Copy link
Copy Markdown
Contributor

@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>
@kumaradityaraj

Copy link
Copy Markdown
Contributor Author

@lornakelly @fantonangeli @handreyrc @cheryl7114 please review this again.

@@ -0,0 +1,5 @@
---
"@serverlessworkflow/diagram-editor": patch

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.

this should be minor as well and please update the file name

Comment thread pnpm-lock.yaml
@@ -17,7 +17,7 @@ catalogs:
version: 5.2.1
'@playwright/test':

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.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's use minor
https://semver.org/#summary

Suggested change
"@serverlessworkflow/diagram-editor": patch
"@serverlessworkflow/diagram-editor": minor

Comment on lines +28 to +30
--background: hsl(0 0% 100%);

--foreground: hsl(222.2 84% 4.9%);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please use more specific names for these new variables, following the code style already here?

Suggested change
--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%);

Comment on lines +50 to +52
--background: hsl(222.2 84% 4.9%);

--foreground: hsl(210 40% 98%);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
--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%);

Comment on lines +72 to +74
--color-background: var(--background);

--color-foreground: var(--foreground);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
--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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Image

const callBadge = screen.getByTestId("call-node-n1-badge-custom");

expect(callBadge).toBeInTheDocument();
expect(callBadge).toHaveTextContent("customCall");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is already tested by the previous test

Suggested change
expect(callBadge).toHaveTextContent("customCall");

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.

4 participants