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

kie-issues#1773: DMN Editor: Render badges with evaluation status on Decision nodes #2868

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jomarko
Copy link
Contributor

@jomarko jomarko commented Jan 22, 2025

Closes: apache/incubator-kie-issues#1773

TODO

  • Create story that would demonstrate badges, it should be very similar story as we have for badges in the boxed expression editor
  • use existing evaluationResults prop instead of evaluationStatus that was added in the draft

Success badge - current proposal

Screenshot 2025-01-22 120830

Failure badge - current proposal

image

@jomarko jomarko marked this pull request as ready for review January 24, 2025 13:59
@jomarko jomarko requested a review from tiagobento as a code owner January 24, 2025 13:59
Copy link
Member

@thiagoelg thiagoelg left a comment

Choose a reason for hiding this comment

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

This looks good @jomarko, thanks for the PR!
Added a single comment regarding re-renders.

@@ -402,6 +403,13 @@ export const DecisionNode = React.memo(
);
});

const isEvaluationHighlightsEnabled = useDmnEditorStore((s) => s.diagram.overlays.enableEvaluationHighlights);
const { evaluationResults } = useDmnEditor();
const evaluationResultsClassName =
Copy link
Member

Choose a reason for hiding this comment

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

This should be a useMemo to avoid unnecessary re-renders

@tiagobento
Copy link
Contributor

tiagobento commented Jan 31, 2025

@jomarko Would it be possible to make the badges not hide the border of the nodes? Also, how do they look like when they're hovered/selected? Another feedback I have it regarding the alignment. I think the x and are too left-aligned. Recording a video always helps with reviews :D

@jomarko
Copy link
Contributor Author

jomarko commented Feb 3, 2025

Hi @tiagobento ,

01 hover

There is no behavior for hovering. We didn't define it in the feature definition phase. What is your suggestion for the 'hover' situation?

02 alignment

Should be fixed. I didn't record a video as it is enough to start playbook as pnpm -F @kie-tools/dmn-editor start

03 Border

this is the most problematic as the current border of nodes has width 1.5px. From reading some internet threads, it seems as not ideal to use fractions and pixels together.

I tried to margin my pseudo element with:

  1. 1px
  2. 1.5px
  3. 2px

however there is some rounding and it is never correct result.

1px

image

1.5px, 2px

for both the same result, 1.5 is rounded to 2
image

What I could do is to change NodeStyle.ts where we define default stroke width export const DEFAULT_NODE_STROKE_WIDTH = 1.5;, however any change we would do there (1px or 2px) would affect all tests.

@tiagobento
Copy link
Contributor

@jomarko Right... Hmmm... I think the 2px compromise is better? I'd go with the 2px :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DMN Editor: Render badges with evaluation status on Decision nodes
3 participants