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

Matt Gilman updated NIFI-16447:
-------------------------------
    Description: 
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.

  was:
h2. Background

The reusable canvas does not yet use one consistent contract for visibility, 
interaction gating, preview state, and connector-host persistence.

The canvas currently classifies visible, entering, and leaving components in 
updateCanvasVisibility, while individual layers expose Renderer.pan() methods. 
Click and double-click handlers are often attached only when canSelect is true 
during rendering, so editing-state changes may not affect existing elements 
until another render occurs. Processor preview status is calculated in the 
renderer instead of being carried in ProcessorUiState.preview.

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.

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.

h2. Goals

* Classify visibility inside each renderer during its normal update.
* Attach interaction handlers once and evaluate canSelect and canEdit when 
events occur.
* Stamp ui.preview where processor wrapper data is produced.
* 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.

h2. Scope

h3. 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.pan() and layer pan() methods used only to refresh entering 
and leaving components.
* Continue suppressing off-screen details and preserving entering and leaving 
transitions.

h3. 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.

h3. Preview state

* Stamp ui.preview when processor wrappers are created and refreshed.
* Stamp the same preview value on processor selection targets.
* Match readable processors using type and bundle group, artifact, and version 
against the Preview-tagged extension list.
* Make the processor renderer read ui.preview instead of performing its own 
extension lookup.
* Preserve existing badge visibility, placement, and processor-name positioning.

h3. 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 version and the local clientId.
* 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 error context.
* Keep mutation behavior disabled until the host editing gate allows it.

h3. 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.

h3. Tests

Add coverage for:

* Renderer-owned visibility classification.
* Entering, visible, and leaving transitions.
* Interaction gates changing after elements have rendered.
* Processor wrapper and selection-target preview values.
* Each reusable-canvas mutation output reaching the correct connector action.
* Local clientId substitution and exclusion of read-only revision fields.
* Gesture-baseline revision preservation.
* Single and bulk position persistence.
* Success confirmation and failure reversion.
* Saving-state cleanup.
* Stale-response protection.
* Connection policy enablement, replacement, and teardown.
* Continued read-only behavior while editing is disabled.

h2. 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 rendered appearance.
* Changes to the legacy flow-designer canvas.

h2. 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.
* The processor renderer reads ui.preview and does not inspect the extension 
list.
* The connector canvas binds every reusable-canvas mutation output listed above.
* Requests use gesture-baseline versions and the local clientId 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, strict type-check, unit tests, and production build pass.


> Give the reusable canvas one visibility pass, one selection gate, and one 
> preview flag
> --------------------------------------------------------------------------------------
>
>                 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