Copilot commented on code in PR #9408:
URL: https://github.com/apache/texera/pull/9408#discussion_r4543826453
##########
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:
The mount-time ‘read current selection’ guard only checks operators and
ports. If the shared selection already contains a highlighted link or comment
box (both appear to be first-class highlight types in this component’s stream
wiring), `showHighlighted()` won’t run on mount and the panel can incorrectly
keep showing a stale operator/port frame. Fix by including link/comment-box
highlights in the guard (or computing ‘any highlight exists’ once) so the panel
clears appropriately when arriving at a non-operator/port selection.
##########
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:
The comment says ‘Only when there is one’, but the actual guard that follows
triggers for any number of highlighted operators/ports (> 0), including
multi-selection. Recommend rewording to match the code’s intent (e.g., ‘Only
when there is some selection’) to avoid misleading future edits.
--
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]