-
Notifications
You must be signed in to change notification settings - Fork 195
CSE Machine : Fix Highlighting #3690
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
Changes from all commits
b86162a
45bac46
423f7ba
7766734
22cb2af
29abfea
fb3e1d3
2e56e4b
8a4dcba
b6c8505
e418934
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -146,7 +146,7 @@ export class GenericArrow<Source extends IVisible, Target extends IVisible> | |||||||||||||||||||||||||||||||
| * Subclasses can override this to provide custom hover colors. | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| protected getHighlightedColor(): string { | ||||||||||||||||||||||||||||||||
| return Config.ArrowHighlightedColor; | ||||||||||||||||||||||||||||||||
| return this.isLive ? Config.ArrowHighlightedColor : Config.ArrowDeadHighlightedColor; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| onMouseEnter = (e: KonvaEventObject<MouseEvent>) => { | ||||||||||||||||||||||||||||||||
|
|
@@ -189,8 +189,9 @@ export class GenericArrow<Source extends IVisible, Target extends IVisible> | |||||||||||||||||||||||||||||||
| this.arrowHeadRef.current.pointerWidth(Config.ArrowHoveredHeadSize); | ||||||||||||||||||||||||||||||||
| this.arrowHeadRef.current.pointerLength(Config.ArrowHoveredHeadSize); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| this.source.setArrowSourceHighlightedStyle?.(); | ||||||||||||||||||||||||||||||||
| this.target?.setArrowSourceHighlightedStyle?.(); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| public setNormalStyle() { | ||||||||||||||||||||||||||||||||
|
Akshay-2007-1 marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||
| const color = this.isLive ? defaultStrokeColor() : fadedStrokeColor(); | ||||||||||||||||||||||||||||||||
| if (this.pathRef.current) { | ||||||||||||||||||||||||||||||||
|
|
@@ -202,19 +203,16 @@ export class GenericArrow<Source extends IVisible, Target extends IVisible> | |||||||||||||||||||||||||||||||
| this.arrowHeadRef.current.pointerWidth(Config.ArrowHeadSize); | ||||||||||||||||||||||||||||||||
| this.arrowHeadRef.current.pointerLength(Config.ArrowHeadSize); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| this.source.setArrowSourceNormalStyle?.(); | ||||||||||||||||||||||||||||||||
| this.target?.setArrowSourceNormalStyle?.(); | ||||||||||||||||||||||||||||||||
|
Comment on lines
203
to
+207
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Hovering away from an unselected arrow can incorrectly remove the highlight from a shared node that is part of a separate, selected arrow. Suggested FixUpdate the Prompt for AI Agent
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doc_2026-03-26_14-15-48.mp4This is a real issue!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are absolutely right, this is a critical issue that needs to be addressed. The bug occurs because To fix this simply, we need to ensure that a node's style is only reset if it is not currently highlighted by the globally selected arrow. This requires a two-part change:
I've provided a code suggestion below for the change in
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martin-henz @RichDom2185 @Oofky
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, feel free to ignore. You may want to add a comment why.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, can ignore from this PR. But please create an issue that references this comment thread.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've created it: #3696 |
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| onClick = (e: KonvaEventObject<MouseEvent>) => { | ||||||||||||||||||||||||||||||||
| e.cancelBubble = true; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Toggle selection - clear first, then select if it wasn't already selected | ||||||||||||||||||||||||||||||||
| const wasSelected = this.isSelected(); | ||||||||||||||||||||||||||||||||
| const oldArrow = arrowSelection.clearSelection(); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Update old arrow's visual state | ||||||||||||||||||||||||||||||||
| if (oldArrow && oldArrow !== this) { | ||||||||||||||||||||||||||||||||
| oldArrow.setNormalStyle(); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| arrowSelection.clearSelection(); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if (!wasSelected) { | ||||||||||||||||||||||||||||||||
| this.select(); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.