Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the new workflow not executed node type #10030

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

Devessier
Copy link
Contributor

@Devessier Devessier commented Feb 5, 2025

  • Added the new workflow not executed node type
  • Fixed minor style issues
  • Created one big catalog for all node variants

image

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces a new 'not-executed' node variant to the workflow diagram system, along with comprehensive styling improvements for better visual feedback across different node states.

  • Added new 'not-executed' variant in /packages/twenty-front/src/modules/workflow/workflow-diagram/types/WorkflowDiagramNodeVariant.ts with corresponding light/dark theme styling
  • Implemented gradient background transitions on hover in /packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode.tsx
  • Enhanced node state styling with adaptive colors (blue1-blue4) for selected states
  • Refactored /packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowDiagramStepNodeEditableContent.stories.tsx to use dimension-based catalog approach
  • Added smooth background transitions with theme.animation.duration.fast

5 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 56 to 66
${({ nodeVariant, theme }) => {
switch (nodeVariant) {
case 'empty':
case 'default': {
case 'default':
case 'not-executed':
return css`
background-color: ${theme.color.blue};
color: ${theme.font.color.inverted};
`;
}
}
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Missing return statement for success and failure cases in this switch. Could lead to inconsistent styling when those variants are selected.

Comment on lines +19 to +21
const Wrapper = (_props: WrapperProps) => {
return <div></div>;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Empty wrapper component doesn't render props. This could cause issues with storybook's prop table generation.

Suggested change
const Wrapper = (_props: WrapperProps) => {
return <div></div>;
};
const Wrapper = (props: WrapperProps) => {
return <WorkflowDiagramStepNodeEditableContent {...props} />;
};

(Story, { args }) => {
return (
<div
className={`selectable ${args.state === 'selected' ? 'selected' : args.state === 'hover' ? 'workflow-node-container hover' : ''}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Ternary expression could be simplified using a template literal and conditional classes

@Devessier Devessier changed the title Add the new workflow not executed node type and fix some styles Add the new workflow not executed node type Feb 5, 2025
},
parameters: {
msw: graphqlMocks,
pseudo: { hover: ['.hover'] },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had a hard time making the pseudo states plugin work because I didn't want my underlying components to expose a className property. I created a story decorator that creates a container with a hover class, which is used by the plugin to locate the element to hover. I also render a workflow-node-container class as the :hover pseudo-selector is linked to this class in the styles.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a bit hacky but it works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a better option 😅

@bosiraphael bosiraphael self-requested a review February 5, 2025 15:16
Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

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

LGTM, the story looks great

},
parameters: {
msw: graphqlMocks,
pseudo: { hover: ['.hover'] },
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a bit hacky but it works

@Devessier Devessier removed the run-e2e label Feb 5, 2025
@Devessier Devessier merged commit 700eb2d into main Feb 5, 2025
47 checks passed
@Devessier Devessier deleted the add-missing-workflow-node-states branch February 5, 2025 17:43
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Thanks @Devessier for your contribution!
This marks your 67th PR on the repo. You're top 1% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

eliezer-rodrigues037 pushed a commit to mind-developer/kvoip-v2 that referenced this pull request Feb 7, 2025
- Added the new workflow `not executed` node type
- Fixed minor style issues
- Created one big catalog for all node variants


![image](https://github.com/user-attachments/assets/5e510d49-c6a2-42a9-9641-057cff481dd9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants