[ 
https://issues.apache.org/jira/browse/NIFI-16447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman updated NIFI-16447:
-------------------------------
    Summary: Align reusable canvas visibility, interaction, and connector 
mutation contracts  (was: Give the reusable canvas one visibility pass, one 
selection gate, and one preview flag)

> Align reusable canvas visibility, interaction, and connector mutation 
> contracts
> -------------------------------------------------------------------------------
>
>                 Key: NIFI-16447
>                 URL: https://issues.apache.org/jira/browse/NIFI-16447
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core UI
>            Reporter: Matt Gilman
>            Assignee: Matt Gilman
>            Priority: Major
>
> BACKGROUND
> The reusable canvas does not yet use consistent contracts for visibility, 
> interaction gating, and connector-host persistence.
> Visibility is classified centrally while individual renderers expose pan() 
> methods. Click and double-click handlers are often attached only when 
> selection is enabled during rendering, so editing-state changes may not 
> affect existing elements until another render occurs.
> The connector canvas also does not bind the reusable canvas mutation outputs. 
> Component dragging, label resizing, bend updates, connection-label movement, 
> connection creation, and endpoint reconnection therefore have no 
> connector-scoped action and effect boundary.
> The reusable canvas additionally contains dormant Processor Preview badge 
> support. NiFi does not provide Preview-tagged extension classification to the 
> canvas, so this unsupported capability should be removed to avoid suggesting 
> that it is functional.
> Upcoming troubleshooting features enable editing on an already-mounted canvas 
> and depend on bulk-position persistence, current selection, permissions, and 
> visual bounds. These shared contracts should be established before those 
> features build on them.
> GOALS
> • Classify visibility inside each renderer during its normal update.
> • Attach interaction handlers once and evaluate canSelect and canEdit when 
> events occur.
> • Remove the unsupported Processor Preview badge capability.
> • Connect reusable-canvas mutation outputs to typed connector state actions 
> and effects.
> • Preserve revisions correctly across gesture, request, success, and failure 
> paths.
> • Preserve current rendered appearance and read-only behavior.
> SCOPE
> Visibility
> • Move viewport classification out of CanvasComponent.updateCanvasVisibility 
> and into each renderer update.
> • Apply the same visibility contract to funnel, label, port, processor, 
> process-group, remote-process-group, and connection renderers.
> • Remove renderer and layer pan() methods used only to refresh entering and 
> leaving components.
> • Continue suppressing off-screen details and preserving entering and leaving 
> transitions.
> Selection and edit gating
> • Attach click and double-click handlers when rendered elements enter.
> • Evaluate getCanSelect() and getCanEdit() inside each event handler.
> • Do not omit handlers because editing or selection was disabled when the 
> element was rendered.
> • Apply the same live gating to component dragging, connection creation, bend 
> editing, label movement, resizing, and endpoint reconnection.
> • Ensure changing editing state affects the next interaction without 
> requiring wrapper or DOM reconstruction.
> Processor Preview badge removal
> • Remove the unused previewExtensions canvas input and connector-host wiring.
> • Remove Preview state from processor UI metadata and selection targets.
> • Remove Processor Preview badge rendering, styles, positioning logic, and 
> tests.
> • Keep normal processor-name placement unchanged.
> Connector canvas mutation integration
> Bind the connector canvas to these reusable-canvas outputs:
> • componentsDragEnd
> • labelResizeEnd
> • connectionBendPointsUpdate
> • connectionLabelDragEnd
> • createConnectionRequested
> • connectionDestinationChangeRequested
> For each mutation:
> • Add typed connector-canvas actions, effects, and service requests.
> • Keep the reusable canvas independent of connector state and NgRx.
> • Preserve the gesture-baseline revision emitted by the canvas.
> • Build request revisions containing only the version and local client ID.
> • Do not copy read-only revision fields into request payloads.
> • Support single and bulk component-position updates.
> • Update the appropriate typed entity collection from successful responses.
> • Apply revision-aware reconciliation so stale responses cannot replace newer 
> entities.
> • Mark affected canvas items as saving while requests are active.
> • Invoke the reusable canvas confirmation API after success.
> • Invoke the corresponding revert API after failure.
> • Surface failures through the connector canvas error context.
> • Keep mutation behavior disabled until the host editing gate allows it.
> Connection policy
> • Provide the connector canvas with a ConnectablePolicy backed by live edit 
> state and component permissions.
> • Validate source and destination eligibility using the current entities and 
> process group.
> • Keep connection creation and reconnection inert while editing is disabled.
> • Ensure policy replacement or removal tears down stale handles, previews, 
> and listeners.
> TESTS
> Add coverage for:
> • Renderer-owned visibility classification.
> • Entering, visible, and leaving transitions.
> • Interaction gates changing after elements have rendered.
> • Removal of Processor Preview badge plumbing.
> • Each reusable-canvas mutation output reaching the correct connector action.
> • Local client ID substitution and exclusion of read-only revision fields.
> • Gesture-baseline revision preservation.
> • Single and bulk position persistence.
> • Successful optimistic-state confirmation.
> • Failed optimistic-state reversion.
> • Saving-state cleanup.
> • Stale-response protection.
> • Connection policy enablement, replacement, and teardown.
> • Continued read-only behavior while editing is disabled.
> OUT OF SCOPE
> • Entering or ending troubleshooting mode.
> • Troubleshooting route guards and banners.
> • Component run-status commands and operation panels.
> • Processor advanced UI.
> • Controller Service management.
> • Alignment commands, Remote Process Group refresh, and provenance replay.
> • Changes to REST resource semantics.
> • Changes to the legacy flow-designer canvas.
> ACCEPTANCE CRITERIA
> • The canvas no longer owns renderer visibility classification.
> • Renderers no longer expose pan() solely for viewport refresh.
> • Selection and editing changes take effect on the next event without handler 
> reattachment.
> • Unsupported Processor Preview badge plumbing is removed.
> • The connector canvas binds every reusable-canvas mutation output listed 
> above.
> • Requests use gesture-baseline versions and the local client ID without 
> read-only revision fields.
> • Successful requests reconcile the correct entities and confirm optimistic 
> state.
> • Failed requests revert optimistic state and clear saving indicators.
> • Stale responses cannot overwrite newer revisions.
> • Connection behavior remains inert while editing is disabled.
> • Existing rendered appearance and read-only interactions remain unchanged.
> • Frontend lint, unit tests, and production build pass.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to