yangzhang75 commented on code in PR #9408:
URL: https://github.com/apache/texera/pull/9408#discussion_r4544209986
##########
frontend/src/app/workspace/component/property-editor/property-editor.component.ts:
##########
@@ -257,13 +260,21 @@ export class PropertyEditorComponent implements OnInit,
OnDestroy, OnChanges {
}
/**
- * This method changes the property editor according to how operators are
highlighted on the workflow editor.
- *
- * Displays the form of the highlighted operator if only one operator is
highlighted;
- * Displays the form of the link breakpoint if only one link is highlighted;
- * hides the form if no operator/link is highlighted or multiple operators
and/or links are highlighted.
+ * Shows the selection the panel mounts into, then follows every change to
it: one operator or
+ * one port opens its frame, anything else (nothing, several things, a link)
shows no frame.
*/
registerHighlightEventsHandler() {
+ // The selection outlives this panel: it lives in the graph wrapper, which
both views of a
+ // workflow share and hand over between them, so a panel mounting into an
existing selection
+ // never sees the event that made it. Show it now, then follow the changes
-- otherwise the
+ // panel looks empty until the selection changes, and clicking the very
step it should be
+ // showing is a no-op (an already-highlighted element emits nothing). Only
when there is one:
+ // the no-frame branch is for a selection being dropped (it clears the
editing marker and
+ // resizes the docked panel to its empty content), which a fresh mount
must not do.
+ const wrapper = this.workflowActionService.getJointGraphWrapper();
+ if (wrapper.getCurrentHighlightedOperatorIDs().length > 0 ||
wrapper.getCurrentHighlightedPortIDs().length > 0) {
+ this.showHighlighted();
+ }
Review Comment:
A fresh mount has no frame to go stale: `registerHighlightEventsHandler()`
runs only from `ngOnInit`, where `currentComponent` is still null. The guard
keeps the no-frame branch off the mount path because that branch has side
effects that belong to a selection being dropped: it clears the
`currentlyEditing` awareness marker and resizes the docked panel to its empty
content. With a link or a comment box selected the panel stays as it mounted,
empty, which is exactly what that branch would have shown. The comment now says
this (e991a1e23).
##########
frontend/src/app/workspace/component/property-editor/property-editor.component.ts:
##########
@@ -257,13 +260,21 @@ export class PropertyEditorComponent implements OnInit,
OnDestroy, OnChanges {
}
/**
- * This method changes the property editor according to how operators are
highlighted on the workflow editor.
- *
- * Displays the form of the highlighted operator if only one operator is
highlighted;
- * Displays the form of the link breakpoint if only one link is highlighted;
- * hides the form if no operator/link is highlighted or multiple operators
and/or links are highlighted.
+ * Shows the selection the panel mounts into, then follows every change to
it: one operator or
+ * one port opens its frame, anything else (nothing, several things, a link)
shows no frame.
*/
registerHighlightEventsHandler() {
+ // The selection outlives this panel: it lives in the graph wrapper, which
both views of a
+ // workflow share and hand over between them, so a panel mounting into an
existing selection
+ // never sees the event that made it. Show it now, then follow the changes
-- otherwise the
+ // panel looks empty until the selection changes, and clicking the very
step it should be
+ // showing is a no-op (an already-highlighted element emits nothing). Only
when there is one:
Review Comment:
Agreed, reworded in e991a1e23: only when something is selected, with the
reason spelled out.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]