fix(designer): fix issue where scope nodes didn't get focused when they were jumped to #4677
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily focuses on improving the user interaction with the
ScopeCard
component in thelibs/designer-ui
package. The changes introduced include the addition of a focus state for theScopeCard
and the use of optional chaining forrunData
properties.Here are the most important changes:
User Interaction Improvement:
libs/designer-ui/src/lib/card/scopeCard/index.tsx
: Implemented a focus state for theScopeCard
by usinguseRef
anduseEffect
hooks from React. This allows the card to be focused programmatically when thesetFocus
prop is true. [1] [2] [3]libs/designer/src/lib/ui/CustomNodes/ScopeCardNode.tsx
: Added theuseShouldNodeFocus
hook to determine whether theScopeCard
should be focused, and passed the result as thesetFocus
prop to theScopeCard
component. [1] [2] [3]Codebase Simplification:
libs/designer-ui/src/lib/card/scopeCard/index.tsx
: Used optional chaining forrunData
properties to simplify the code and prevent potential runtime errors.The changes in this pull request will enhance the user experience by providing visual feedback when a
ScopeCard
is focused, and improve the codebase by preventing potential errors related torunData
properties.