Skip to content

Set failed node's output as red #11358

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

Merged
merged 4 commits into from
Apr 3, 2025
Merged

Set failed node's output as red #11358

merged 4 commits into from
Apr 3, 2025

Conversation

Devessier
Copy link
Contributor

Error Success
CleanShot 2025-04-02 at 18 18 45@2x CleanShot 2025-04-02 at 18 20 23@2x

Closes twentyhq/core-team-issues#716

@Devessier Devessier requested a review from Copilot April 2, 2025 16:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new highlighting mechanism to indicate error states by rendering failed nodes in red, while allowing blue highlighting for other cases. The changes include new type definitions for node highlighting, refactoring components to use a "highlighting" prop instead of a boolean flag, and updating consumer components and stories to support the new behavior.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/twenty-ui/src/json-visualizer/types/JsonNodeHighlighting.ts Introduces the JsonNodeHighlighting type with allowed values.
packages/twenty-ui/src/json-visualizer/types/GetJsonNodeHighlighting.ts Defines the function type for obtaining node highlighting.
packages/twenty-ui/src/json-visualizer/index.ts Exports the new types for use in the UI.
packages/twenty-ui/src/json-visualizer/contexts/JsonTreeContext.tsx Replaces shouldHighlightNode with the new getNodeHightlighting property.
packages/twenty-ui/src/json-visualizer/components/internal/JsonNodeValue.tsx Refactors styling to use a highlighting prop mapped to theme colors.
packages/twenty-ui/src/json-visualizer/components/internal/JsonNodeLabel.tsx Refactors label styling to use a highlighting prop instead of a boolean.
packages/twenty-ui/src/json-visualizer/components/JsonValueNode.tsx Updates component to leverage the highlighting prop.
packages/twenty-ui/src/json-visualizer/components/JsonTree.tsx Propagates the new getNodeHightlighting property in the tree component.
packages/twenty-ui/src/json-visualizer/components/JsonNode.tsx Integrates highlighting in rendering of various node types.
packages/twenty-ui/src/json-visualizer/stories/JsonTree.stories.tsx Adds stories for both blue and red highlighting.
packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx Switches to using getNodeHightlighting for error cases in workflow output.
packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx Uses getNodeHightlighting to highlight nodes based on conditionals.
Comments suppressed due to low confidence (1)

packages/twenty-ui/src/json-visualizer/contexts/JsonTreeContext.tsx:7

  • The property name 'getNodeHightlighting' appears to have a spelling mistake. Consider renaming it to 'getNodeHighlighting' for consistency with the 'JsonNodeHighlighting' type.
getNodeHightlighting?: GetJsonNodeHighlighting;

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

The PR implements red highlighting for workflow step outputs with errors, updating both workflow and JSON visualizer components to support a dynamic, color-specific highlighting mechanism.

• /packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx now applies a red highlight when an error is detected.
• /packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx switches to using getNodeHightlighting for consistency.
• /packages/twenty-ui/src/json-visualizer/components/JsonNode.tsx and JsonValueNode.tsx now rely on a descriptive highlighting prop instead of a boolean.
• /packages/twenty-ui/src/json-visualizer/components/JsonTree.tsx and its context propagate getNodeHightlighting.
• New types in /packages/twenty-ui/src/json-visualizer/types/ ensure only 'red' or 'blue' can be used.

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

Comment on lines 434 to 441
export const BlueHighlighting: Story = {
args: {
value: {
name: 'John Doe',
age: 30,
},
getNodeHightlighting: () => 'blue',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Verify that 'getNodeHightlighting' is the intended prop name. It may be misspelled (possibly should be 'getNodeHighlighting') and must match the consuming component's API.

Comment on lines 10 to 11
getNodeHightlighting,
shouldExpandNodeInitially,
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Check spelling: 'getNodeHightlighting' may be intended as 'getNodeHighlighting'. Ensure consistent usage across the codebase.

Suggested change
getNodeHightlighting,
shouldExpandNodeInitially,
getNodeHighlighting,
shouldExpandNodeInitially,

import { createContext } from 'react';

export type ShouldExpandNodeInitiallyProps = { keyPath: string; depth: number };

export type JsonTreeContextType = {
shouldHighlightNode?: (keyPath: string) => boolean;
getNodeHightlighting?: GetJsonNodeHighlighting;
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Typo: 'getNodeHightlighting' likely should be 'getNodeHighlighting'.

Suggested change
getNodeHightlighting?: GetJsonNodeHighlighting;
getNodeHighlighting?: GetJsonNodeHighlighting;

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

@Devessier Devessier merged commit bea75b9 into main Apr 3, 2025
47 checks passed
@Devessier Devessier deleted the output-error-red branch April 3, 2025 06:58
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.

Display the failing outputs in red
2 participants