carloea2 opened a new pull request, #5179: URL: https://github.com/apache/texera/pull/5179
### What changes were proposed in this PR? <img width="2558" height="1511" alt="image" src="https://github.com/user-attachments/assets/ff840606-ddd9-463f-a2cf-901acd8420cc" /> Implements **workflow macros**: a way to group canvas operators into a named, collapsible container, seeded by importing another workflow. **How it works** - The user drag and drop a virtual "Workflow Macro" operator. Then in the property panel, the user pick any of their workflows. On selection, the workflow's operators and links are **copied (snapshot)** into the macro with fresh IDs, there's no live link back to the source. The macro keeps the source's id/name only as a display label. - **Collapsed** mode hides the internal operators and replaces them with a single macro node on the canvas; external links that crossed into the macro are proxied through that node so the graph remains connected. **Expanded** mode shows internals inline within the frame. - Macros are pure UI grouping. They round-trip through workflow persistence (`WorkflowContent.macros[]`) and across collaborative editing, but the execution engine sees the underlying operator graph unchanged — `macroIdParent` is metadata only. **Scope of changes** - *Backend (`common/workflow-operator`)*: adds optional `macroIdParent` to `LogicalOp` and hides it from the auto-generated property form. - *Frontend types*: new `WorkflowMacro` interface; `WorkflowContent` carries an optional `macros[]`. - *Frontend graph model*: macro framing, collapse/expand visuals, proxy links, macro-aware auto-layout, collaborative sync. - *Frontend UI*: new macro side panel; context menu gains **create macro** / **remove from macro**; macro-aware delete/paste. ### Any related issues, documentation, discussions? Closes #5178. ### How was this PR tested? New unit specs covering macro ID helpers, frame geometry, internal auto-layout, macro CRUD + undo/redo bundling, create/remove predicates, macro-aware context menu, and execution payload shape: - `joint-graph-wrapper.spec.ts` (+111) - `workflow-action.service.spec.ts` (+99) - `operator-menu.service.spec.ts` (+38) - `context-menu.component.spec.ts` (+6) - `execute-workflow.service.spec.ts` (+10) Manual canvas testing: 1. Drop macro → pick a workflow → its operators copy in with fresh IDs. 2. Toggle collapse/expand → internals hide/show, external links proxy through the macro node. 3. Drag macro → children translate together; no spurious position events. 4. **Remove from macro** on a child → `macroIdParent` cleared, frame reflows. 5. Delete macro 6. ### Was this PR authored or co-authored using generative AI tooling? No https://github.com/user-attachments/assets/17bfc0ac-d45b-4b45-b556-e9d97b225be0 -- 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]
